AES256 PasswordBased Encryption/Decryption

USAGE:

Initialise a SecureMyText object with following syntax

SecureMyText secure=new SecureMyText(context,String password for encryption);

Use the created object to perform encryption.

For encrypting the text

String encrypted_text = secure.encrypt(string to be encrypted);

For getting final encrypted text containing salt and IV to be transferred.

String encrypted_text_to_be_transferred = secure.EncryptToFinalTransferText(string to be encrypted);

For decrypting initialization remains the same

String plain_text = secure.decrypt(string to be decrypted);

For more details look for the SecureText class in main java folder. All the instructions are given in the file itself. Copy the lightweight class into your project and customise it according to your needs.

The sample folder has the sample android application that shows a sample implementation of the encryption/decryption.

Explaination of the whole encryption and decryption process taking example of app to server communication with notes and flow diagrams is attached.

https://github.com/rishelarora/AES256PasswordBasedEncryption-Decryption

Advertisements