What is Sodium?
Source: doc.libsodium.org |
Encryption/Decryption
{{lang-cpp}}unsigned char key[crypto_secretbox_KEYBYTES]; unsigned char nonce[crypto_secretbox_NONCEBYTES]; unsigned char ciphertext[crypto_secretbox_MACBYTES + message_len]; unsigned char decrypted[message_len]; crypto_secretbox_easy(ciphertext, message, message_len, nonce, key); crypto_secretbox_open_easy(decrypted, ciphertext, sizeof(ciphertext), nonce, key);
|
Installation
|
Random bytes
|