You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the probability can be astronomically low given a large enough nonce, the probability that a nonce will be reused still exists when it is random. Reusing a nonce under ciphers like ChaCha20-Poly1305 or AES-GCM effectively means revealing the encryption secret to an attacker that can observe both of the messages encrypted with the same nonce.
It's for that reason that protocols like TLS use sequential nonces and require implementations to change secrets when the sequence is about to overflow. The point is to guarantee that a reused nonce will never be observed.
Due to the nature of this library and lack of control over how and how many objects get serialized-and-encrypted, nor how they are transported or stored, it effectively means that this library is currently not secure.
I wanted to raise this issue to raise awareness - but do not see an easy fix given the current API, considering maintaining a sequence requires maintaining additional state on a per-key basis and defeats the convenience-centric aim of this library.
The text was updated successfully, but these errors were encountered:
Via
serde-encrypt/src/traits/serde_encrypt_public_key.rs
Line 60 in 9ba98fa
While the probability can be astronomically low given a large enough nonce, the probability that a nonce will be reused still exists when it is random. Reusing a nonce under ciphers like ChaCha20-Poly1305 or AES-GCM effectively means revealing the encryption secret to an attacker that can observe both of the messages encrypted with the same nonce.
It's for that reason that protocols like TLS use sequential nonces and require implementations to change secrets when the sequence is about to overflow. The point is to guarantee that a reused nonce will never be observed.
Due to the nature of this library and lack of control over how and how many objects get serialized-and-encrypted, nor how they are transported or stored, it effectively means that this library is currently not secure.
I wanted to raise this issue to raise awareness - but do not see an easy fix given the current API, considering maintaining a sequence requires maintaining additional state on a per-key basis and defeats the convenience-centric aim of this library.
The text was updated successfully, but these errors were encountered: