use dcrypt_algorithms::{
aead::ChaCha20Poly1305,
types::Nonce, };
fn main() {
let key_data = [0x42; 32];
let nonce_data = [0x24; 12];
let cipher = ChaCha20Poly1305::new(&key_data);
let plaintext = b"Hello, dcrypt!";
let aad = b"Additional data";
let nonce = Nonce::<12>::new(nonce_data);
let ciphertext = cipher.encrypt(&nonce, plaintext, Some(aad)).unwrap();
println!("Ciphertext: {:?}", ciphertext);
let decrypted = cipher.decrypt(&nonce, &ciphertext, Some(aad)).unwrap();
println!("Decrypted: {:?}", String::from_utf8_lossy(&decrypted));
}