Decrypts the given byte array data.
Encrypts the given byte array data.
import tern.digest.chacha20; ubyte[] data = [1, 2, 3, 4, 5]; string key = "my_secret_key"; // Must be exactly 256 bits (32 bytes) in length. ubyte[12] nonce = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; // Must be exactly 96 bits (12 bytes) in length. uint counter = 0; ChaCha20.encrypt(data, key, nonce, counter);
Implementation of ChaCha20 digester.
ChaCha20 is a symmetric encryption algorithm designed to provide both high performance and high security. It operates on 512-bit (64-byte) blocks and accepts a 256-bit (32-byte) key and a 96-bit (12-byte) nonce.