| Crates.io | enigma-aead |
| lib.rs | enigma-aead |
| version | 0.1.1 |
| created_at | 2025-12-15 11:47:05.373737+00 |
| updated_at | 2025-12-15 12:53:49.608053+00 |
| description | AEAD + framing + nonce transport layer for Enigma secure messaging |
| homepage | https://github.com/Gladius33/enigma-aead |
| repository | https://github.com/Gladius33/enigma-aead |
| max_upload_size | |
| id | 1985884 |
| size | 38,750 |
enigma-aead provides a reusable AEAD + framing + nonce transport layer for Enigma components. It combines deterministic packet framing with XChaCha20-Poly1305 to ensure every encrypted message is self-describing and ready for any transport.
use enigma_aead::AeadBox;
fn demo() -> Result<(), Box<dyn std::error::Error>> {
let key = [0u8; 32];
let boxy = AeadBox::new(key);
let packet = boxy.encrypt(b"hello", b"chat")?;
let plaintext = boxy.decrypt(&packet, b"chat")?;
assert_eq!(plaintext, b"hello");
Ok(())
}
seal and open expose the XChaCha20-Poly1305 primitive without ENA1 framing, key identifiers, or packet parsing. Callers pass a 32-byte key, a 24-byte nonce, plaintext, and any required associated data, and the returned ciphertext contains the Poly1305 tag. Callers are responsible for nonce uniqueness and any framing or header metadata, while AeadBox::seal/AeadBox::open reuse the same key storage for convenience.
ENA10x010x01 for XChaCha20-Poly13050x000x00See docs/format.md for the full binary layout.
cargo test
seal/open API so higher-level crates can reuse the XChaCha20-Poly1305 primitive while keeping framing and nonce transport orthogonal to encryption.