Registry / crypto / aes
library0.9.1rscratesunverified

Pure Rust implementation of the Advanced Encryption Standard (AES), also known as Rijndael.

# Cargo.toml [dependencies] aes = "0.9.1"
INSTALL
IMPORT
SIG · AES
A
aes
cryptorustv0.9.1
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.

Aes256
use aes::Aes256;

Encrypting data with AES-256 in CBC mode.

use aes::Aes256; use block_modes::{BlockMode, Cbc}; use block_modes::block_padding::Pkcs7; type Aes256Cbc = Cbc<Aes256, Pkcs7>; let key = [0u8; 32]; let iv = [0u8; 16]; let cipher = Aes256Cbc::new_from_slices(&key, &iv).unwrap(); let plaintext = b"Hello world!"; let ciphertext = cipher.encrypt_vec(plaintext); println!("Encrypted: {:?}", ciphertext);
Debug
Known issues
gotchaAES alone does not provide authenticated encryption; use an AEAD mode like AES-GCM for security.
fix
Use `aes-gcm` crate instead for authenticated encryption.
affects: *
Upgrade
Version history
0.9.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
47 hits · last 30 days
node
42
Resources
aes — cargo add aes · libregistry