I need to encrypt user entered data in my java based web-application (using jasypt) which is persisted in a MySQL Database and I want to be able to change the encryption key/passphrase in a regular interval (e.g. 90 days). The application lives on a server in the web.
The existing already encrypted data would need to be reencrypted with the new key, but in order to do so it would of course need the old key.
I expect there is no single answer to this but I would like to get some hints, pointers and buzzwords to investigate in the right direction.
Symmetric, or secret key encryption, uses a single key for both encryption and decryption. Symmetric key encryption is used for encrypting large amounts of data efficiently. 256-bit AES keys are symmetric keys. Asymmetric, or public/private encryption, uses a pair of keys.
AES is an Advanced Encryption Standard algorithm. It is a type of symmetric, block cipher encryption and decryption algorithm. It works with key size 128, 192, and 256 bits. It uses a valid and similar secret key for both encryption and decryption.
First off, it is important to understand the purpose of key rotation. Your use case is to encrypt data at rest. In this case, the purpose of key rotation is to contain data breach in case either a key is leaked or the encrypted data set is leaked and subject to brute force decryption attack. Common practices for key rotation:
Making keys available to system: This is typically accomplished using a key management server. At its core, this server hands out (usually symmetric) keys to requesters based on parameters. The server might choose to either securely archive the generated keys for later retrieval, or ensure they keys are generated based on a fixed function guaranteed to generate the same key given the same set of parameters.
You can choose to write your own server or buy/license one. Licensing this component might be a better choice if you need to meet specific security compliance guideline and need the compliance items checked off. For off the shelf solutions, look at StrongAuth or Porticor as examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With