How to do you decide that a particular key is a weak key? In the case of WEP, the weak keys seem to be those whose initialization vectors are in the form of (B + 3,255,x).

Does the condition for weak keys depend on the type of encryption function we use? For example in WEP we are XORing the plaintext and the key sequence to get the ciphertext.

  • It's a key stream not a key sequence. A key stream is calculated using the key, the IV and the stream cipher. It is determined by those three elements, it doesn't contain the key or the IV. – Maarten Bodewes May 17 '16 at 23:34

Q: How to do you decide that a particular key is a weak key?

That depends on the cipher (the algorithm itself). According to Wikipedia:

In cryptography, a weak key is a key, which, used with a specific cipher, makes the cipher behave in some undesirable way.

Q: I got some things like in case of WEP , the weak keys are those whose initialization vectors are in the form of ( B + 3,255,x).

WEP uses RC4 which, again according to Wikipedia:

Unlike a modern stream cipher (such as those in eSTREAM), RC4 does not take a separate nonce alongside the key. This means that if a single long-term key is to be used to securely encrypt multiple streams, the protocol must specify how to combine the nonce and the long-term key to generate the stream key for RC4.

So, unlike most ciphers, the weak keys include the IV. Unfortunately the key schedule of RC4 is weak, the IV of WEP too short and the construction of combining (concatenating) the key and IV too simplistic, leading to an attack.

Q:and does the condition for weak keys depend on the type of encryption function we use . ex - in wep , finally we are XORing the plaintext and the key sequence to get the ciphertext

Again, it depends on the cipher.

What you describe above is the general construction that a stream cipher uses to encrypt data. There are stream ciphers that have weak keys or are otherwise vulnerable. But there are certainly stream ciphers that do not have weak keys and are considered secure.

The XOR of the key stream with the plaintext is not the issue here.

Other (block) ciphers with weak keys are IDEA, Blowfish. DES is probably the best known cipher with weak keys though:

Since all the subkeys are identical, and DES is a Feistel network, the encryption function is self-inverting; that is, despite encrypting once giving a secure-looking cipher text, encrypting twice produces the original plaintext.

This means that if an attacker was to send back you the ciphertext as plaintext for you to encrypt (i.e. using you as an encryption oracle) that the attacker would retrieve the plaintext in the special case that weak keys were used.

Needless to say, modern ciphers try to avoid weak keys; each key should be as secure as any other key.


There are different methods and standards, but here are the "common human-readable guidelines" :

  • The algorithm. If it is weak - a 1Mbit long key is a weak key, i.e. it can't protect the data properly
  • The key size. If the algorithm is strong(=it is a way too laborious to brute-force it or repeat it), the key size comes into a play: for example, AES is a strong algo, but it is about rounds, so AES-32 or AES-64 are weak ones : they can be bruted or just pre-calculated for a dictionary tab and broken almost instantly nowadays. But AES-256 is a strong one. The algo is exactly the same in all three cases, but the length decides : 256bit is OK, 32 or 64 bit are weak
  • The key distribution problem. It's a philosopher stone of the security : the strongest algo + 1024bit key are weak if the key can be wiretapped/stolen/obtained-by-a-third-party easily

After this "quick" evaluation if you need a further/deeper classification - you must select a standard(s) to dig deeper and to check a compliance to.

  • Exactly ,what do u mean by selecting a standard in the last line ? – Pankaj Kumar May 17 '16 at 17:41
  • @PankajKumar I mean that after a quick-check by the common criterias you may possibly want to check the crypto/keys for compliance with some standard – Alexey Vesnin May 17 '16 at 23:07
  • You've described a lot of ways in which a key can be secure or not. But funny enough you fail to explain the concept of a weak key with regards to the cipher (algorithm). – Maarten Bodewes May 17 '16 at 23:16
  • @MaartenBodewes as far as I see the question asker's skill/knowledge level is not so high, so I tried my best to explain it all on the acceptable level. Of course, I can start exploding in special terms and very strict definitions - but I think that he came here not to be brain-exploded. Yes, a rough approximation I've made here is VERY rough, but I hope it's understandable for the person who asked the question. – Alexey Vesnin May 17 '16 at 23:25
  • Of course you should always try and explain things at the right level. But if you forget to describe weak keys because of that, then what's the point? – Maarten Bodewes May 17 '16 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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