• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps help: encryption/decryption in android

I am writing an application which encrypts and decrypts the user notes based on the user set password. i used the following algorithms for encryption/decryption 1. PBEWithSHA256And256BitAES-CBC-BC 2. PBEWithMD5And128BitAES-CBC-OpenSSL
e_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC);
d_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC);
e_Cipher.init()
d_Cipher.init()
encryption is working well, but when trying to decrypt it gives
Exception - Illegal Block size
after encryption i am converting the cipherText to HEX and storing it in a sqlite database. i am retrieving correct values from the sqlite database during decyption but when calling d_Cipher.dofinal() it throws the Exception.

I thought i missed to specify the padding and tried to check what are the other available cipher algorithms but i was unable to found.
so request you to please give the some knowledge on
what are the cipher algorithms and padding that are supported by Android? if the algorithm which i used can be used for padding, how should i specify the padding mechanism?

I am pretty new to Encryption so tried a couple of algorithms which are available in BouncyCastle.java but unsuccessful.
 
Welcome to the forum! :D

Hey, it's only been a few hours. Your subject line is quite good, someone will no doubt get back to you "soon". In the meantime, try to be patient. I know it's difficult. :o

Incidentally, it's good policy to search for threads with zero responses, to look for questions that need answering. So, by adding your 2nd post to this thread, you've actually done yourself a disservice because your thread no longer shows up in 0-response searches. Now you know.

Good luck!
 
Back
Top Bottom