apfsds-crypto

Crates.ioapfsds-crypto
lib.rsapfsds-crypto
version0.2.0
created_at2026-01-17 15:47:53.20986+00
updated_at2026-01-18 02:46:30.482316+00
descriptionCryptographic primitives for APFSDS (X25519, AES-GCM, Ed25519)
homepage
repository
max_upload_size
id2050691
size40,032
rand0mdevel0per (rand0mdevel0per)

documentation

README

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 apfsds_crypto::{AesGcmCipher, Ed25519Keypair, HmacAuth};

// AES-256-GCM encryption
let cipher = AesGcmCipher::new(&key);
let ciphertext = cipher.encrypt(plaintext)?;
let plaintext = cipher.decrypt(&ciphertext)?;

// Ed25519 signing
let keypair = Ed25519Keypair::generate();
let signature = keypair.sign(message);
assert!(keypair.verify(message, &signature));

// HMAC authentication
let auth = HmacAuth::new(&secret);
let token = auth.generate_token(user_id, expiry);
assert!(auth.verify_token(&token));

Security Notes

  • All keys are securely generated using rand
  • AES-GCM uses random 12-byte nonces
  • Ed25519 provides 128-bit security level

License

MIT

Commit count: 0

cargo fmt