Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

We've had to extend our website to communicate user credentials to a suppliers website (in the query string) using AES with a 256-bit key, however they are using a static IV when decrypting the information.

I've advised that the IV should not be static and that it is not in our standards to do that, but if they change it their end we would incur the [big] costs so we have agreed to accept this as a security risk and use the same IV (much to my extreme frustration).

What I wanted to know is, how much of a security threat is this? I need to be able to communicate this effectively to management so that they know exactly what they are agreeing to.

We are also using the same KEY throughout as well.

Thanks

share|improve this question

3 Answers 3

up vote 19 down vote accepted

It depends on the chaining mode. AES is a block cipher, it is applied on blocks of 16 bytes (exactly). The chaining mode defines how input data becomes several such blocks, and how output blocks are then put together. Most chaining modes need to work with some sort of "start value", which is not secret but should change for every message: that is the IV.

Reusing the same IV is deadly if you use the CTR chaining mode. In CTR mode, AES is used on a sequence of successive counter values (beginning with the IV), and the resulting sequence of encrypted blocks is combined (by bitwise XOR) with the data to encrypt (or decrypt). If you use the same IV then you get the same sequence, which is the infamous "two-time pad". Basically, by XORing two encrypted string together, you get the XOR of the two cleartext data. This opens to an awful lot of attacks, and basically the whole thing is broken.

Things are less dire if you use CBC. In CBC, the data itself is broken into 16-byte blocks. When a block is to be encrypted, it is first XORed with the previous encrypted block. The IV has the role of the "-1" block (the previous encrypted block for the first block). The main consequence of reusing the IV is that if two messages begin with the same sequence of bytes then the encrypted messages will also be identical for a few blocks. This leaks data and opens the possibility of some attacks.

To sum up, do not do that. Using the same IV with the same key ever and ever defeats the whole purpose of the IV, the reason why a chaining mode with IV was used in the first place.

share|improve this answer
    
This is not accurate (btw the 16 byte-block is configurable), there are cryptanalysis attacks on static IVs, even with CBC. Please see @Graham's answer. –  AviD Dec 11 '10 at 21:53
4  
@AviD: No, it is completely accurate, the only attacks with static IVs are the ones listed in this answer. And the AES blocksize is not configurable. It is 16 bytes. –  GregS Dec 12 '10 at 4:50
    
@GregS, re the block size - you are correct. I keep getting it confused with Rijndael (which is in fact a "superset" of AES). –  AviD Dec 12 '10 at 7:01
1  
Just chiming in to say that Thomas Pornin's answer (and GregS's comment) are absolutely correct. FYI, Thomas Pornin is a highly respected cryptographer and cryptanalyst. –  D.W. Jan 9 '11 at 9:46
6  
This is the right answer. If you have the ability to insert random data somewhere in the message before data starts getting sensitive, you should be golden (the random data will serve as a poor man's IV). You should use at least a block's worth of random data. For example, if you're sending an XML-formatted message, and can insert an attribute random-data="#{base_64_encode(secure_random_bytes(32))}" into the XML root element (without breaking any schemas or contracts), that should substitute. But whenever possible, you should avoid poor man's crypto. –  yfeldblum Jan 17 '11 at 16:21

I'm not a crypto guy, but my understanding is that if the IV doesn't change and the same value is re-encrypted, then the output would be the same. Therefore it would be possible to infer the content by looking for repeating values, such as a credential that gets passed with each request.

Again though, I'm not a crypto guy so I could be wrong.

share|improve this answer
    
You're not wrong. –  user185 Dec 10 '10 at 16:37
    
This was my view, I would be interested to know how insecure this makes it as well. –  Mantorok Dec 10 '10 at 16:44
    
@Graham ahh, great. Thanks! –  Steve Dec 10 '10 at 17:43

Using the same IV for all data is equivalent to not using an IV at all - the first block of ciphertext will be identical for identical plaintext. I'd be interested to hear why your supplier wants to use a constant IV, but that's beside the point. The point is that the system is susceptible in this way: if an attacker can set their own credentials and observe the ciphertext that's generated, they can compare it with other encrypted credentials to find out information about the key.

share|improve this answer
1  
+1, to emphasize using static IV (or no IV) enables "Known Plaintext Attacks", which in turn can expose some of the other data that is encrypted. Strooohooongly recommend you find some other scheme to use. –  AviD Dec 11 '10 at 21:52
    
@AviD: I got confused over whether this was known-plaintext or known-cypertext, so deleted the phrase from my answer ;) –  user185 Dec 12 '10 at 11:31
2  
The first 2 sentences of this answer are correct, but the last sentence is wrong. A static IV does not reveal information about the AES key. It does reveal information about the first block of plaintext, as you hint at. –  D.W. Jan 8 '11 at 5:08
1  
@D.W. I'm not a sufficiently expert cryptanalyst to verify that, but that means I can accept I may be wrong. If you can provide a reference demonstrating that, I'll modify the answer (or you can ;-). –  user185 Jan 8 '11 at 10:45
1  
It's a consequence of a basic fact: there is no known feasible way to find the AES keyby ciphertext-only, known-plaintext, or chosen-plaintext attack. I wouldn't know where to give you a reference for it; a good class on cryptography, maybe, or possibly a recent textbook on cryptography. Maybe this. If AES was susceptible to a chosen-plaintext attack that revealed information about the key, it would not have been chosen by NIST: that's one of the most fundamental requirements for a block cipher. –  D.W. Jan 9 '11 at 9:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.