Crate quantum_shield

Crate quantum_shield 

Source
Expand description

§Quantum Shield

Hybrid quantum-resistant cryptography library using NIST-standardized post-quantum algorithms.

§Features

  • Hybrid Encryption: RSA-4096 + Kyber-1024 (NIST Level 5)
  • Hybrid Signatures: RSA-4096-PSS + Dilithium5 (NIST Level 5)
  • Defense in Depth: Multiple independent security layers
  • Automatic Failover: Falls back to Kyber if RSA decryption fails

§Quick Example

use quantum_shield::{HybridCrypto, Result};

// Generate keypairs for Alice and Bob
let alice = HybridCrypto::generate_keypair()?;
let bob = HybridCrypto::generate_keypair()?;

// Alice encrypts a message for Bob
let message = b"Secret quantum-resistant message";
let encrypted = alice.encrypt(message, &bob.public_keys())?;

// Bob decrypts the message
let decrypted = bob.decrypt(&encrypted)?;
assert_eq!(message, &decrypted[..]);

Modules§

prelude
Re-export commonly used types

Structs§

AlgorithmAgility
Algorithm agility manager for crypto-agility
CryptoVersion
Cryptography version for algorithm agility
EntropyMonitor
Entropy pool monitor for key generation security
HybridCiphertext
Hybrid encrypted data (RSA + Kyber + AES)
HybridCrypto
Main hybrid cryptography engine
HybridSignature
Hybrid digital signature (RSA + Dilithium)
KeyPair
Complete keypair (public + private)
PrivateKeys
Private keys (zeroized on drop for security)
PublicKeys
Public keys bundle for hybrid cryptography
SecureMemory
Enhanced memory scrubbing with stack and register zeroization
SecurityAuditResult
Security audit results
SecurityManager
Comprehensive security manager
TimingProtection
Timing attack prevention with jitter and blinding

Enums§

Error
Errors that can occur during cryptographic operations

Constants§

DEFAULT_CRYPTO_VERSION
DEFAULT_ENTROPY_THRESHOLD
DILITHIUM_KEY_SIZE
ENTROPY_BUFFER_SIZE
HASH_OUTPUT_SIZE
KYBER1024_CIPHERTEXT_BYTES
KYBER_KEY_SIZE
MAX_ALGORITHM_VERSIONS
MAX_ENCRYPTION_SIZE
MAX_KEY_SIZE
MAX_SIGNATURE_SIZE
MAX_TIMING_JITTER_MICROS
MEMORY_SCRUB_ROUNDS
MEMORY_USAGE_THRESHOLD_MB
MIN_ENTROPY_TIME_SECONDS
NIST_LEVEL_5
NONCE_BYTES
RSA_KEY_SIZE
SECURE_ALLOCATION_SIZE
SLOW_OPERATION_THRESHOLD_MS

Functions§

constant_time_compare
Constant-time comparison to prevent timing attacks
constant_time_select
Constant-time selection based on condition

Type Aliases§

Result
Result type alias for Quantum Shield operations