This topic discusses how encryption and decryption works in Android.
AES encryption of data using password in a secure way
The following example encrypts a given data block using AES. The encryption key is derived in a secure way (random salt, 1000 rounds of SHA-256). The encryption uses AES in CBC mode with random IV.
Note that the data stored in the class
encryptedData) can be concatenated to a single byte array. You can then save the data or transmit it to the recipient.
The following example code shows how to test encryption and decryption:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0