Skip to main content

Crate qux_pqc

Crate qux_pqc 

Source
Expand description

§qux-pqc - Post-Quantum Cryptography Library

A comprehensive Rust library implementing NIST-standardized post-quantum cryptographic algorithms for key encapsulation and digital signatures.

§Features

  • ML-KEM (CRYSTALS-Kyber) - NIST FIPS 203 Key Encapsulation Mechanism
  • ML-DSA (CRYSTALS-Dilithium) - NIST FIPS 204 Digital Signature Algorithm
  • AES-256-GCM - Symmetric encryption with PQC-derived keys
  • SHA3-256/512 - Quantum-resistant hashing
  • Secure Key Management - Encrypted key storage with zeroization

§Security Levels

  • Level 3 (~AES-192 equivalent): ML-KEM-768 + ML-DSA-65
  • Level 5 (~AES-256 equivalent): ML-KEM-1024 + ML-DSA-87

§Example

use qux_pqc::{kem, dsa, SecurityLevel};

// Generate KEM key pair
let kem_keys = kem::generate_keypair(SecurityLevel::Level5).unwrap();

// Encapsulate shared secret
let (ciphertext, shared_secret) = kem::encapsulate(&kem_keys.public_key).unwrap();

// Decapsulate to recover shared secret
let recovered = kem::decapsulate(&ciphertext, &kem_keys.secret_key).unwrap();
assert_eq!(shared_secret, recovered);

// Generate DSA key pair and sign
let dsa_keys = dsa::generate_keypair(SecurityLevel::Level5).unwrap();
let message = b"Hello, quantum-safe world!";
let signature = dsa::sign(message, &dsa_keys.secret_key).unwrap();
assert!(dsa::verify(message, &signature, &dsa_keys.public_key).unwrap());

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

dsa
Digital Signature Algorithm (DSA) module
error
Error types for qux-pqc library
kem
Key Encapsulation Mechanism (KEM) module
keys
Key Management module
symmetric
Symmetric Encryption module
utils
Utility functions for qux-pqc

Structs§

AlgorithmInfo
Algorithm information
AlgorithmNames
Algorithm names for a security level
EncryptedSignedPayload
Encrypted and signed payload
KeySet
Complete key set containing both KEM and DSA key pairs
PublicKeySet
Public key set (safe to share)

Enums§

SecurityLevel
NIST Security Level for PQC algorithms

Functions§

algorithm_info
Get algorithm information for a security level
encrypt_and_sign
Encrypt data and sign the ciphertext
verify_and_decrypt
Verify signature and decrypt data
version
Get library version information