Hybrid PQ-CP-ABE Library — Version 6.1.0¶
Overview¶
Version 6.1.0 is a major SDK and API refinement release on top of v6.0.2. It adds runtime-selectable cryptographic parameters, a new V3 hybrid ciphertext format, modern typed/object APIs for Python and JavaScript / WebAssembly, expanded ML-DSA signing-key workflows, a production-oriented Node.js package and CLI, and improved native SDK installation and multi-platform packaging.
The existing v6.0.x entry points remain available. Calls that do not opt into the new encryption/signing parameters retain the legacy behavior and formats, while the new decryptors can read V1, V2, and V3 ciphertexts.
New: Parameterized cryptographic APIs¶
The native C ABI now exposes explicit cryptographic parameter selection through
include/hybrid_pq_cp_abe/crypto-params.h.
Supported choices are:
| Primitive | Supported parameters | Default in parameterized hybrid calls |
|---|---|---|
| AES-GCM | 128, 192, 256 bits | AES-256 |
| ML-DSA | 44, 65, 87 | ML-DSA-87 |
| Standalone ML-KEM | 512, 768, 1024 | explicit argument |
| CoverCrypt PQ encapsulation | ML-KEM-768 | fixed at ML-KEM-768 |
New native entry points include parameterized setup, encryption, and sign-then-encrypt operations for both file and buffer APIs, including:
hybrid_cpabe_setupBuffer_with_ml_dsahybrid_cpabe_setup_with_ml_dsahybrid_cpabe_setup_with_signing_keyshybrid_cpabe_encryptBuffer_with_paramshybrid_cpabe_encrypt_with_paramshybrid_cpabe_encryptBuffer_and_sign_with_paramshybrid_cpabe_encrypt_and_sign_with_paramshybrid_cpabe_covercrypt_ml_kem_parameter_set
The existing decrypt and decrypt-and-verify APIs automatically recover the parameters stored in the ciphertext. No mutable global algorithm selection is required on the decrypt side.
See Native runtime parameters for the complete C ABI contract.
New: V3 hybrid ciphertext format¶
Explicit AES or ML-DSA parameter selection activates the new V3 ciphertext format.
V3 records:
- the ABE scheme;
- AES key size;
- ML-DSA parameter set, or unsigned state;
- a fresh 12-byte GCM nonce;
- the encrypted ABE seed;
- the authenticated AES-GCM payload.
ABE protects a fresh 32-byte random seed. The payload key is derived with SHA3-256 and the complete V3 header is authenticated as AES-GCM AAD.
Signed V3 payloads also bind the scheme, AES size, ML-DSA parameter set, access policy, and plaintext to the signature.
Compatibility rules:
- V6.1 decryptors read V1, V2, and V3.
- Legacy APIs continue to produce their previous format when the new parameters are not supplied.
- A previous library version cannot read V3 ciphertexts.
- AC17 and TKN20 remain classical ABE schemes.
- CoverCrypt continues to use ML-KEM-768 for its post-quantum encapsulation component.
Modern Python SDK¶
The Python package now provides a higher-level typed API in addition to the existing compatibility functions.
Primary object classes include:
PqCpAbeAC17CPABETKN20CPABECoverCryptABEAesGcmMlDsaMlKem
The package also exposes typed enums and result objects such as Scheme,
KemMode, MlDsaParameterSet, MlKemParameterSet, AuthorityKeys,
AuthoritySigningKeys, KeyPair, and KemEncapsulation.
Example:
from pq_cp_abe import PqCpAbe, KemMode
abe = PqCpAbe(
config={
"dimensions": [
{"name": "department", "attributes": ["finance", "it"]}
]
},
mode=KemMode.HYBRIDIZED,
)
authority = abe.setup()
user_key = abe.keygen(
authority.master_secret_key,
"department::it",
)
ciphertext = abe.encrypt(
authority.public_key,
b"confidential record",
"department::it",
aes_key_bits=256,
)
plaintext = abe.decrypt(user_key, ciphertext)
The modern Python layer adds:
- object-oriented ABE backends;
- functional file and buffer APIs;
- structured exceptions such as
AbeError,PolicyMismatchError, andSignatureInvalidError; - standalone AES-GCM, ML-DSA, and ML-KEM primitives;
- CoverCrypt authority growth helpers;
- typed result objects instead of raw multi-value conventions;
- explicit AES and ML-DSA parameter selection.
Legacy call_* compatibility functions remain available.
Python packaging now declares support for Python 3.10 through 3.15.
See the Python API reference.
Modern JavaScript / TypeScript and WebAssembly SDK¶
The WebAssembly SDK has been promoted from the lower-level Emscripten interface introduced in v6.0.2 into a modern JavaScript / TypeScript package.
Install from npm:
npm install @wanthinnn/pq-cp-abe
The package exports:
PqCpAbeAC17CPABETKN20CPABECoverCryptABEAesGcmMlDsaMlKemSchemeKemModeMlDsaParameterSetMlKemParameterSet
Example:
import { PqCpAbe, KemMode } from '@wanthinnn/pq-cp-abe';
const abe = await PqCpAbe.create({
config: {
dimensions: [
{ name: 'department', attributes: ['finance', 'it'] }
]
},
mode: KemMode.HYBRIDIZED,
});
console.log(abe.api.getVersion());
The JavaScript API uses Uint8Array for binary data, includes TypeScript
declarations, exposes typed errors, and automatically manages native buffers for
the modern API surface.
The raw Emscripten module remains available through the default export for
advanced integrations using ccall, FS, or ENV.
See the JavaScript / WASM API reference.
Node.js CLI and self-test¶
The npm package now includes a Node.js CLI:
npx @wanthinnn/pq-cp-abe --help
npx @wanthinnn/pq-cp-abe --test
The CLI uses real host filesystem paths, while direct WASM file APIs continue to use the Emscripten virtual filesystem.
The package build and release scripts were expanded so the runtime, TypeScript declarations, licenses, notices, and required WASM/Go support files can be distributed together.
Expanded ML-DSA signing workflows¶
Signing support is now represented explicitly across the native, Python, WASM, and CLI layers.
Applications can:
- generate ABE authority keys together with ML-DSA signing and verification keys;
- choose ML-DSA-44, ML-DSA-65, or ML-DSA-87;
- encrypt and sign in one operation;
- decrypt and verify before authenticated plaintext is returned;
- use modern
ml-dsakey filenames while retaining compatibility with legacypqcnaming.
The signature parameter set is encoded in V3 ciphertexts, so decryption and verification do not require an external algorithm-selection flag.
Plain decryption is intentionally not a substitute for signature verification. Authenticated callers must use the decrypt-and-verify API with a trusted verification key.
Standalone cryptographic primitives¶
Python and JavaScript now expose first-class standalone helpers for:
AES-GCM¶
- AES-128, AES-192, and AES-256;
- key generation;
- nonce generation;
- authenticated encryption/decryption with optional AAD.
Additional nonce validation and edge-case tests were added to reject invalid nonce usage at the API boundary.
ML-DSA¶
- ML-DSA-44;
- ML-DSA-65;
- ML-DSA-87;
- key generation;
- size queries;
- signing;
- verification.
ML-KEM¶
- ML-KEM-512;
- ML-KEM-768;
- ML-KEM-1024;
- key generation;
- size queries;
- encapsulation;
- decapsulation.
These standalone primitives are independent of the fixed ML-KEM-768 component used by CoverCrypt.
Native CLI and installation improvements¶
The native command-line executable is standardized as:
pq-cp-abe
The CLI now supports the new V3 parameter controls, including:
pq-cp-abe setup --scheme covercrypt --with-signing-keys --ml-dsa 65 keys
pq-cp-abe encrypt --scheme covercrypt --sign --aes-bits 192 --ml-dsa 65 \
keys/cpabe_pk.key keys/ml-dsa_sk.key message.bin \
"Department::IT AND Level::ADMIN" message.enc
pq-cp-abe decrypt --verify user.key keys/ml-dsa_pk.key message.enc recovered.bin
The source build now provides a more complete make install path:
- Linux/macOS default to
/usr/local, withPREFIXandDESTDIRsupport. - Windows defaults to
%LOCALAPPDATA%\\Programs\\pq-cp-abeand can update the userPATH. - Installed SDK layouts separate
bin/,include/, andlib/. - Windows packaging distinguishes the static library from the shared-library import library.
Native release documentation and installation scripts were updated to match the new CLI and SDK layout.
Platform and packaging updates¶
The release and wheel workflows received several compatibility improvements:
- macOS SDK and wheel builds target macOS 12;
- deployment-target verification was added for macOS artifacts;
- workflows can backfill macOS SDK/wheel artifacts where needed;
- Linux SDK requirements are documented as glibc 2.34+ with
GLIBCXX_3.4.29; - Python wheel metadata now includes Python 3.14 and 3.15;
- release packaging includes updated notices and licensing metadata;
- the project
NOTICEfile was restored and kept with packaged artifacts.
Test and security hardening¶
The test suite was expanded substantially across the native, Python, and WASM layers.
Coverage added or strengthened for:
- all three ABE schemes;
- AES-128/192/256 parameter combinations;
- ML-DSA-44/65/87 signing combinations;
- standalone ML-KEM parameter sets;
- V1/V2 compatibility and V3 processing;
- ciphertext parameter tampering;
- truncation and malformed inputs;
- policy-denial behavior;
- empty and binary payloads;
- signed ciphertext verification;
- CoverCrypt authority growth;
- Python OOP and functional APIs;
- WASM OOP and CLI behavior;
- release package validation;
- Windows runtime packaging;
- macOS deployment-target validation.
The vendored PQC test coverage was also expanded, including FAEST integration tests and test-suite validation. This is test/integration hardening; it does not make FAEST a new public PQ-CP-ABE API.
Documentation overhaul¶
The documentation was reorganized into a complete multi-SDK documentation tree covering:
- architecture and cryptographic workflows;
- Python SDK;
- JavaScript / WebAssembly SDK;
- native C/C++ API;
- native CLI and build/install instructions;
- runtime cryptographic parameters and V3 wire format;
- Vault integration;
- benchmarks and release information.
The public documentation site also gained responsive navigation, platform-aware download recommendations, improved mobile presentation, release-note navigation, and per-page Markdown tools for AI/agent workflows.
Compatibility summary¶
- Existing v6.0.x native entry points remain available.
- Existing calls that omit the new parameters preserve legacy encryption behavior.
- V6.1 decryptors accept V1, V2, and V3 ciphertexts.
- V3 ciphertexts require a v6.1-compatible reader.
- Legacy Python
call_*functions remain available. - The raw WASM/Emscripten factory remains available.
- AC17 and TKN20 remain classical ABE.
- CoverCrypt uses ML-KEM-768 in its post-quantum component.
- ML-DSA signatures provide authenticity and do not by themselves make AC17 or TKN20 quantum-resistant.