WepPassphrase

WepPassphrase is…

The reason, why I wrote WepPassphrase is that iwconfig eth1 key s:passphrase doesn’t work for me. It only takes the ASCII values of chracters of the passphrase and uses them as WEP key. Windows or my router for example, are using a conventional algorithm to create WEP passphrases. Unfortunately I haven’t found a corresponding tool in the Gentoo portage and a short internet inquiry wasn’t successful. Therefore I decided to write a small tool based on the source of WepAttack, because it must create WEP keys to perform a dictionary based attack.

Application

The invocation is quite simple: WepPassphrase PASSPHRASE

WepPassphrase abc
EFEF-EEDA-E197-ED61-4B58-2E14-90

There are two options to suppress the trailing newline and to suppress the separating ‘-‘:

WepPassphrase -h 
Create 104bit WEP-Key from a passphrase 
 
usage: WepPassphrase [-n] [-s] passphrase 
or:    WepPassphrase -h 
 
-n    Don't put newline at end 
-s    Don't print separating '-' 
-h    Print this help 

Code of WepPassphrase

As I wrote above, WepPassphrase reuses code from WepAttack. A 64 byte buffer is filled by successively copying the passphrase into it. Then the MD5-hash of the buffer is computed and the first 13 characters form our 26byte (104bit) WEP-key.

Installation

Simply get the WepPassphrase.tar.bz2, extract the directory and install it. The binary is copied into /usr/bin/, so root privileges should be necessary.

cd workingdirectory 
wget http://www.sthu.org/code/files/WepPassphrase.tar.bz2 
tar -xvjf WepPassphrase.tar.bz2 
cd WepPassphrase 
make install