DEV Community

Discussion on: End-to-End Encrypted Chat with the Web Crypto API

Collapse
 
shierve profile image
Sergi Canal

As Junxiao said, it is dangerous to imply that IV is not an important parameter when using GCM. When reusing the IV in GCM, if an attacker captures a few encrypted messages, since basically GCM is an xor of the plaintext and the keystream (and the keystream is the same when using the same iv), then it is trivial to implement an attack that gets the keystream and unencrypts all the captured messages. It is basically the same attack that you would use for reused keys in One Time Pad. I highly encourage you to edit that part, otherwise the article is very useful, thanks.

Collapse
 
cardoso profile image
Matheus Cardoso • Edited

Thanks a lot for the feedback! I'm changing the tutorial's approach to this.

Edit: done