Say you want to encrypt a large file, perhaps a backup of a database. Encrypting the file will naturally take some time, due to the amount of data.

Now, if at any point you want to change the password protecting the file, a simple implementation would re-encrypt the entire file.

Another solution is to generate a key K, and use that to encrypt the file. Then encrypt K based on the password, and store the result with the encrypted file (perhaps in some meta data). Now, changing the password only requires a decrypt and re-encrypt of K using the new password, making the operation much much faster.

Is there a name for this kind of design?

  • Jonathan

PS: Appologies for the somewhat crude description, I am not well-versed in cryptology.

  • $\begingroup$ The term is mostly used in the context of public key encryption, but I'd still consider this KEM/DEM or key-encapsulation. $\endgroup$ – CodesInChaos Jul 29 '17 at 21:15
  • $\begingroup$ And the act of encrypting the key with another key is called "key-wrapping" - so that would be a possible underlying technology. I've also seen "hierarchical encryption" being used, where a top level key is used to encrypt (or otherwise create or protect) lower end keys. But note that you could also use key derivation to derive the underlying keys, which makes both terms a bit tricky. A "key hierarchy" would probably be the best generic term. $\endgroup$ – Maarten Bodewes Jul 29 '17 at 22:04
  • 1
    $\begingroup$ Another term I've seen for this, particularly in AWS documentation, is envelope encryption. Also, the terms data encryption key (DEK) and key encryption key (KEK) are fairly standard when talking about this sort of system. $\endgroup$ – Luis Casillas Jul 30 '17 at 4:23
  • 2
    $\begingroup$ To me this is an application of an hybrid encryption scheme. Which happen to be encrypting a DEK using a KEK, as Luis said. $\endgroup$ – Lery Jul 30 '17 at 4:43
  • 1
    $\begingroup$ @Lery A hybrid encryption scheme commonly uses asymmetric and symmetric cryptography. No asymmetric algorithms are mentioned in the question. $\endgroup$ – Maarten Bodewes Jul 23 '18 at 21:22

The random key that encrypts the message is commonly called a Data Encryption Key or DEK using a Data Encryption Mechanism or DEM. If this key is encrypted then it is encrypted using a Key Encryption Key or KEK within a Key Encryption Mechanism or KEM. Instead of "encryption" the term "enveloping" may also be used. An encrypted key is also called a wrapped key and the key that does the wrapping is then called a wrapping key. This just names the keys and lower mechanisms, not the overall scheme.

I'm not sure if there is a single term that is used for for this type of scheme. Usually the scheme is not explicitly mentioned. It is often part of a scheme that specifies a container format such as PGP. PGP however calls the data keys session keys:

The message is encrypted with a session key, and the session key is itself encrypted and stored in the Encrypted Session Key packet or the Symmetric-Key Encrypted Session Key packet.

Note that PGP can also directly encrypt using the key derived from the password.

I've heard the term key hierarchy used a lot in this sense. Here the password / derived key is a higher level key than the one encrypting the data itself. Multiple data keys may be encrypted or derived from the password derived key material. So you could say that the file is encrypted using a hierarchy of keys, but you would likely still be required to explain what you mean by that.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.