crypto_secretbox without nonce parameter #1165
Apromixately
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
The nonce is critical for security. Every message encrypted with a given key must must encrypted with a unique value for that parameter. It doesn't have to be random nor secret, just unique. secretstream creates the nonce for you. It also ensures that messages cannot be dropped, duplicated or reordered. If you are planning to send more than one message per key, this is usually what you want. In most protocols, the nonce is a simple counter, or anything the sender and the recipient can compute deterministically. So it doesn't have to be sent along with the ciphertext. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In many cases specifying a nonce is an unnecessary burden on the API caller and doesn't add any benefit. Could there be a version which generates a nonce internally?
This would also cover problems where people don't know how to generate proper randomness.
Beta Was this translation helpful? Give feedback.
All reactions