| Crates.io | chacha12-blake3 |
| lib.rs | chacha12-blake3 |
| version | 0.9.10 |
| created_at | 2025-08-06 11:12:06.663074+00 |
| updated_at | 2025-08-06 19:16:16.699527+00 |
| description | Secure, Simple and Fast encryption for any CPU |
| homepage | https://kerkour.com/chacha12-blake3 |
| repository | https://github.com/bloom42/chacha12-blake3 |
| max_upload_size | |
| id | 1783670 |
| size | 21,554 |
Simple, Secure and Fast encryption for any CPU.
ChaCha12-BLAKE3 is a secure Authenticated Encryption with Associated Data (AEAD) algorithm that is:
Making it a great fit for everything from microcontrollers to huge servers.
It was designed to be the only encryption algorithm you will ever need.
https://kerkour.com/chacha12-blake3
Warning ⚠️: A (key, nonce) pair SHOULD NEVER be used to encrypt two messages. You can use either an unique key for every message, the same key with unique random nonces, or the same key with a NON-REPEATING counter in the first X bytes of the nonce.
Cargo.toml
[dependencies]
chacha12-blake3 = "0.9"
use chacha12_blake3::ChaCha12Blake3;
fn main() {
let key: [u8; 32] = rand::random();
let nonce: [u8; 32] = rand::random();
// or with an u64 counter to encrypt up to 2^64 messages:
// let mut nonce = [0u8; 32];
// nonce[..8].copy_from_slice(&counter.to_le_bytes());
let message = b"Hello World!";
let cipher = ChaCha12Blake3::new(key);
let ciphertext: Vec<u8> = cipher.encrypt(&nonce, message, &[]);
let plaintext: Vec<u8> = cipher.decrypt(&nonce, &ciphertext, &[]).unwrap();
assert_eq!(plaintext, message);
}
| Feature | Default? | Description |
|---|---|---|
alloc |
✓ | Enables encrypt / decrypt APIs that allocate memory |
zeroize |
✓ | Enables zeroize to erase sensitive secrets from memory |
MIT. See LICENSE.txt