I have a sagem router. this router is able to generate 4 WEP keys from a given passphrase.


Passphrase: "hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha"

key1: b583bc6804d5c1d7fc2ae46972

key2: d0494a8087e8d742e9e93cf2f5

key3: f0c5af9a3ab7e54337767db1a9

key4: 7e95d22229dacb8f09c9bbd1d7

I m wondering how it can generate 4 keys.

I can use md5sum to generate 1 key like this:

$ echo -n "hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha" | md5sum

b583bc6804d5c1d7fc2ae46972 842868

Are there a way to generate the 4 keys and not only one key with linux command?


One quick way to do it (if you dont care to take an IV + key and send it through RC4) is:

while [ $i -le 4 ]
    dd if=/dev/random bs=1 count=16 2>/dev/null | xxd -ps
    i=$(( i+1 ))

This will generate four 128-bit wep keys. Adjust count for different strengths

  • are there a standard way to generate the 4 WEP keys – MOHAMED May 9 '13 at 10:25
  • the standard way is (IV + key) -> RC4 = WEP key – h3rrmiller May 9 '13 at 13:55
  • could you point me to the standard. looking for link to the standard document – MOHAMED May 9 '13 at 16:17
  • the answer is wrong. the IV and the RC4 are used in the encryption. An IV is added to the WEP key in the encryption for more security. – MOHAMED May 9 '13 at 16:31
  • @MOHAMED This answer is not wrong. That is how WEP works... Your question is very hard to follow as it is not very clear what you are looking for. A WEP key is nothing more than a hexadecimal string of variable length. – h3rrmiller May 9 '13 at 16:35

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.