I have an app that will be used by 2 or 3 users. The original design was based on single use and SQlite but I decided to stay with SQlite. No heavy usage so I don’t think we will run into problems. The thing is, due to compliancy rules the database must be encrypted. For single use that is no problem with SQlite, but what to do with multiple users?
Any suggestions? I have an RC4 algorithm for symetrical encryption. Is it a good choice to encrypt data before storing it and decrypt upon retrieval or do smarter solutions exist?
Use the built-in encryption options on the SQLiteDatabase class and you’re all set. Just a couple lines of code.
Mmmm… user A starts working, decrypts the database… what happens with user B, do I have to check wether the database is already decrypted? Same with closing…
No, you set the password before connecting to the database.
Basically, create your database as usual, but after the first connection call Encrypt with the password you want to use. Now disconnect and try to connect again. You’ll get an error. Set the EncryptionKey property before connecting and try again. It’ll work this time.
That’s really all you need to think about.