Registry / crypto / ctr
library0.10.1rscratesunverified

CTR block mode of operation for symmetric ciphers.

# Cargo.toml [dependencies] ctr = "0.10.1"
INSTALL
IMPORT
SIG · CTR
C
ctr
cryptorustv0.10.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.

Ctr128BE
✓ use ctr::Ctr128BE;

Encrypt data using AES-128 in CTR mode.

use ctr::Ctr128BE; use cipher::KeyIvInit; fn main() { let key = [0u8; 16]; let iv = [0u8; 16]; let mut cipher = Ctr128BE::<aes::Aes128>::new(&key.into(), &iv.into()); let mut data = [0u8; 16]; cipher.apply_keystream(&mut data); println!("{:?}", data); }
Debug
Known issues
gotchaRequires a block cipher implementation (e.g., aes crate) as a dependency.
fix
Add the aes crate to your Cargo.toml.
affects: >=0.10.0
Upgrade
Version history
0.10.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
Resources
ctr — cargo add ctr · libregistry