apfsds-crypto
Cryptographic primitives for APFSDS.
Features
- AES-256-GCM: Authenticated encryption with associated data
- Ed25519: Digital signatures and verification
- X25519 ECDH: Elliptic curve Diffie-Hellman key exchange
- HMAC-SHA256: Token authentication and integrity verification
- XOR Filter: Efficient replay protection
Usage
use ;
// AES-256-GCM encryption
let cipher = new;
let ciphertext = cipher.encrypt?;
let plaintext = cipher.decrypt?;
// Ed25519 signing
let keypair = generate;
let signature = keypair.sign;
assert!;
// HMAC authentication
let auth = new;
let token = auth.generate_token;
assert!;
Security Notes
- All keys are securely generated using
rand - AES-GCM uses random 12-byte nonces
- Ed25519 provides 128-bit security level
License
MIT