I've got an existing (personal) backup service which I'm rewriting from the ground up to be secure.
At present, I just store files (and diffs) in AWS S3 with no encryption. It works fine but I'd like to make sure my data can't be leaked.
For the sake of this discussion, I'm assuming the S3 data can be read by someone else. I want to be able to to backups without having to provide a key/password on startup.
My current plan is as follows:
Generate a public/private key pair. Store the private key somewhere safe (without writing to local disk). Store the public key locally.
On a per-file basis (or part of file):
- Securely generate a symmetric key
- Use the symmetric key to encrypt the file
- Encrypt the symmetric key using the public key
- Store the IV, encrypted symmetric key and encrypted file data in S3
Am I correct in assuming that even though all the data from the last point above can potentially be read by someone else, the fact that the private key is required to recover the symmetric key means this is secure?
Am I missing anything obvious?