Tag: encryption

Using Android NDK for encryption of data passed from normal android app

Is it possible and worth trying to develop some server application using android NDK which will encrypt data (or just use some built in Linux encryption library) passed to it from normal Java based application? I tried using Cipher library, but it took almost a minute to encrypt 2MB file with AES. And blowfish is […]

Getting “EVP_DecryptFinal_ex:wrong final block length” during decryption

I followed this tutorial for encrypting and decrypting simple strings in android/java: https://stackoverflow.com/questions/4319496/how-to-encrypt-and-decrypt-data-in-java I made a Cryptography class: public class Cryptography { public static SecretKey generateKey() throws NoSuchAlgorithmException { MessageDigest digest = MessageDigest.getInstance(“SHA”); digest.update(“BhLKTyLoP YroUsRQT”.getBytes()); return new SecretKeySpec(digest.digest(), 0, 16, “AES”); } public static byte[] encrypt(String message, SecretKey key) throws NoSuchAlgorithmException, BadPaddingException, IllegalBlockSizeException, NoSuchPaddingException, InvalidKeyException, […]

Encrypt video on the fly from android camera

I want to encrypt video on the fly that android camera captures. So I need to tell android MediaRecorder to write it video stream to my CipherOutputStream. The problem is MediaRecorder.setOutputFile() method accepts only FileDescriptor and there is no way to get encrypting file descriptor from CipherOutputStream. So my question is how can I either […]

CryptographicException: Bad PKCS7 padding

I am seeing a small percentage of production users randomly report this exception related to encrypting/decrypting strings with Xamarin.Android but unfortunately I cannot reproduce it. What could cause this and/or how could I reproduce the exception so that I can figure out a fix/workaround? [CryptographicException: Bad PKCS7 padding. Invalid length 147.] Mono.Security.Cryptography.SymmetricTransform.ThrowBadPaddingException(PaddingMode padding, Int32 length, […]

Keeping secret key SECRET – within Android app.. any ideas

I have an mcrypt encryption and decryption routine within one of my Android apps. This is essentially decrypting a string which is fetched via. remote call. Naturally the “secret key” is stored within the code, but anyone with apktool can obviously see the code and see my secret key. Is there anyway to encrypt all […]

Best practice for en-/decrypting large files with less memory

I want to develop an Android app for encrypting and decrypting large files (~500Mb) with RSA and some symmetric encryption algorithms. How can I achieve this? What is the best solution to use on devices with just a few MB RAM? Regards Bobby

Encryption between Android and C#

I am using the following C# source code to encrypt plain text using AES (ECB 256): public static string Encode(string PlainText) { byte[] Key = ASCIIEncoding.UTF8.GetBytes(“12345678901234567890123456789012”); string encrypted = null; RijndaelManaged rj = new RijndaelManaged(); rj.BlockSize = 256; rj.KeySize = 256; rj.Key = Key; rj.GenerateIV(); byte[] IV = rj.IV; rj.Mode = CipherMode.ECB; rj.Padding = PaddingMode.Zeros; […]

Is Bluetooth File Exchange Completely Secure?

What are some possible attacks that I could face when I transfer a file via bluetooth? Also, are files transferred between Android phones via bluetooth encrypted?

Android :How to unzip a encrypted zip file

in winzip I am able to encrypt a file using some keys. In my android application I am using the encrypted zip file. I know the way for unzip a file (without encryption). but how can I unzip the encrypted zip file in android?

How does Android's app/signature verification work?

I want to preface this question with two things so I can narrow down where my actual question is: a) I’ve done software dev before, though never for android b) I’m familiar with PKI and encryptions and hashing and digital signatures and blah blah blah That being said I’m having trouble tracking down more information […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.