I want to encrypt/decrypt a file on sd card so that no one can access that file on android. Is there any possibility to开发者_如何学运维 do that? Any code?
You can easily encrypt file on Android, but you need a key to encrypt data.
Where will you store that key? Inside apk? Capable engineers will be able to reverse-engineer your apk and extract the key.
The only secure option is to require user to enter password, which you use to hash the key. This will prevent 3rd parties (= stolen phone) to get to the file, but it will not prevent owners of the phone access to the file (i.e. DRM not possible).
精彩评论