Skip to content

Instantly share code, notes, and snippets.

@tarcieri
Last active December 11, 2015 10:59
Show Gist options
  • Save tarcieri/4590841 to your computer and use it in GitHub Desktop.
Save tarcieri/4590841 to your computer and use it in GitHub Desktop.
Instructions for NaCl's crypto_secretbox
  • What the algorithm does for you: ensures data is kept confidential and that it cannot be undetectably modified by an attacker
  • What the algorithm expects from you: a unique bit of seed data (a nonce) which is never, ever reused (with the same key)
  • What happens if you reuse a nonce: complete loss of the confidentiality of your data (provided nonces are reused with the same key). Do NOT let this happen or you are breaking the security of your system
@namelessjon
Copy link

That is, taking two secretboxs with the same (key, nonce) pair in the first paragraph. That property doesn't hold once you change either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment