Practical-Cryptography-for-Developers-Book icon indicating copy to clipboard operation
Practical-Cryptography-for-Developers-Book copied to clipboard

Wording: "aesIV" vs. "nonce"

Open daniel-kun opened this issue 3 years ago • 0 comments

Hello Svetlin!

First of all, thank you for your great work. I'm using it extensively on my current deep-dive journey into cryptography.

In the python examples for AES GCM encryption/decryption, in the print() of the encrypted message, you call the "nonce" an "IV", which are different things that have different attributes. So if I don't get it wrong, "aesIV" should be renamed to "aesNonce" in this code sample:

https://github.com/nakov/Practical-Cryptography-for-Developers-Book/blob/a05a5176a5db86885d6119832b73bea93aee45c5/symmetric-key-ciphers/aes-encrypt-decrypt-examples.md?plain=1#L153

From what I've learned so far, when talking about an IV it is important that it is random - and, at least in many scenarios, it should be used only once per key, too - while when talking about a nonce the randomness is not the important part, but it is important that it is never, ever re-used.

Source (for example): https://crypto.stackexchange.com/questions/16000/difference-between-a-nonce-and-iv

Greetings from Germany, and stay motivated and healthy! Daniel Albuschat

daniel-kun avatar Jan 16 '22 10:01 daniel-kun