android quiz, how to prevent users to see the questions/answers in SQLite DB?
I,m creating a quiz to Android, and my questions and answers are stored in the SQLite DB. Now I realized that maybe users can browse the db and see all questions and answers from the device if they have the apropriate tools, am I right? How can I prevent them from users from seeing my data? Is it possible to use a password to access data, or something like that?
Thanks in 开发者_运维技巧advance,
João
Consider using the javax.crypto
api. Store your answers in the database as encrypted strings, and then use the encryption key in your app's code to decrypt the data after it's read from the database.
Remember that a determined user will find a way to break your encryption (typically by coercing the encryption key out of your app's source code), and there is no such thing as 100% secure when dealing with untrusted parties (i.e. users).
Yes, it's definitely possible!
You can encode and decode the data with a key. At least, it will be not directly readable.
Each time you write data in your DB, you encode it. Each time you read it, you decode it.
精彩评论