Skip to content

Commit

Permalink
cry: add important comment on using counters as nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Sep 14, 2024
1 parent 3353366 commit 7088080
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cry/enc.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ func (e Enc) Encrypt(plainTextMsg string) (encryptedMsg []byte) {
// "you can send the nonce in the clear before each message; so long as it's unique. it can even be a counter." - agl
// see: https://crypto.stackexchange.com/a/5818
//
// there are problems if you use a counter as nonce - https://blog.trailofbits.com/2024/09/13/friends-dont-let-friends-reuse-nonces/
//
// "salt does not need to be secret."
// see: https://crypto.stackexchange.com/a/99502
e.salt,
Expand Down

0 comments on commit 7088080

Please sign in to comment.