Skip to main content

Timeline for File encryption design

Current License: CC BY-SA 3.0

19 events
when toggle format what by license comment
Jun 1, 2017 at 7:47 answer added Michael timeline score: 0
May 31, 2017 at 15:02 vote accept Michael
May 31, 2017 at 14:57 answer added Fis timeline score: 2
May 31, 2017 at 14:42 comment added Fis Let us continue this discussion in chat.
May 31, 2017 at 14:41 comment added Fis This has just one problem. When you will wish to change KEK in KMS you have to re-encrypt all DEK's in the DB. If you just want to keep it simple and cheap just avoid the KMS and store KEK in application config.
May 31, 2017 at 14:40 comment added Fis I thought you will use just one key in KMS so called Key Encryption Key. Then you will generate some data encryption key which you would use to encrypt the data. Then you encrypt this data encryption key using KMS and store the encrypted data encryption key in database together with the data. If you will need to acess the data you simply will get both, encrypted data and encrypted data encryption key from the DB then you ask KMS to decrypt the data encryption key then you decrypt the data using decrypted key then you securely release it from memory. But there will be only the one KEK in KMS.
May 31, 2017 at 14:36 comment added Michael Yes, KMS is a closed store for keys. Only accessible by Amazon for encrypt/decrypt files. I suppose could store keys in an encrypted file if I want to use kms as a key store. But I want to keep complexity down. If it get complex enough the files might be at risk because of me loosing track of the keys..
May 31, 2017 at 14:33 comment added Fis I didn't work with KMS but isn't it same as HSM? So you store key there and you can't get it out from there anymore? And then you just pass data to be decrypted / encrypted there? On other hand, if it is like that it will not probably be cheap correct?
May 31, 2017 at 14:31 comment added Fis I just thought you would use KMS as a secure key encryption key store. Its better to have the key there only than somewhere in config.
May 31, 2017 at 14:30 comment added Michael ok, but why would I need KMS for this? To encrypt my encryption keys stored in Postgres I only need a master key that's known by my server. Probably a good idea. Upside with kms would be that I can rotate the master key, but this would lead to non-decryptable keys in the database as these keys are decrypted with an old kms master key. I might have misunderstood, though..
May 31, 2017 at 14:27 review Close votes
Jun 1, 2017 at 19:37
May 31, 2017 at 14:25 comment added Fis Sorry, edited too many times: I can also see third option. To store data encryption key encrypted with the KMS key in the DB so basically combination of both methods. You would not need to use so many KMS keys, one can be enough. Then you decrypt the data encryption key then you decrypt the data with decrypted data encryption key :)
May 31, 2017 at 14:17 comment added Fis If it is like that I would go for cheaper solution. You correctly stated cons and pros of both methods. You should know what you want the data protect against. I can also see third option. To store data encryption key with encrypted with the KMS key in the DB so basically combination of both methods.
May 31, 2017 at 14:16 comment added Michael Most clients want to hear that their files are encrypted. Some files are actually sensitive for real (floor plan blue prints).
May 31, 2017 at 14:14 comment added Fis What is the reason for data encryption?
May 31, 2017 at 14:12 history edited user CC BY-SA 3.0
Incorporate from comments
May 31, 2017 at 14:11 comment added Michael Should I use kms or generate keys myself?
May 31, 2017 at 14:10 comment added user What's the question?
May 31, 2017 at 14:06 history asked Michael CC BY-SA 3.0