Registry / security / dilithium-py

dilithium-py

JSON →
library1.4.0pypypiunverified

A pure python implementation of the ML-DSA (FIPS 204) post-quantum digital signature scheme (formerly known as Dilithium). Version 1.4.0 supports multiple security levels (ML-DSA-44, ML-DSA-65, ML-DSA-87) and is actively maintained. Release cadence is irregular, with updates driven by standardization changes.

pip install dilithium-py
INSTALL
IMPORT
SIG · DILITHIUM-PY
D
dilithium-py
securitypythonv1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ML_DSA_44
from dilithium_py import ML_DSA_44
from dilithium import ML_DSA_44

Minimal example: key generation, signing, and verification using ML-DSA-65.

from dilithium import ML_DSA_65 # Key generation sk, pk = ML_DSA_65.keygen() # Signing msg = b"Hello, post-quantum world!" sig = ML_DSA_65.sign(sk, msg) # Verification try: ML_DSA_65.verify(pk, msg, sig) print("Valid signature") except Exception as e: print(f"Invalid signature: {e}")
Debug
Known issues
breakingOld class names (Dilithium2, Dilithium3, Dilithium5) removed in v1.0.0.
fix
Replace with ML_DSA_44, ML_DSA_65, ML_DSA_87 respectively.
affects: >=1.0.0
gotchaML-DSA is a stateful signature scheme. The sign function may modify internal state; do not reuse signer objects unless designed.
fix
Use keygen() to create fresh signing context for each signature if determinism is required.
affects: all
gotchaPublic key and signature sizes are larger than classical schemes (e.g., ML-DSA-65 pk ~1.3KB, sig ~2.4KB).
fix
Plan storage and transmission accordingly.
affects: all
gotchaThe library is pure Python. Performance may be insufficient for high-throughput production use.
fix
Consider optimized C libraries (e.g., liboqs) for performance-critical deployments.
affects: all
Upgrade
Version history
1.4.0latest on PyPI · released Dec 17, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
dilithium-py — pip install dilithium-py · libregistry