perlin-network / noise

A decentralized P2P networking stack written in Go.
https://godoc.org/github.com/perlin-network/noise
MIT License
1.79k stars 211 forks source link

Fix Repeating Nonces #292

Open NHAS opened 3 years ago

NHAS commented 3 years ago

An extension to #291, and (hopefully) full solution to #289

This change the random data generation to a cryptographically secure source and implements a repetition resistant nonce generation algorithm, which handles some edge cases where nonce reuse might occur.

This needs a bit of a look over to make sure its both backwards compatible and not missing anything.