I am using https://github.com/simbiose/Encryption to encrypt data in my android app.
I thought of double encryption.
String key = "key";
String salt = "someSalt";
byte[] iv = new byte[16];
Encryption encryption = Encryption.getDefault(key, salt, iv);
String encrypted = encryption.encryptOrNull("Some String");
Log.d("Encrypto", "Encryption Level 1 : "+encrypted);
encrypted = encryption.encryptOrNull(encrypted);
Log.d("Encrypto", "Encryption Level 2 : "+encrypted);
String decrypted = encryption.decryptOrNull(encrypted);
Log.d("Encrypto", "Decryption Level 2 : "+decrypted);
decrypted = encryption.decryptOrNull(decrypted);
Log.d("Encrypto", "Decryption Level 1 : "+decrypted);
This works perfectly, but is it recommended?
- yes this increases the memory usage to store the encrypted string, but if it makes it more secure, using more memory is pretty okay.
- Will i face some problems if i do this ?
Main question: is this a good encryption library? if not please recommend me a better one
See Question&Answers more detail:os