Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

Example:

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?

share|improve this question
First, a WEP key isn't generated using MD5 hashing, it uses RC4. Second, the reason you can generate multiple is because a WEP key is usually an IV (initialization vector (usually the current time or a random number) and your key: (IV + Key) -> RC4 = WEP key – h3rrmiller May 8 at 17:53
1  
also this is a dupe (stackoverflow.com/questions/16446910/…) – h3rrmiller May 8 at 17:55
Cross post here: askubuntu.com/questions/292656/…, here: stackoverflow.com/questions/16446910/…, and here. – Sukminder May 8 at 18:27
@h3rrmiller. you can generate a WEP key from passphrase using MD5 hashing please see page 23 of this document – MOHAMED May 9 at 16:41
@h3rrmiller RC4 is used in the WEP encryption and not in the WEP key generation – MOHAMED May 9 at 16:42
show 1 more comment

1 Answer

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

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

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

share|improve this answer
are there a standard way to generate the 4 WEP keys – MOHAMED May 9 at 10:25
the standard way is (IV + key) -> RC4 = WEP key – h3rrmiller May 9 at 13:55
could you point me to the standard. looking for link to the standard document – MOHAMED May 9 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 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 at 16:35
show 3 more comments

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.