How to move database and file encryption keys to post-quantum protection

A staged approach to moving key hierarchies, client-side encryption, rewrapping and database connections to post-quantum key protection, based on the sources listed on this page.

On this page

How do you move database and file encryption keys to post-quantum protection?

Consider a data owner who runs a database or an encrypted file store and keeps a key hierarchy in which a data encryption key protects each table, volume or file, and a key encryption key wraps that data key. Moving these keys to post-quantum protection means replacing the public-key step that wraps the data encryption key with a key encapsulation mechanism (KEM) such as ML-KEM, typically in a hybrid with X25519, while the symmetric data encryption itself stays the same. The change is about key wrapping, not the stored data cipher. AES with 128, 192 or 256 bit keys remains the algorithm NIST's post-quantum FAQ says current applications can continue to use, so the work centers on how the key that unlocks the data is protected, not on re-encrypting the data.

Three groups carry this work: database administrators who configure key management and the wrapping of table or tablespace keys, owners of file encryption tools who maintain the format and recipient handling, and application teams that build their own key hierarchies on top of a cloud key service or a library. Each group should first confirm which step in its chain is a public-key operation. Cloud key services differ here. AWS KMS lets a sender encapsulate with only the public key, so the sender can run that step outside KMS, while Google Cloud KMS can decapsulate with a KEM key but cannot encapsulate, which means a client-side step with an external SDK is needed to create the wrapped secret. Confirm the exact operations your key service supports before planning the rewrap.

Where do database and file encryption keys use public-key algorithms today?

This table lists the places where a data encryption key is wrapped or protected, and marks which of them post-quantum work touches. Symmetric data encryption with AES stays as it is, so the public-key or KEM step that protects each key is the part to review. Use it to find which layers in your stack need a post-quantum plan.

LocationPublic-key stepPost-quantum work touches it
Cloud KMS key wrappingKEM encapsulation and decapsulation against a managed KMS keyYes, through KMS KEM keys and client-side encapsulation
Recipient-based file encryption (CMS)KEMRecipientInfo wraps the content-encryption key for each recipientYes, RFC 9936 defines ML-KEM use here
OpenPGP file encryptionRecipient public keys encrypt the session keyYes, RFC 9980 defines ML-KEM only in composite form
age file encryptionRecipient keys protect the file keyYes, through optional post-quantum recipients in age v1.3.0
TLS between database clients and serversKey exchange during the handshakeYes, through group settings such as tls_kex and ssl_groups
Data encryption with AESNone, the data is encrypted with a symmetric keyNo, AES key sizes are not replaced by this work
Stored key material in the databaseDepends on how the database protects its own keysConfirm with your database vendor documentation

What have NIST and the IETF published for key encapsulation in data protection?

Key encapsulation is the step where a sender uses a recipient's public key to agree on a secret that wraps a data-encryption key, and the standards for that step now exist in several forms. FIPS 203 defines ML-KEM, the post-quantum key-encapsulation mechanism that the other documents build on. NIST SP 800-227, Recommendations for Key-Encapsulation Mechanisms, was finalized on 18 September 2025 and describes how a KEM lets two parties agree on a shared secret over an insecure channel, which then supports symmetric encryption and authentication. Teams that manage database and file encryption keys should read FIPS 203 for the algorithm and SP 800-227 for guidance on using a KEM correctly in a key hierarchy.

For transition planning, NIST IR 8547, Transition to Post-Quantum Cryptography Standards, is listed on NIST's site as Final, with a history entry dated 10/27/26 after a November 2024 draft. Confirm the current status on the NIST page before citing it in a plan. Use it to set the sequence and deadlines for replacing public-key wrapping in your key hierarchy. The sources listed on this page do not give a specific migration schedule, so ask your compliance team which dates apply to your regulator.

The IETF has published two relevant RFCs, and their scope differs. RFC 9936 lets ML-KEM wrap a content-encryption key for a recipient through the CMS KEMRecipientInfo structure, with the KEM output passed through HKDF with SHA-256 and a zero-length salt to derive the key-encryption key. RFC 9936 does not cover hybrid schemes. RFC 9980, Post-Quantum Cryptography in OpenPGP, was published in June 2026 as a Proposed Standard on the Standards Track and defines ML-KEM only as composites with X25519 or X448. If your file encryption uses CMS or OpenPGP, check which RFC matches your format and whether your library implements the hybrid form before relying on it.

Which KMS, database and encryption tools have shipped post-quantum key support?

Cloud key management services are where many organizations hold the key encryption keys that protect their data, so their post-quantum support matters for key hierarchies. AWS KMS offers ENCAPSULATE_DECAPSULATE keys. The key owner creates the key and shares the public key, a sender calls Encapsulate, and the owner calls Decapsulate to recover the same 32-byte shared secret. Google Cloud KMS offers KEM keys, but it can only decapsulate, so the encapsulation step has to run client-side with an external SDK and the public key.

  • AWS KMS shared secret: The output is a 32-byte shared secret that the sender can use to derive a wrapping key.
  • Outside encapsulation on AWS: Encapsulation needs only the public key, so a sender can run it with its own cryptographic library. AWS strongly recommends verifying the public key came from the expected party.
  • Google Cloud KEM_XWING: This is a hybrid of ML-KEM-768 and X25519, with a 1216-byte public key and a 1120-byte ciphertext.
  • Google Cloud ML_KEM_768: This option has a 1184-byte public key and an 1088-byte ciphertext.
  • Client-side step on Google Cloud: The wrapped secret must be created with an external SDK before the KMS key can decapsulate it.

Confirm which KMS key types, regions and SDK versions your account exposes before you design around them, since availability can differ from the documentation you read.

What changes in key sizes, client steps and compatibility when keys are protected with ML-KEM?

Moving key protection to ML-KEM changes the size of the values you store and transmit, adds a client-side step in some key management services, and affects how database connections negotiate. Each of the cards below is a check to run before you change a key hierarchy or a connection setting.

Larger public keys and ciphertexts

ML-KEM values are bigger than the elliptic curve values many systems store today. Google Cloud KMS lists KEM_XWING, a hybrid of ML-KEM-768 and X25519, with a 1216-byte public key and 1120-byte ciphertext, against 1184 and 1088 bytes for ML_KEM_768 alone. Check that any field, column or message format holding a wrapped key or a public key can accept the larger values, and that size limits in your storage layer and API gateways allow them.

Google Cloud KMS KEM docs

Client-side encapsulation step

Some key services can decapsulate but cannot encapsulate. Google Cloud KMS works this way, so a client must encapsulate with an external SDK using the KMS public key to create the wrapped secret. AWS KMS allows encapsulation with only the public key, so a sender can run it in its own cryptographic library. In both cases, verify that the public key came from the expected party before you encapsulate to it.

AWS KMS post-quantum keys

Whole assignment rejected on one bad element

In MySQL 26.7, a tls_kex assignment lists several groups, such as X25519MLKEM768:secp384r1MLKEM1024:secp256r1. The manual says that if any element is invalid, the whole assignment is rejected, so a single typo leaves the previous setting in place. Test the value with a SET GLOBAL statement in a non-production server, and confirm the setting after restart or reload.

MySQL 26.7 manual 8.3.6

PostgreSQL groups need every client

PostgreSQL 19 says ssl_groups must be supported by all connecting clients, and accepts a colon-separated list. Before you add a post-quantum group to the server, inventory every application, driver and admin tool that connects, because one client without support can fail to connect. The setting can be changed only in postgresql.conf or on the server command line, so plan a restart window.

PostgreSQL 19 connection settings

Go workaround for buggy TLS servers

Go 1.24 notes that setting tlsmlkem=0 can help with buggy TLS servers that do not handle large records correctly and time out during the handshake. The larger post-quantum handshake can expose these servers. Use the setting only as a temporary workaround for a specific server you have identified as faulty, and plan to fix or replace that server, because it disables the post-quantum key exchange for that Go client.

Go 1.24 release notes

PQC-only enforcement and TLS 1.2

In MySQL 26.7, force_pqc=ON allows only PQC group names when tls_kex is set, and it is rejected if the TLS version configuration permits TLS 1.2 only. Check which TLS versions each client and server negotiates before you turn enforcement on, because a fleet that still uses TLS 1.2 clients will fail to connect. force_pqc defaults to OFF, which allows classical fallback.

MySQL 26.7 manual 8.3.6

How does a staged KMS exchange move the data key to a post-quantum wrap?

A staged KMS exchange wraps a data key under a post-quantum key-encapsulation mechanism (KEM) in steps that split the work between a key owner and a sender. According to AWS KMS documentation, the owner first creates a KMS key with the ENCAPSULATE_DECAPSULATE usage, then shares only its public key with the sender. The sender calls Encapsulate using that public key, which produces a ciphertext and a 32-byte shared secret. The sender sends the ciphertext to the owner, and the owner calls Decapsulate with its private key material held inside KMS to recover the same 32-byte secret. The sender never sees the private key, and the owner never needs to share it. Use the secret to derive or encrypt the data key, and record which key ID and public key version each wrapped copy depends on.

The sender does not have to use KMS to encapsulate. AWS KMS states that encapsulation needs only the public key, so a sender can run Encapsulate with its own cryptographic library outside KMS. Google Cloud KMS works differently: its KEM keys can decapsulate but cannot encapsulate, so the client must perform the encapsulation step with an external SDK and the public key before sending the ciphertext to KMS. Confirm which of the two patterns your provider supports before you build the client, and check the public key sizes in the provider documentation, since Google Cloud KMS lists KEM_XWING at 1216 bytes against 1184 bytes for ML_KEM_768.

The step that matters most for security is verifying where the public key came from. AWS KMS strongly recommends confirming that the public key was supplied by the expected party before the sender encapsulates to it. If an attacker substitutes a public key, the sender wraps the data key to a key the attacker controls. Build this check into the process: fetch the public key through a channel the owner controls, compare it against a value the owner published or signed, and record the check in the change log. Treat any key rotation the same way, so that each new public key is verified before use.

What steps move your key hierarchy to post-quantum protection in order?

The sequence inventories where data keys are wrapped and database connections are negotiated, confirms library support, validates a KEM in a non-production environment, plans rewrapping, and then enforces PQC settings only after every client is tested. The result is a key hierarchy and set of database connections that you can show were changed in a controlled, documented way.

  1. Inventory key wrapping and database connections

    The data or security owner lists every place a data encryption key is wrapped, every key management service that holds a wrapping key, and every database TLS connection that negotiates a key exchange. Record the owning application, the wrapping method, and the client or driver used at each point. Treat this list as the input to every later step. The step is complete when each wrapping point and each database connection has a named owner and a record in the inventory.

  2. Check library and driver KEM support

    Engineers check, for each encryption library and database driver in the inventory, whether it supports a key encapsulation mechanism (KEM) and which algorithms it offers. Record the exact library or driver version, because support often depends on the version. Use the vendor's documentation as the source and note where support is missing. The step is complete when every component in the inventory has a recorded yes or no on KEM support, with the version tested.

  3. Test a KEM key in non-production

    Engineers create a KEM key in a non-production environment and test the full path: encapsulation by a sender, decapsulation by the key owner, and confirmation that both sides recover the same shared secret. Confirm where the public key came from and verify it with the expected party before use, as AWS KMS recommends for encapsulation. The step is complete when the test returns the same shared secret on both sides and the public key source is documented.

  4. Plan rewrapping and client-side encapsulation

    The team plans how existing data keys will be rewrapped under the new KEM and identifies where encapsulation must happen outside the key service. Google Cloud KMS can decapsulate with a KEM key but cannot encapsulate, so a client-side step using an external library and the public key is required there. Document the rewrap sequence, the order of systems to change, and the rollback path. The step is complete when each rewrap is listed with its owner, input, output and rollback.

  5. Configure database connection key exchange

    Database administrators set the key exchange groups on each database connection, using the settings the database documents for this purpose, such as tls_kex in MySQL or ssl_groups in PostgreSQL. Apply the change in a staging environment first, and confirm each group name is valid, since an invalid element can reject the whole assignment in MySQL. The step is complete when the staging database starts and reports the configured groups.

  6. Test all clients before enforcing PQC-only

    Before any setting that forbids classical fallback is turned on, every client that connects to the database is tested against the new groups. In PostgreSQL, ssl_groups must be supported by all connecting clients. In MySQL, a force-PQC setting allows only PQC group names, so enable it only after the test passes. Test each driver version, and where a Go client connects to a server that times out during the handshake, check the documented workaround before deciding. The step is complete when every client connects successfully and the enforcement setting is turned on only after that result.

  7. Record the change and versions used

    The team records each changed key wrapping point and database connection, with the library, driver, database and key service versions in use, the settings applied, and the date of each change. Keep the record with the inventory so the next review can see what changed. Confirm that the versions recorded are the versions tested, since compatibility can differ between versions. The step is complete when the change record is stored with the inventory and each entry names its tested versions.

Where does the KEM step sit in the data key flow?

The flow starts with the data owner creating an ENCAPSULATE_DECAPSULATE KEM key in the key management service and sharing its public key. A sender then calls encapsulation, either inside the service or with an external library that needs only the public key, which produces a shared secret and a ciphertext. That shared secret derives the key-encryption key that wraps the data encryption key, and the owner decapsulates the ciphertext to recover the same secret and unwrap the key. The AES data encryption itself is unchanged. Check that the public key came from the expected party, and confirm which key sizes and hybrid variants your service supports.

The KEM step produces the key that wraps the data encryption key, while AES encrypts the data itself.

Which risks in moving keys to post-quantum protection should teams watch for?

Moving key wrapping to post-quantum protection adds new failure points in key exchange, configuration and stored data. Each risk below has a visible symptom and a concrete check that teams can run before and during the change.

Unverified public key source

A sender that encapsulates a secret needs only the recipient's public key, so anyone who can substitute that key can receive the wrapped secret. AWS KMS strongly recommends verifying that the public key came from the expected party before use. Check the key's provenance through a trusted channel and compare its fingerprint against the value the owner published before any client encapsulates to it.

AWS KMS PQ keys

Invalid TLS key exchange element

In MySQL 26.7, an invalid element in the tls_kex list rejects the whole assignment, so one typo can leave the prior setting in place without an obvious error. Review the value after every change with SELECT @@GLOBAL.tls_kex; and confirm that each group name matches the list in the manual before rolling the change out to production clients.

MySQL PQ TLS manual

Classical fallback when force_pqc is off

In MySQL 26.7, force_pqc defaults to OFF, which permits a classical fallback, so a connection can complete without any post-quantum group. Set force_pqc to ON only with a nonempty tls_kex, and confirm the setting with SELECT @@GLOBAL.force_pqc;. Note that ON is rejected when the TLS configuration permits TLS 1.2 only, so check the TLS version settings first.

MySQL PQ TLS manual

Handshake timeouts from buggy TLS servers

The Go 1.24 notes say that some TLS servers do not handle large records correctly and time out during the handshake. Post-quantum key exchange sends larger handshake messages, so these servers can fail where classical connections succeeded. Test the handshake against each server in your path, and if a server times out, the Go notes describe tlsmlkem=0 as one way to disable the post-quantum group for that client while the server is fixed.

Go 1.24 release notes

Stored keys unreadable by old clients

Wrapped keys created with a post-quantum scheme can only be unwrapped by a recipient that supports the same scheme, so clients that have not been upgraded may fail to decrypt data that was stored under the new wrapping. Before rewrapping any stored keys, inventory every client and service that reads them, confirm each one supports the chosen scheme, and keep a tested path to read data during the transition.

RFC 9936 text

What is not yet settled for post-quantum key protection in data systems?

The sources leave several points open for teams moving database and file encryption keys to post-quantum protection. RFC 9936, which lets ML-KEM wrap a content-encryption key for a recipient through CMS KEMRecipientInfo, does not cover hybrid schemes, so a CMS-based design that needs a hybrid construction has no RFC to point to. RFC 9980, which covers post-quantum cryptography in OpenPGP, was published in June 2026 as a Proposed Standard on the IETF Standards Track, and it defines ML-KEM only as composites with X25519 or X448. Before you commit a key hierarchy to either format, confirm with the relevant working group or the document's current status whether the design you plan will still match the final text.

The sources also do not say whether every database and file tool has committed to hybrid or pure ML-KEM. Support differs by product and version. MySQL 26.7 exposes a tls_kex setting that accepts PQC group names, and PostgreSQL 19 exposes ssl_groups, but the sources do not establish what each vendor plans for the rest of its line. Confirm, for each database engine, file encryption tool and key management service you run, which key exchange and KEM options it supports, whether it offers a hybrid, a pure ML-KEM or both, and whether it accepts a fallback to classical key exchange. Record the answers in the same inventory you use for the rewrapping plan, because they determine which key hierarchies you can move in one step and which need a staged approach.

No deadline appears in the cited sources for when these key hierarchies must move. NIST IR 8547, Transition to Post-Quantum Cryptography Standards, is listed on NIST's site as Final, with a history entry dated 10/27/26 after a November 2024 draft. Check that document for the transition timeline that applies to your environment, and do not treat the sources in this section as setting a date. For each product in your stack, read the vendor documentation on its PQC support, its default behavior and its support window, because the timing of a product's own support may differ from the NIST timeline and will set the earliest date your migration can actually finish.

What do teams ask about moving database and file encryption keys to post-quantum protection?

Does moving keys to post-quantum protection mean replacing AES?

No. Moving key protection to post-quantum algorithms changes how data encryption keys are wrapped or exchanged, not the symmetric cipher that encrypts the data. NIST's post-quantum FAQ says current applications can continue to use AES with key sizes 128, 192, or 256 bits. The work is concentrated in the public-key layer: the step that protects or transports the key that encrypts your records or files. Your AES-encrypted data does not need to be decrypted and re-encrypted with a new cipher because of this change, although the keys that protect it may need to be rewrapped.

Are our applications affected by post-quantum key protection?

They are affected if they perform key wrapping, key exchange or encrypted connections to a database or key service. Check three places: how your application obtains data encryption keys from a KMS or library, whether client-side encryption calls a public-key operation to wrap those keys, and which TLS settings your database connections negotiate. Applications that only call AES encrypt and decrypt with locally held symmetric keys may not change at all. Ask your platform and application owners to list every point where a public key is used, since that inventory defines the work.

Should we move database and file key protection in-house or get outside help?

The answer depends on how many services hold key material, how many KMS or database products you run, and whether your team has staffed cryptographic changes before. An in-house team usually owns the inventory and the decision on which algorithms to use. Outside help is most useful for fixed-scope work such as an audit of key hierarchies, client-side encryption updates across several services, or staged rewrapping with rollback. Whichever route you take, agree the deliverables, test environments and rollback steps in writing before work starts. DeployOpen plans and implements these changes inside the client's own infrastructure on a fixed scope, and a quote follows from that written scope.

What should we ask a KMS or database vendor about post-quantum keys?

Ask which operations the service performs and which it does not. For example, AWS KMS describes an ENCAPSULATE_DECAPSULATE key where the sender can encapsulate with only the public key, while Google Cloud KMS can decapsulate but cannot encapsulate, so a client-side step with an external SDK is needed. Ask which algorithm and hybrid combinations are offered, the public key and ciphertext sizes, and whether the sender can verify the public key came from the expected party. For databases, ask which TLS group names are supported, whether classical fallback can be turned off, and which client drivers must be upgraded. Get the answers in writing with version numbers.

Should we use hybrid or pure ML-KEM for key exchange?

The sources show both options exist, and they differ by product. Google Cloud KMS offers KEM_XWING, a hybrid of ML-KEM-768 and X25519, alongside ML_KEM_768 on its own, with a 1216-byte public key and 1120-byte ciphertext for the hybrid, against 1184 and 1088 bytes for ML-KEM-768 alone. RFC 9936 for CMS does not cover hybrid schemes, while RFC 9980 for OpenPGP defines ML-KEM only as a composite with X25519 or X448. Choose based on what your clients, libraries and compliance requirements accept, and test each combination against your real peers. Confirm compatibility for the versions you run rather than assuming two named options interoperate.

Do we have to re-encrypt stored data when we change key protection?

Not necessarily. Changing how data encryption keys are wrapped usually means rewrapping those keys, which can be done without touching the encrypted records themselves. Rewrapping means decrypting each stored data key with the old protection and encrypting it again under the new one, so the bulk data stays in place. Plan for the stored wrapped keys, the rollback path, and the window when both old and new wrapping may need to be readable. Confirm with your KMS or database vendor whether rewrapping is supported in place, and test it on a copy before running it on production data.

How DeployOpen works on this

DeployOpen starts by mapping which keys protect which data, who holds each key, and where key exchange or wrapping uses public-key cryptography. The written scope then defines the rewrapping, client-side encryption and database connection changes, and the test and handover steps that come with them.

How we scope

  • Inventory each key hierarchy, the systems that hold each key and where wrapping or key exchange uses public-key cryptography.
  • Identify which KMS keys, client-side encryption libraries and database connections need a post-quantum option and which only rely on AES.
  • Agree the scope in writing before work starts, covering systems, environments, deliverables and what remains out of scope.

How we build

  • Configure KMS encapsulation keys and the sender-side steps, verifying the public key came from the expected party before use.
  • Rewrap existing data keys in stages, testing each stage on copies before touching production data or the keys that unlock it.
  • Set database TLS key exchange groups and client library versions, testing handshakes for classical fallback and timeouts.

How we hand over

  • Document each key path, the algorithms and library versions used, and the configuration values set on each system.
  • Provide rollback steps and a record of which keys and connections were moved, so the client can audit the change.
  • Walk through the handover with the client's security and data owners so they can run, review and extend the setup themselves.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after the migration is handed over.
  • Retest key paths and database connections after library, driver or database upgrades that may change supported groups.
  • Confirm compatibility for the exact versions you run, since the published sources do not establish that all versions interoperate.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.