In my Flutter app I have some sensitive data stored in a database. I want to do the following:
- When installing the app, encrypt the data and store it in database.
- Each time the app runs, retrieve the data from database and decrypt it.
I looked at some Flutter encryption packages, and it looks like they will do the trick, however, my question is as follows:
How do I safely store the encryption key between the runs of the app so a hacker won't be able to get them from the artifacts that are installed on Android or iOS device?
Is flutter_secure_storage something designed for this specific task, or is there another way to do it?
BTW, encrypting the whole database might be another option, but I don't see how to do it either - I use sqflite.