{"id":57905,"library":"ctr","title":"CTR","description":"CTR block mode of operation for symmetric ciphers.","status":"active","version":"0.10.1","language":"rust","source_language":null,"source_url":"https://github.com/RustCrypto/block-modes","tags":["cryptography","block-cipher","mode","ctr"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nctr = \"0.10.1\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add ctr","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"Ctr128BE","correct":"use ctr::Ctr128BE;"}],"quickstart":{"code":"use ctr::Ctr128BE;\nuse cipher::KeyIvInit;\n\nfn main() {\n    let key = [0u8; 16];\n    let iv = [0u8; 16];\n    let mut cipher = Ctr128BE::<aes::Aes128>::new(&key.into(), &iv.into());\n    let mut data = [0u8; 16];\n    cipher.apply_keystream(&mut data);\n    println!(\"{:?}\", data);\n}","lang":"rust","description":"Encrypt data using AES-128 in CTR mode."},"warnings":[{"fix":"Add the aes crate to your Cargo.toml.","message":"Requires a block cipher implementation (e.g., aes crate) as a dependency.","severity":"gotcha","affected_versions":">=0.10.0"}],"env_vars":null,"search_vec":"'block':3,12 'block-ciph':11 'cipher':9,13 'cryptographi':10 'ctr':1,2,15 'mode':4,14 'oper':6 'symmetr':8","created_at":"2026-06-16T16:04:19.994351+00:00","updated_at":"2026-06-16T16:04:19.994351+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/RustCrypto/block-modes","github":"https://github.com/RustCrypto/block-modes","docs":"https://docs.rs/ctr/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["crypto"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}