Learn · Practitioner
Database Encryption & PQC
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:
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 NOT covered: DBA with SELECT privilege, memory scraping, SQL injection
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.
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.
(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.
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:
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.
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.
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.
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.
- • Oracle:
ALTER TABLESPACE ... ENCRYPTION ONLINE REKEY - • SQL Server:
ALTER DATABASE ENCRYPTION KEY REGENERATE - • MongoDB Enterprise KMIP master-key rotation:
security.kmip.rotateMasterKeyre-encrypts the internal keystore; database keys stay unchanged. For client-side encrypted fields,KeyVault.rewrapManyDataKeyre-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
- • 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
| Algorithm | Encoded Key / Share | Ciphertext / Output | Use Case |
|---|---|---|---|
| RSA-2048 | 256 B modulus | 256 B | Example RSA-2048 encoding |
| ECDH P-256 | 65 B | — | 65 B uncompressed SEC1 point |
| ML-KEM-768 | 1,184 B | 1,088 B | NIST default parameter set |
| ML-KEM-1024 | 1,568 B | 1,568 B | CNSA 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.
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.
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.
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.
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.
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
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.
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.