Protect and secure the local user data in android

2019-08-30 19:21发布

问题:

I currently work on a web message application , and I am storing the chat log on the database and some user data on share preferences.

The problem is, I wonder are there any way to make the data not accessible/ not readable when I open them in file explorer? Or how can I implment higher protection measures on the data ? I have searched for some approach but it somehow does not fit for the web messaging application.

For example:

  1. Store data on server. If the data is chat log then there is a huge set of data and the network traffic to the server is very high

  2. Encryption. If I use the SHA or else to encryt the data , it is not possible to read them

Thanks for helping

回答1:

Database can be accessed if the phone is rooted, so you should encrypt the data that is stored in the database and decode it when reading from the database.



回答2:

You probably could use one way RSA encryption, storing a key to decrypt the content (when required) on the server and the one way encryption key can be on the device. Reading the key alone should not create a lot of load on the server.

The key will be in the device memory at the time of decryption but intercepting in there may already be complex.