Apologies if this has been asked before. I am looking to encrypt documents befor
ID: 654063 • Letter: A
Question
Apologies if this has been asked before.
I am looking to encrypt documents before storing in the cloud.
There will be a separate metadata storage, which could be either internal or cloud hosted.
My strategy would be to generate a new symmetric key for each document (or batch of documents if key generation is expensive), and then to encrypt the key used with another 'global' key (symmetric or asymmetric) and recording this encrypted key within the metadata storage.
The documents are safe so long as the global key is not compromised, but it could make key management easier since changing the global key means reencrypting the key used in metadata only, rather than having to reencrypt the cloud hosted document.
Does this sound a sensible strategy, or is there a better one you could recommend?
Explanation / Answer
First, it's no problem to use a different symmetric key for each document, generation is easy as you just have to generate a 16-64 byte random string, a matter of a millisecond (mostly).
As threats I guess you consider your cloud hoster and anyone who can get their hands on the documents.
The approach you propose should work.
The document needs to be encrypted and authenticated using an AEAD mode like AES-GCM.
You add a header (which may be stored on the metadata storage, no matter where), which is authenticated and encrypted (using an AEAD mode like AES-GCM) using your master-key.
Scenario 1: You do this for personal access. You can store the metadata locally or on the cloud, it won't make a difference.
You should use password-based key derivation to derive the master key from your password. The master-key will be symmetric and be used to encrypt+authenticate/decrypt+verify the file-header.
Scenario 2: You do this for a company, or a larger group of people. You should go with cloud-hosting the meta-data so everyone has access if needed.
You store the header encrypted as described above.
You give everyone a copy of the master-key, so they can encrypt it using their very own password (again using authenticaed encryption + PBKDF)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.