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.