I am receiving sensitive data over an HTTPS connection and need to store this on disk, encrypted so no one can tamper with it, but for reading later on. Each user in the system has a password.
The application needs to store the information received through HTTPS in case that no internet connection is available. One-time sync and then reading a file that contains the most important information. Of course, an automatic sync will take place when a connection can be made. The information is needed to ensure the user has permission to do certain actions, and so the user shouldn't be able to tamper with the file himself.
What is the best way to go about this?
1) Topics like this, this and this suggest using a password and something like PBKDF2 to generate a key, which can be used to encrypt the key that encrypts the data. Am I right in understanding this?
2) If so, should the key that encrypts the data also be derived from the user password? To me this sounds shady, to say the least.
3) I don't know enough about disassembly, but I'm afraid of the possibility that an adversary can hijack the binary, and tamper with the HTTPS-received data, before it will be encrypted. Is this a substantial risk? Should encryption be done on the server and if so, how does this change the protocol?
The product runs on OSX, Windows and possibly Linux in the future.