Learn · Practitioner

Database Encryption & PQC

6 sections

Migrate database encryption to quantum-safe algorithms: TDE re-keying, BYOK/HYOK key ownership, queryable encryption compatibility, and fleet readiness assessment.

For you, every role: what this means
Developer / Engineer
Map the encryption layers of a database in Step 1, step through the TDE migration from AES-256 to an ML-KEM-wrapped key hierarchy, and check queryable encryption schemes against PQC compatibility in Step 4.
Security Architect
The BYOK Architecture Designer in Step 3 places key ownership with an external PQC KMS; the readiness assessment in Step 5 covers the fleet.
Researcher / Academic
Step 4's Queryable Encryption Lab lays out the schemes and their PQC compatibility matrix, the part of database encryption where the research is least settled.
IT Ops / DevOps
The TDE re-key walkthrough and Step 5's guided fleet readiness checklist are the operational path; a re-key done wrong re-encrypts the wrong data, and the walkthrough shows the order.
Curious Explorer
Databases keep their encryption keys for years; this module shows, layer by layer, what has to change so that stored data stays private after quantum computers arrive.

Database encryption is not a single switch — it is a layered architecture. Each layer addresses a different threat model. From outermost to innermost:

1. Transparent Data Encryption (TDE) — Innermost

encrypts database files on disk (data pages, log files, backups). Supported ciphers vary by database engine and configuration; AES-256 is one common option. TDE protects against physical theft of storage media or backup exfiltration — but provides no protection against a privileged DBA who has direct database access. The database engine decrypts data transparently on read.

Threat covered: stolen backup tapes, cloud storage breach, decommissioned disks
Threat NOT covered: DBA with SELECT privilege, memory scraping, SQL injection
2. Column-Level Encryption (CLE) — Middle Layer

encrypts specific columns (PAN, SSN, date-of-birth) using per-column keys. In (SQL Server), the Column Master Key (CMK) lives in Azure Key Vault or an HSM — the database engine never sees the plaintext CMK, only the Column Encryption Key (CEK) wrapped by it. A DBA querying the column sees only ciphertext.

3. Field-Level Encryption (FLE) — Application-Controlled

FLE encrypts document fields client-side before data reaches the database wire. The database stores encrypted fields and key-vault records; data keys are wrapped by a customer master key managed through a local key or supported KMS provider. The database server does not receive the field plaintext, while query capabilities depend on the selected FLE or Queryable Encryption mode.

4. Queryable Encryption — Structured Encryption

(MongoDB FLE 2.0, SQL Server with secure enclaves) allows specific query types (equality, range) to execute on encrypted data without full decryption. MongoDB uses HMAC-SHA-256 equality tokens and structured encryption over fully randomized ciphertext for range queries. SQL Server uses secure enclaves (VBS or SGX) to execute queries on plaintext inside a trusted execution environment.

PQC Impact on Encryption Layers

Shor's algorithm does not break AES. Grover's algorithm can reduce the effective key-search strength, so AES-256 retains a 128-bit margin; the exact data cipher still depends on the database engine and configuration.

Key ownership architecture determines who can access plaintext key material — and therefore who can decrypt your database. Three models exist, differing in who holds the key and who can revoke it:

Provider-Managed (Weakest)

The provider manages the keys for this example. Customers still need to confirm the service's PQC support, migration controls, import options and release schedule; they can also assess a different key-custody design or service.

(Bring Your Own Key)

In this example, the customer generates key material in an on-prem HSM and imports it into a cloud KMS. ML-KEM import wrapping is a design target, not a generally available cloud-KMS capability; the service must support the required import format. AWS KMS offers ML-KEM key specifications, but its import wrapping keys are RSA (SM2 in the China Regions); check each service's documentation before planning this flow.

(Hold Your Own Key)

Customer key never leaves on-prem infrastructure. Cloud receives the plaintext after the on-premises unwrap. HYOK with a Thales Luna HSM (firmware 7.9 or later) or a Utimaco u.trust Se-Series HSM with the Quantum Protect package can host ML-KEM keys after a firmware or package upgrade; confirm the parameter set (ML-KEM-1024), PKCS#11 v3.2 support and FIPS 140-3 validation status with the vendor.

PQC BYOK Migration Path
Cloud KMS provides ML-KEM public key (ek); Customer generates 256-bit CMK on-prem
↓
Run ML-KEM.Encaps(ek) → shared_secret + KEM ciphertext
↓
Wrap 256-bit CMK with shared_secret (AES-KWP); Upload KEM ciphertext + wrapped CMK
↓
Cloud KMS: decapsulates to recover shared_secret, unwraps CMK, uses it for DEKs

HYOK with on-prem custody is one design for keeping key custody under your own control; it is not named as a requirement. DORA's ICT risk-management technical standard (Commission Delegated Regulation (EU) 2024/1774) requires financial entities to have a policy on encryption and cryptographic controls that covers “the cryptographic key management referred to in Article 7, laying down rules on the correct use, protection, and lifecycle of cryptographic keys”, and Article 7 requires controls to protect keys through their whole lifecycle. How long RSA-2048 wrapped CMKs stay exposed to harvest-now-decrypt-later depends on how long the wrapped data must stay confidential; this module gives no figure. A database whose HYOK HSM supports ML-KEM-1024 can move its key wrapping to ML-KEM once that HSM is upgraded.

For data at rest, a sufficiently strong symmetric cipher such as AES-256 is not broken by Shor's algorithm. A PQC migration must also review asymmetric key wrapping and key management links. Distinguish changing a key protector from changing a database data encryption key: the Oracle and SQL Server commands below can rewrite or re-encrypt data, while MongoDB's field-key rewrap operation changes the wrapping key. Online-capable commands do not guarantee zero workload impact or availability for every engine and version; test the exact operation and recovery plan.

Online-Capable Key Rotation Examples (Different Scopes)
  • • Oracle: ALTER TABLESPACE ... ENCRYPTION ONLINE REKEY
  • • SQL Server: ALTER DATABASE ENCRYPTION KEY REGENERATE
  • • MongoDB Enterprise KMIP master-key rotation: security.kmip.rotateMasterKey re-encrypts the internal keystore; database keys stay unchanged. For client-side encrypted fields, KeyVault.rewrapManyDataKey re-wraps data keys under a new customer master key.
  • • Oracle's ONLINE conversion builds replacement datafiles and needs free space; SQL Server's encryption operations have workload and operation restrictions. Validate availability on the engine/version you run.
  • • Sample assumption: CPU overhead of 5–15% during the re-encryption window
Offline Migration
  • • PostgreSQL pg_tde: converting existing tables rewrites them under an exclusive lock
  • • MySQL InnoDB: requires ALTER TABLE for each encrypted table
  • • Sample assumption: a maintenance window of 2–8 hours for a 1TB database
  • • Rollback by restoring old backup if failure occurs
Key Size Overhead: RSA vs ML-KEM
AlgorithmEncoded Key / ShareCiphertext / OutputUse Case
RSA-2048256 B modulus256 BExample RSA-2048 encoding
ECDH P-25665 B—65 B uncompressed SEC1 point
ML-KEM-7681,184 B1,088 BNIST default parameter set
ML-KEM-10241,568 B1,568 BCNSA 2.0 profile

Sizes are algorithm encodings, not complete serialized keys or certificates; ECDH produces a shared secret, not a ciphertext. Under this module's proposed per-DEK ML-KEM wrapping design, each stored ML-KEM-1024 ciphertext is 1,568 B; total metadata growth depends on the number of wrapped keys and the format. This is not a current database-engine command or a measured storage estimate.

Data-file ciphers and modes depend on the engine and its configuration. A protector change does not inherently change the data cipher, but performance and metadata effects depend on the implementation; measure them with the target database and workload.

Standard encryption prevents queries on ciphertext — you cannot WHERE encrypted_ssn = :value if the field is randomly encrypted. Queryable encryption solves this by using structured encryption schemes that preserve query semantics while hiding plaintext values from the server.

MongoDB FLE 2.0: Queryable Encryption Indexes

For equality queries, FLE 2.0 stores an HMAC-SHA-256 token of the plaintext alongside the ciphertext. The server compares tokens without seeing plaintext. For range queries, a structured encryption scheme over fully randomized ciphertext is used for the index — the server matches encrypted index tokens without learning plaintext order.

PQC Impact: HMAC-SHA-256 is quantum-safe. Range indexes use symmetric primitives (quantum-safe). DEK wrapping upgrade path: RSA-OAEP → ML-KEM-1024 (this module's projection, not a MongoDB statement).
SQL Server with Enclaves

Secure enclaves (VBS/SGX) execute a defined set of operations on plaintext decrypted inside the enclave: comparisons, range queries, LIKE pattern matching, DISTINCT, joins and, in SQL Server 2022 and Azure SQL, ORDER BY and GROUP BY on randomized-encryption columns. The database engine never sees plaintext outside the enclave boundary.

PQC Challenge for

In this module's reading, equality queries are straightforward to make PQC-safe: HMAC-SHA-256 tokens are quantum-safe, and DEK wrapping upgrades are independent. Range query encryption is harder: structured encryption range schemes (MongoDB uses fully randomized ciphertext, not order-preserving encryption) are not yet standardized for PQC; this module cites no standard or date for PQC-compatible queryable encryption.

Several regulatory frameworks require protection of sensitive data. GDPR Article 32(1) lists “the state of the art” among the factors for choosing appropriate technical and organisational measures, and DORA's technical standard requires provisions for “updating or changing, where necessary, the cryptographic technology on the basis of developments in cryptanalysis”; neither names a post-quantum algorithm or a date.

GDPR Art. 32
"State of the art" technical measures for personal data.
GDPR Article 32(1) names the state of the art among the factors and prescribes no algorithm or date. HYOK architecture keeps customer keys on-prem, so the cloud provider does not hold the key. This module advises that databases retaining PII beyond 2030 prioritize ML-KEM DEK wrapping.
HIPAA § 164.312
Encryption and decryption of ePHI at rest.
Prioritize ePHI datasets whose confidentiality requirements extend for decades; retention periods vary by record type and jurisdiction. HIPAA’s Security Rule requires a risk analysis and treats encryption as an addressable implementation specification, not a named PQC algorithm mandate. Apply federal NSS requirements only where the system is in scope.
DORA Art. 9
Policy on encryption and cryptographic controls, including key management (RTS 2024/1774 Articles 6 and 7).
DORA applies from 17 January 2025. Its technical standard (2024/1774) requires a policy on encryption and cryptographic controls, with provisions for updating or changing, where necessary, the cryptographic technology on the basis of developments in cryptanalysis (Article 6), and key-lifecycle controls (Article 7). It names no algorithm and does not name HYOK; this module advises a PQC-capable HSM for financial databases as its own recommendation.
NSM-8 / CNSA 2.0
CNSA 2.0 algorithms for NSS by 31 December 2031 unless otherwise noted.
For in-scope National Security Systems, new acquisitions must be CNSA 2.0-compliant from 1 January 2027 and unsupported equipment and services must be phased out by 31 December 2030 unless excepted. CNSA 2.0 specifies ML-KEM-1024 for key establishment, but the applicable architecture and validation policy determine how a database wraps DEKs and whether an HSM or HYOK design is required.
NIST IR 8547 (Final, Oct 2026) & U.S. Federal PQC (EO 14412 / OMB M-26-15)
Deprecate quantum-vulnerable public-key algorithms after 2030 and disallow them after 2035; federal acquisitions require FIPS 140-3 validated modules.
NIST IR 8547 (finalized October 2026) establishes the transition schedule for classical RSA/ECC key establishment and signatures, while EO 14412 and OMB M-26-15 drive civilian federal agency PQC migration planning and procurement. Because FIPS 140-2 certificates moved to the CMVP Historical List in September 2026, verify that any database KMS or HSM target carries an active FIPS 140-3 validation.
HNDL Risk Window for Databases

Exposure depends on how long the data must stay confidential, not on how long it is retained: a database with RSA-2048 wrapped DEKs and records that must stay confidential for 15 years has up to 15 years of exposure. If a CRQC arrives in 2030, data collected today could be decrypted by 2030 via harvested ciphertext. Using or with ML-KEM wrapping protects keys wrapped from now on; ciphertext and old key envelopes that an adversary has already taken remain exposed, and re-encrypting the data protects only the copies the adversary has not yet taken.

Not all data-at-rest needs the same treatment. Describe the dataset and this chooser recommends a migration strategy — from cheapest (key-wrap) to most expensive (re-encrypt), or crypto-shred when migration isn't worth it.

Secrecy lifetime
Symmetric layer
Data value
Recommended: PQC key-wrap (re-wrap the DEK)

Leave bulk ciphertext as-is; re-wrap the data-encryption key with an ML-KEM key-encryption key. Cheapest quantum-safe path when the symmetric layer (AES-256) is already strong.

Source: Applied Quantum PQC Migration Framework §5.6 (Data-at-rest strategy).

Map encryption layers, plan TDE migration, design BYOK architecture, and assess your fleet readiness.

Check off all sections and mark this reading done.

Try it

workshop steps that practise this lesson
  • Step 2: TDE Migration Planner

    Plan a TDE protector change and test how rewrapping affects backup recovery.
  • Step 1: Encryption Layer Mapper

    Map database encryption layers and identify PQC upgrade paths for each tier.
  • Step 3: BYOK Architecture Designer

    Design BYOK/HYOK key ownership architecture with PQC external KMS.

Your comments on Database Encryption & PQC(0)

Stored on this device only. A comment never counts toward your progress.

    Related resources

    Loading terms, documents and more…

    Production Tool Capabilities & Verification ChecklistDatabase Administrators (DBAs), Data Architects & Storage Engineers

    Capabilities to require in your production tools:

    • Transparent Data Encryption (TDE) using `AES-256-GCM` / `AES-256-XTS` with Master Encryption Keys (MEKs) wrapped via `ML-KEM-768/1024` in external KMS/HSM (KMIP 3.0 draft / PKCS#11 v3.2).
    • Client-Side Field-Level Encryption (CSFLE) and searchable encryption key hierarchies using post-quantum key encapsulation.
    • Database wire-protocol TLS 1.3 hybrid key exchange (`X25519MLKEM768`) where the database or driver and its OpenSSL 3.5+ build support it (MySQL Community: yes; verify PostgreSQL, Oracle, SQL Server and MongoDB per release).

    How to evaluate in your environment

    Perform an online TDE master-key rotation backed by an `ML-KEM` KMS key in staging and verify client-to-DB TLS 1.3 hybrid cipher negotiation.

    Production evidence to collect

    TDE key-rotation audit log, KMIP/KMS key-wrapping receipt, and `pg_stat_ssl` (TLS version/cipher) plus a packet capture or server log showing the negotiated key-exchange group.

    Completing this Hub module and its browser-based sample exercises teaches the technical and governance decision criteria for your role; it does not test, validate, or certify your deployed production systems.

    Record evidence for your environment

    Identify the tested build and configuration. Use reference IDs for observations. For a proposed exclusion, record the system boundary or rule and why it excludes this build.

    Transparent Data Encryption (TDE) using `AES-256-GCM` / `AES-256-XTS` with Master Encryption Keys (MEKs) wrapped via `ML-KEM-768/1024` in external KMS/HSM (KMIP 3.0 draft / PKCS#11 v3.2).
    Client-Side Field-Level Encryption (CSFLE) and searchable encryption key hierarchies using post-quantum key encapsulation.
    Database wire-protocol TLS 1.3 hybrid key exchange (`X25519MLKEM768`) where the database or driver and its OpenSSL 3.5+ build support it (MySQL Community: yes; verify PostgreSQL, Oracle, SQL Server and MongoDB per release).

    Evidence missing. 0 of 3 requirements have a reference or scope rationale.

    Learning module content can be inaccurate. Please double-check its information. Report inaccuracies in PQC Today GitHub Discussions.