4 ms·
AES-GCM allows the caller to supply additional authenticated data (AAD) -- data that is only authenticated but not encrypted. However NaCl's authenticated encry
by chaitanya 11y ago
AES-GCM allows the caller to supply additional authenticated data (AAD) -- data that is only authenticated but not encrypted. However NaCl's authenticated encryption mode doesn't seem to provide anything like this: http://nacl.cr.yp.to/secretbox.html http://nacl.cr.yp.to/secretbox.html
So when I have AAD, what should I do when using NaCl? Add it as part of the message to crypto_secretbox(), or should I authenticate this data separately?
- agwa 11y agoYou could use libsodium instead of NaCl, which has an AEAD interface: https://download.libsodium.org/doc/secret-key_cryptography/aead.html https://download.libsodium.org/doc/secret-key_cryptography/a...
- arielby 11y agoUnfortunately that interface is rather dangerous because of the 64-bit nonces - it is essentially only useful for encrypting multiple messages over a single connection.
- deleted 11y ago[deleted]