| Crates.io | qudag-crypto |
| lib.rs | qudag-crypto |
| version | 0.5.1 |
| created_at | 2025-06-20 18:01:05.95362+00 |
| updated_at | 2025-06-24 02:20:19.757553+00 |
| description | Quantum-resistant cryptography library for QuDAG - includes ML-KEM-768, ML-DSA, HQC, and BLAKE3 |
| homepage | |
| repository | https://github.com/ruvnet/QuDAG |
| max_upload_size | |
| id | 1719945 |
| size | 29,536,887 |
Quantum-resistant cryptographic primitives for the QuDAG protocol.
Add to your Cargo.toml:
[dependencies]
qudag-crypto = "0.1"
use qudag_crypto::ml_kem::MlKem768;
// Generate keypair
let (public_key, secret_key) = MlKem768::keygen()?;
// Encapsulate to get shared secret
let (ciphertext, shared_secret1) = MlKem768::encapsulate(&public_key)?;
// Decapsulate to recover shared secret
let shared_secret2 = MlKem768::decapsulate(&secret_key, &ciphertext)?;
assert_eq!(shared_secret1.as_bytes(), shared_secret2.as_bytes());
use qudag_crypto::ml_dsa::{MlDsa, MlDsaKeyPair};
// Generate signing keypair
let keypair = MlDsaKeyPair::generate()?;
let message = b"Hello, quantum-resistant world!";
// Sign message
let signature = keypair.sign(message)?;
// Verify signature
assert!(keypair.public_key().verify(message, &signature)?);
use qudag_crypto::hash::HashFunction;
let data = b"Data to hash";
let hash = HashFunction::hash(data);
println!("Hash: {}", hex::encode(hash.as_bytes()));
use qudag_crypto::fingerprint::Fingerprint;
let data = b"Important data";
let fingerprint = Fingerprint::generate(data)?;
// Verify data integrity
assert!(fingerprint.verify(data)?);
| Algorithm | Type | Security Level | Standard |
|---|---|---|---|
| ML-KEM-768 | Key Encapsulation | NIST Level 3 | FIPS 203 |
| ML-DSA | Digital Signatures | NIST Level 3 | FIPS 204 |
| HQC-128/192/256 | Encryption | 128/192/256-bit | NIST Round 4 |
| BLAKE3 | Hash Function | 256-bit | RFC Draft |
QuDAG Crypto is optimized for performance with:
Licensed under either MIT or Apache-2.0 at your option.