--- id: dilithium-py version: "1.4.0" license: MIT license_treatment: permissive maintenance: active --- # dilithium-py — A pure python implementation of ML-DSA (FIPS 204) License: permissive · Maintenance: active · Downloads: 156.5K/mo ## What it is and what it does This package provides a pure-Python implementation of ML-DSA (the NIST standardized version of Dilithium from FIPS 204) and the original CRYSTALS-Dilithium specification. It exposes three core functions: keygen() to generate keypairs, sign() to create signatures, and verify() to validate them. The implementation passes all known test vectors (KATs) for both ML-DSA and Dilithium v3.1. The package is explicitly designed for educational purposes and learning about post-quantum lattice-based cryptography. The code is not constant-time and not optimized for performance; instead, it prioritizes readability and close correspondence with the published specifications. The disclaimer is unambiguous: do not use this for actual cryptographic applications. It includes optional support for the xoflib package for better performance with XOF operations, and uses pycryptodome for AES256 CTR DRBG if deterministic randomness is needed. Use it for: - Learning how ML-DSA and Dilithium work by reading well-commented, specification-aligned code - Experimenting with post-quantum signature schemes in a controlled, educational environment - Comparing the differences between the original Dilithium v3.1 and the standardized ML-DSA - Testing interoperability with ML-DSA implementations by validating against official KAT vectors - Prototyping quantum-resistant signature workflows before deploying production systems ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pure-Python implementation of ML-DSA (FIPS 204) and CRYSTALS-Dilithium post-quantum digital signature algorithms for educational study and experimentation. Yes, if your goal is learning or experimentation with post-quantum cryptography. The implementation is actively maintained, has no runtime dependencies, and passes all official test vectors. However, do not install for production cryptographic use—the package explicitly warns against this and is not designed to resist side-channel attacks. For production ML-DSA, use a hardened C or Rust implementation. ## Install pip install dilithium-py uv add dilithium-py poetry add dilithium-py ## Installing dilithium-py Before you install: Low install friction with no runtime dependencies. Active maintenance (last commit 2026-06-09) and recent releases. Suitable for learning and experimentation. License in practice: MIT license (permissive). You may use, modify, and distribute freely with minimal restrictions. Quickstart: pip install dilithium-py from dilithium_py.ml_dsa import ML_DSA_44 pk, sk = ML_DSA_44.keygen() msg = b"Your message" sig = ML_DSA_44.sign(sk, msg) assert ML_DSA_44.verify(pk, msg, sig) Requires Python 3.9 or later. Not suitable for production cryptographic applications—use only for learning and experimentation. Verify before relying: - Whether pycryptodome is an optional or required runtime dependency for deterministic CSRNG use - Whether xoflib is required or optional for production-grade performance - Actual performance characteristics in real-world scenarios beyond the benchmarks shown ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 156.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags post-quantum cryptography, ML-DSA signature, dilithium implementation, NIST FIPS 204, lattice-based signatures, quantum-resistant signing, educational cryptography, post-quantum, educational, lattice-crypto [View on SkillFed](https://skillfed.io/packages/dilithium-py) · [View on PyPI](https://pypi.org/project/dilithium-py/)