I generate a small metadata file (2KB) from my app which needs to be unreadable if the user browse through file system. These files will not be transferred elsewhere through my app.
After prolong research I figured I have to use Symmetry
encryption. But I am lost what type of algorithm and how to use key/salt. Efficiency of the algorithm is important because the file is updated on onPause method.
- Should I declare it in code and use that for all users or should I generate new one for each user. If I go with second option, where do I store the key/salt for later use. Should I obfuscate the code? Please advice.
- Currently I have short listed these two. Are they secure enough for my requirement? How can I improve them?
http://www.codejava.net/coding/file-encryption-and-decryption-simple-example