pg_postquantum
alohadb · AlohaDB ML-KEM, ML-DSA and hybrid encryption functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102492 | pg_postquantum | alohadb | 1.0 | SEC | MIT | C |
PostgreSQL · 18
Usage
Sources:
pg_postquantum 1.0 exposes ML-KEM encapsulation, ML-DSA signatures and public-key encryption in AlohaDB 21.10.0, based on PostgreSQL 18. Its cryptographic implementation requires OpenSSL 3.5 or later. Stock PostgreSQL portability is not established.
Enable and Encrypt
The extension is trusted and relocatable: a role with database CREATE privilege can install it once the server files are present. It needs no preload or restart.
The example keeps an ephemeral key within one statement. Protect real private keys separately; avoid exposing them in SQL logs or broadly readable tables. Availability depends on the server’s OpenSSL algorithms, not just successful extension installation.
Function Index
pq_kem_keypair,pq_kem_encapsulateandpq_kem_decapsulatecreate keys and agree a shared secret. The default isX25519-ML-KEM-768; raw KEM also supportsML-KEM-512,ML-KEM-768andML-KEM-1024.pq_sign_keypair,pq_signandpq_verifycreate and verify signatures. The default isML-DSA-65, withML-DSA-44andML-DSA-87alternatives.pq_public_keyderives a public key from a private key and explicit algorithm.pq_encrypt,pq_decryptandpq_decrypt_textcombine encapsulation with AES-256-GCM. The encryption envelope supports the default hybrid and ML-KEM-768/1024, not every raw-KEM option.
Use the same algorithm and key encoding at both ends. Keys are raw encodings; hybrid keys concatenate the ML-KEM and X25519 portions. Text helpers use UTF-8, while binary functions use bytea.
Maintenance and Security Boundary
The PQE1 envelope includes the scheme, KEM ciphertext, nonce, encrypted data and authentication tag. Preserve compatible decryptors and keys when migrating data or backups. An extension installation does not supply key lifecycle management, authorization, protocol authentication or a certification of application compliance.
Keep the AlohaDB extension and OpenSSL libraries aligned. Validate round trips, tampered inputs and recovery with the exact deployed build before entrusting persistent data to this preview module.