I was trying to decrypt a text encrypted with AES and ECB mode.
I did try several keys and IV. I solved it by ignoring IV. (The IV was given, but it was maybe a distraction)
My question is in which cases IV is needed and in which is not?
I was trying to decrypt a text encrypted with AES and ECB mode.
I did try several keys and IV. I solved it by ignoring IV. (The IV was given, but it was maybe a distraction)
My question is in which cases IV is needed and in which is not?
A quick list from Wikipedia;
In short, all secure modes need an IV. To achieve semantical security the Probabilistic encryption is required.
There is a mode of AES that can survive without an IV under certain assumptions.
https://en.wikipedia.org/wiki/Disk_encryption_theory#XTS
In particular, the XEX form of AES is designed to function in the absence of a working IV and in particular survives IV reuse. There's one downside in that if you do something like write enough data to the same block and an attacker can see all of the states the security collapses, but it's good it what it's designed for.
Looking for encryption algorithm not subject to known-plaintext attack with IV reuse
There are modes that are "deterministic", in the sense that each invocation of encryption does neither depend on a random number generator for a random IV, nor depend on a state being kept for a nonce.
NIST SP 800-38F Key-wrapping mode is one such example, AES-GCM-SIV is another.
An earlier question has attracted some useful answers that may be helpful to readers of this question.