derekcollison/secure-nats-chat

Nonce reuse

Opened this issue · 0 comments

It is my understanding that a nonce shouldn't be used for more than one message with a key. It looks like this uses the same one every time. Looking for other uses of cipher.NewGCM I found https://github.com/mkouhei/golang-hashicorp-memberlist-debian/blob/master/security.go#L109 where it makes a random nonce for each message and along it being a param of Seal, it is packed in the message in the clear, so the receiver can use it in the decryption.