,

Backup, Archive, and Recovery: What NIST Really Says About Keeping Keys Safe

ASSI Avatar

When people talk about cryptography, most of the time the focus is on algorithms. AES, RSA, ECC, hashes, signatures. Those are important, of course. But after years of working with payment systems, compliance audits, and real production incidents, I learned something very practical. Crypto usually does not fail because the math is broken. It fails because keys are lost, copied, exposed, or cannot be recovered when you actually need them.

This blog is about that less glamorous part. Backup, archive, and recovery of cryptographic keys. I want to explain what NIST really says about this topic, especially based on NIST SP 800-57, and how I personally understand it as an engineer who has to deal with audits, incidents, and operations, not just theory.

Why key backup is even a thing

Let us start with a simple question. Why do we need to back up keys at all.

Keys are not like passwords that users can reset. If a private key is lost, the data encrypted with it may be gone forever. In payment systems, HR systems, payroll, or any regulated environment, that can mean unrecoverable data, legal issues, and very painful conversations with auditors.

NIST is very clear about this. Keys must be available for as long as they are needed to protect or access data. That includes the entire cryptoperiod and sometimes even after, for audit or legal reasons.

At the same time, backing up keys increases risk. A copied key is another attack surface. So the whole topic is about balance. Availability versus confidentiality.

What NIST means by backup, archive, and recovery

NIST makes a distinction that is often missed in casual discussions.

Backup is about operational continuity. You back up keys so that if a system fails, crashes, or is corrupted, you can restore the keys and continue normal operations.

Archive is about long term retention. Archived keys may no longer be used for active cryptographic operations, but they are kept so old data can still be decrypted or signatures can be verified.

Recovery is the process. It is not just restoring files. It includes controls, approvals, and procedures to make sure the right key is restored in the right way, by the right people.

This distinction matters a lot in audits. I have seen systems where everything is called backup, and that usually raises red flags.

Key backup according to NIST

NIST does not say backup all keys blindly. It says keys should be backed up only if loss of the key would result in unacceptable consequences.

For example, ephemeral session keys usually do not need backup. They are short lived by design. But master keys, key encryption keys, database encryption keys, and signing keys usually do.

Another important point. Backed up keys must be protected at least as strongly as the original keys. If your production key is inside an HSM, and your backup is a plain file on a server, that is a serious problem.

In practice, this often means encrypting keys before backup, using a separate key encryption key, and storing backups in a secure and access controlled location.

Separation of duties and access control

One thing NIST emphasizes, but many teams underestimate, is who can access backups.

If a single administrator can generate a key, back it up, restore it, and use it, that is a concentration of power. NIST recommends separation of duties. Ideally, no single person should be able to compromise the entire key lifecycle.

In real systems, this can be implemented with dual control. For example, one person initiates a recovery, another approves it. Or keys are split using secret sharing so multiple parties are required.

This is not just theory. Auditors often ask who can access key backups and how many people are required.

Archiving keys for long term access

Archive is different from backup. Archived keys are usually no longer active. They should not be used to encrypt new data. They exist only to access old data.

NIST suggests that archived keys should be clearly marked and logically separated from active keys. This reduces the risk of accidental reuse.

Another important detail. The security strength of archived keys must still be sufficient. If you encrypted data ten years ago with a key that is now considered weak, you may still need that key to decrypt the data. That creates a risk. Sometimes the correct approach is to re encrypt old data with stronger keys and retire the old ones.

This is something many systems never plan for, and then it becomes a problem years later.

Recovery is not just restore from storage

When people hear recovery, they often think restore a file and done. NIST treats recovery as a controlled process.

Recovery should be logged. It should require authorization. It should be tested. Yes, tested. A backup that was never tested is not a backup. It is hope.

In several audits I was part of, the finding was not that backups did not exist, but that nobody ever tested restoring keys. When a real incident happened, the process was unclear.

NIST encourages documented procedures. Who requests recovery, who approves, how is identity verified, where are logs stored.

Example of a simple key backup approach

Again, this example code is not from my real project. It is only for demonstration.

Imagine a symmetric data encryption key stored in memory, and we want to back it up securely.

First, we encrypt the key using a key encryption key.

C#
public byte[] ProtectKey(byte[] dataKey, byte[] kek)
{
    using var aes = Aes.Create();
    aes.Key = kek;
    aes.GenerateIV();

    using var encryptor = aes.CreateEncryptor();
    var cipherText = encryptor.TransformFinalBlock(dataKey, 0, dataKey.Length);

    return Combine(aes.IV, cipherText);
}

The output can then be stored in a secure backup storage. The important part is not the code itself. The important part is that the data key is never stored in clear form.

In a real system, this would be inside an HSM or a secure service, with strict access controls.

Common mistakes I see in real systems

One common mistake is mixing backup and archive. Old keys are left in the same store as active keys, with no clear labeling. That increases the chance of misuse.

Another mistake is assuming cloud storage equals secure storage. Storing encrypted keys in object storage is fine, but only if access control, logging, and encryption are properly configured.

I also see teams backing up keys but not backing up the metadata. Without metadata, you may not know which key was used for which data, or which algorithm and parameters were used.

NIST repeatedly stresses that key management is not only about keys, but also about associated information.

How long should keys be kept

This depends on legal, regulatory, and business requirements. NIST does not give a single number. It provides guidance.

Keys should be retained as long as the data they protect must remain accessible or verifiable. After that, they should be securely destroyed.

Secure destruction is as important as backup. Keeping keys longer than necessary increases risk.

In regulated industries like payments or payroll, retention periods are often defined by law. Your key management policy should align with that.

Testing and documentation

One of the most practical lessons from NIST is that documentation matters. Not for paperwork sake, but for continuity.

People leave. Systems change. If recovery procedures are not documented, the organization depends on tribal knowledge.

NIST expects organizations to document backup, archive, and recovery procedures, and to review them periodically. Testing recovery is part of that review.

In my experience, even a simple annual recovery drill can reveal issues that would otherwise stay hidden.

Final thoughts

Backup, archive, and recovery of cryptographic keys is not exciting. It does not involve new algorithms or fancy libraries. But it is one of the areas where real world failures happen.

NIST SP 800-57 does not try to be dramatic. It gives practical guidance focused on risk, lifecycle, and responsibility. If you read it carefully, you will notice that it treats key management as an operational discipline, not just a cryptographic one.

If you are building systems that handle sensitive data, do not treat key backup as an afterthought. Design it early. Document it. Test it. And always remember that every copy of a key increases both availability and risk.

That balance is what good key management is really about.