Encryption keys are not infinite, and the longer a key expires, the more likely it is to be breached. When a company analyzes an attacking threat, it has no idea when or where the attack will take or how long the attacker will have access to its keys.
You can reduce your exposure to this type of attacker by rotating your keys. Key rotation is the process of retiring an encryption key and replacing it with a new encryption key.
See Also: What Are the PCI DSS Encryption Requirements
By rotating keys regularly, you may stay in compliance with industry standards and cryptographic best practices. The amount of content encrypted with a single key is reduced via key rotation.
If a key is rotated every day, the attacker can decrypt only that day’s information. Thus, while key rotation cannot protect against compromise, it reduces the costs associated with it.
An integral part of the key rotation is establishing an appropriate and well-thought-out key lifecycle, that is, when a key is active or authorized for use. A key’s lifecycle must be the strength it needs to withstand attacks, and a key management system must ensure that it moves safely through every phase of its lifecycle, right up to deactivation.
See Also: Encryption Key Management Essentials
For most elements of the cryptographic key lifecycle, the National Institute of Standards and Technology (NIST) establishes tight requirements. It has also set specific guidelines for determining the crypto period for each key.
The PCI DSS (Payment Card Industry Data Security Standard) mandates that data encryption keys be replaced or rotated regularly.
Let’s look at why key rotation is included in this PCI DSS before we go into the details.
Why Should You Rotate Encryption Keys?
Of course, you need to rotate your encryption keys for PCI compliance reasons, but if you want to know why here are the benefits of key rotations:
- Key rotation limits the amount of information available for cryptanalysis, protected by a particular key.
- Key rotation limits exposure when malicious or unknowingly compromised a particular key.
- Key rotation prevents inevitable cryptographic catastrophes.
- Protects against current or future algorithmic vulnerability that shortens key life.
How Often Should You Rotate Your Encryption Keys?
For static data, key rotations should be done every few months. If you want to do this more often,
- You must have a large amount of data.
- You need to experience staff turnover.
- You must have high-value data.
- You must use a shared environment.
- You need to have motivated, skilled enemies who can take advantage of the protected information.
Organizations often fail to perform key rotation because the key rotation process is cumbersome. What makes key rotation difficult is that the keys to be rotated are ciphertext-generating keys.
These keys are called Data Encryption Keys or DEKs. DEKs are encrypted with a “master key,” often referred to as Key Encryption Keys or KEKs. Some organizations rotate the KEK, request that the keys are rotated, and call it a day.
See Also: PCI DSS Compliant Key Management Lifecycles
In reality, this is a burden without security benefits because the underlying DEKs remain the same and continue to process additional data.
How Are Encryption Keys Rotated?
First, you need to realize that actual data encryption keys (DEKs) need to be rotated. Next, you need to design a system.
- Securely store and distribute multiple Data Encryption Keys (DEK) and associated Key Encryption Keys (KEK).
- Authorize decryption via legacy DEKs.
- Issue a new cryptographically secure DEK.
- Have newer data only use this new key authorized for the current time range.
- Monitor the dynamic mapping between each piece of data; this is the data encryption key, their key encryption keys, and master encryption keys.
- Optionally, decrypt all old data and completely re-encrypt it with the latest encryption key.
- Every part of this dynamic system should have authorization checks and audits in place.
What Are the PCI DSS Key Rotation Requirements?
Encryption keys have a lifetime. Cryptographic key updates for keys that approach the end of their cryptologic period shall be defined by the appropriate application vendor or key owner and based on industry best practices and guidelines, according to PCI DSS Requirement 3.6.4.
When it comes to key management, crypto periods are a hot topic. A crypto period is not a period like a month, week, or year. Instead, an encryption period represents the number of transactions for which a key is valid.
Key length, key strength, algorithms, and exposure are some of the multiple factors that define a crypto period. The result of these factors is the crypto period. When a key reaches the end of its useful life, it becomes weak and susceptible.
It is not the PCI QSA’s job to define your crypto period. If you say your defined crypto period is one year, a PCI QSA auditor will want to learn more. Still, it is up to the auditor to determine whether your organization knows the reason behind your defined crypto period.
You must explain why your crypto period is only one year long. Let’s say your key is suitable for a thousand transactions, and your company processes a thousand transactions per year. This is why your crypto period is one year, implying that you conduct 1,000 transactions per year.
See Also: HSMs for PCI DSS Compliance
Let’s say your key is good for one million transactions, but you process two million every year. This means that your crypto period is six months, so the key needs to be rotated twice a year. PCI auditors not only investigate what a defined crypto period is; They want to hear why.
As you develop and produce keys, you need to know that the encryption keys you use have a specific lifetime. Looking specifically at the requirements in PCI DSS 3.6, it states that you must rotate keys at the end of defined crypto periods.
So, suppose you are using encryption in your PCI environment. In that case, your auditor will ask you what your defined crypto period is and details and will try to determine if you have exercised due diligence while using your key.
A crypto period does not necessarily define the length of the period. A crypto period can be a month, a week, a year, three years, or six years, but a crypto period is typically a series of transactions for which a key is good.
Multiple variables define what a crypto period is. But effectively, it is necessary to base key strength, key length, encryption algorithm you are using, key exposure.
In short, after all these factors are taken and calculated, the output will be a series of transactions, not a month or a year. Whatever encryption algorithm key you have, the transaction output may be suitable for a thousand transactions, good for one transaction, or appropriate for a million transactions.
Now that we have the number of transactions where the key worked, we need to look at how many transactions you have made in a year. If your key is suitable for a million transactions and you do a million transactions per year, you can rotate that key every year because the crypto period is one year.
But let’s say the crypto period defined is one million transactions, but you are doing two million transactions per year. In this case, after the millionth operation, this key is weakened, and at this point, you should rotate the key.
In such a scenario, the crypto period is six months rather than a year. Therefore, auditors will consider your definition of a crypto period and what you did to define that period.
Once the crypto period is defined, your PCI auditor will ask you for proof that the key has been rotated. This evidence could be a change record or records showing you rotate the encryption key.