What Is Key Management and How Does It Work?

Cryptographic keys play a vital role in protecting sensitive info, preventing data breaches, and complying with regulations. Unfortunately, a lost or stolen key can lead to costly losses of systems and data, which is why every security-aware company should enforce robust key management protocols.

This article is an introduction to encryption key management. Read on to learn about the basic concepts surrounding encryption, the value of proper key management, and how to keep data safe throughout a key’s lifecycle.

Key management intro

What Is Encryption Key Management?

Encryption key management is a set of practices and rules that ensure the safe use of cryptographic keys. Proper management ensures a key stays safe throughout its lifecycle, from generation and use to storing and deletion.

cryptographic key is a file that contrails a string of letters and numbers that can encrypt and decrypt data when processed by a crypto algorithm. The main goal of key management is to keep these files away from unauthorized users and systems.

Check out our post about 16 encryption key management best practices to properly manage your security.

Losing a key to a malicious party can have grave consequences, so a robust encryption key management strategy must include:

A business can approach key management in three different ways:

The safest approach is to set up a centralized strategy and achieve complete control over how teams store, share, and use private keys.

Consider adopting zero-trust security, a strategy that ensures no user or system has access to private keys by default.

Why is Key Management Important?

Careful management of keys is vital to the effective use of cryptography in your cybersecurity strategy.

A key is similar to a safe combination: no safe can stop the thief if a perpetrator knows how to unlock the vault. Similarly, poor key management can make even the best encryption algorithm worthless. A compromised key allows an attacker to:

Proper key management guarantees high levels of security around encrypted data and ensures:

The use of encryption also helps comply with some regulations, such as HIPAA or PCI.

Consider setting up our Encryption Management Platform, an all-in-one EMP that allows you to centralize encryption management and control all keys from a single pane of glass.

Encryption key management

How Does Key Encryption Work?

Encryption allows us to exchange data while keeping the contents unreadable to everyone except the sender and the recipient. Exchanging encrypted data is a two-step process:

Throughout this process, the information is unreadable to anyone who does not possess the descrambling key. Encryption is fully automatic and the two parties exchanging data do not have to code and decode messages. Key actors and operations in the encryption process are:

You can use encryption to protect data both at rest and in motion:

Read about Kerberos authentication, a verification protocol that relies on a mix of encryption and access tickets to validate user identities.

Encryption Key Types

There are two main types of encryption:

Symmetrical encryption is easier to use and set up. However, relying on the same key for coding and decoding content makes this strategy less secure than asymmetric encryption.

Symmetric Keys

Symmetric cryptography relies on the same key both for data encryption and decryption. As a single key protects the entire operation, the privacy of the key is paramount. Below is a diagram that shows how a symmetric encryption process looks like:

How symmetric encryption works

Here is a step-by-step explanation of how the process on the diagram above works:

  1. A user sends a request to an app and asks to access encrypted data.
  2. The app sends a DEK retrieval request to the client’s KM API.
  3. The client (via a KM API) and KM verify each other’s certificates.
  4. If the credentials are valid, the KM API and the KM form a secure TLS connection.
  5. The KM decrypts the requested DEK with the KEK.
  6. The key manager sends the DEK to the KM API.
  7. The KM API sends the DEK to the app.
  8. The app sends plaintext data to the user.

Companies typically use symmetric encryption to protect data at rest.

Learn the differences between TLS and SSL (Transport Layer Security and Secure Sockets Layer), two standard protocols for encrypting web data.

Asymmetric Keys

Asymmetric encryption relies on a pair of keys for the encryption and decryption of data:

Both keys are unique, exclusive to each other, and created at the same time. The primary use of asymmetric keys is to protect data while it moves across a network connection, whether public or private.

Here is a diagram that shows how asymmetric encryption allows two parties to exchange files safely:

How asymmetric encryption works

Below is a step-by-step explanation of how the process on the diagram above works:

  1. The two parties verify each other’s certificates. Like with symmetric encryption, the recipient does the authenticating first and does so via a CA.
  2. Once the two parties have mutual acceptance, the sender requests the recipient’s public key.
  3. The sender creates a temporary symmetric key (a key valid only for a single session) and encrypts the requested file.
  4. The sender encrypts the symmetric key with the recipient’s public key and sends it alongside the requested file.
  5. The recipient receives the package.
  6. The user decrypts the symmetric key with the private key from its KM and then descrambles the data with the symmetric key. Decryption returns the data to its plaintext state.

Learn about ransomware, a dangerous cyberattack that uses asymmetric keys to encrypt and steal valuable business data.

How to Manage Encryption Keys?

Sound encryption key management requires you to organize the entire lifecycle of each key, roughly divided into the following stages:

Ensuring the safe use of encryption keys without accounting for each stage of a lifecycle is a mistake. Other common errors companies make are:

Below is a closer look at each stage of a key’s lifecycle and what your team should look out for to ensure the safe use of encryption keys.

Encryption key lifecycle

Key Generation

Companies create and store encryption keys on a key management server. Ensure the generator only creates long and complex keys to prevent attackers from using simple techniques to crack the code.

The server typically uses a secure random bit generator and stores the key, along with all its attributes, in a storage database. The essential info is:

A key manager should allow admins to edit the key’s characteristics at any time. Key activation happens either upon creation or at a later date (either automatically or manually).

You also need to define a crypto period for each key. This period is the time during which a key is functional. Two factors impact the duration of a crypto period:

For example, you encrypt a database and plan to add items to it for the next six months. In that case, the OUP sits at six months. If you plan to allow users to access and use the database for two years, that period is the RUP. As the OUP and RUP overlap, the crypto period is two years.

Once you generate a key, ensure the server stores it in an encrypted state. Keys should be available in unencrypted form only within a secure, tamper-protected environment. Also, never store the key in the same database as the encrypted data it protects.

Key Use and Rollover

The key manager allows authorized systems and users to retrieve keys for encryption or decryption processes. The manager should also manage current and past instances of all encryption keys.

For example, if the software generates a new key and deactivates (or rolls) the old one every year, the manager should retain previous versions of the key but dispense only the current instance.

Many companies choose to turn key rotations into an automatic process. This approach limits the room for human error and frees up the team to focus on more impactful tasks. For additional security, consider also logging key usage and providing audit trails.

Ensure the team does not use the same key for different purposes. Each task should rely on a unique key to avoid potential lateral movement between systems if an attacker compromises a single key.

Key Revocation

An admin must be able to use the key manager to revoke a key and prevent its use. This ability is crucial when:

If necessary, reactivating a revoked key can help admins decrypt data previously encrypted with it, like old backups.

Backup (or Escrow)

All keys require a backup before deactivation, so the manager should keep a mirror archive of all deactivated keys. Recoveries after the crypto period allow admins to reconstruct keys if there is a need for reactivation.

The inability to recover a key means any data that remains decrypted with the key in question is effectively lost.

Key Deletion

An admin should be able to delete the key from the storage database. The deletion option is vital if:

Removing a key can either delete all or some of its instances. Admins typically ensure the recovery of the key is impossible without a backup image.

If someone compromises encrypted data, the ability to delete the key quickly can keep data safe and unrecoverable. When the security team eliminates the threat, an admin can use the image to recreate the key and descramble data.

Read about the cybersecurity best practices that can add additional layers of safety to your systems and encrypted data.

There Is No Safe Cryptography Without Robust Key Management

Effective key management is a crucial part of your data protection strategy. Set up a system that keeps keys safe at all stages of the lifecycle and ensures the protocols offer the flexibility necessary for your teams’ dynamic work environments.