Registry / crypto / aead
library0.6.0rscratesunverified

Traits for Authenticated Encryption with Associated Data (AEAD) algorithms, such as AES-GCM and ChaCha20Poly1305.

# Cargo.toml [dependencies] aead = "0.6.0"
INSTALL
IMPORT
SIG · AEAD
A
aead
cryptorustv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Aead
use aead::{Aead, AeadCore, KeyInit, Payload};

Demonstrates AEAD encryption using the aead traits.

use aead::{Aead, AeadCore, KeyInit, Payload}; fn main() { // Example: using a dummy key (real usage requires a concrete impl like aes-gcm) let key = [0u8; 32]; let cipher = /* e.g., aes_gcm::Aes256Gcm::new_from_slice(&key).unwrap() */; let nonce = AeadCore::generate_nonce(&mut rand::thread_rng()); let ciphertext = cipher.encrypt(&nonce, Payload::Message(b"hello")).unwrap(); println!("Encrypted: {:?}", ciphertext); }
Debug
Known issues
gotchaRequires a concrete AEAD implementation crate (e.g., aes-gcm, chacha20poly1305) to function.
fix
Add a concrete AEAD crate like aes-gcm to your dependencies.
affects: >=0.6.0
Upgrade
Version history
0.6.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
46 hits · last 30 days
node
41
Resources
aead — cargo add aead · libregistry