I have read something about that in the linuxquestions.org forums for programmers, and i thing maybe WEP uses a different algorithm. I tried with xxd:
Code:
$ echo my_wireless | xxd
$ 0000000: 6d79 5f77 6972 656c 6573 730a my_wireless.
which gives exactly hex output, but unfortunately not the expected result (with 64 bit encryption is 6620AF017C, and with 128 bit is 72AA25CD43364D09986BF0B5B9).
Anyway i found a temporary solution - the site
http://tv.latinsud.com/wepconv.html - that's all JavaScript and easy to use it offline. The fields "passphrase (prng) -> Hex 64" and "passphrase (md5) -> Hex 128" are the solution for passphrase to HEX for WEP conversion at least for my router. I will try to test that with some other routers.
I thing it would be very nice if someone can translate that JavaScript to C, so that this can be compiled and (maybe?) integrated in some wireless-client program like wicd.
EDIT:
Accidentally i found in the google cache for one german site a link which contains the C code and a Makefile for a program, named lwepgen which does exactly what i wanted.
Here it is:
http://dslinux.gits.kiev.ua/tags/ucl...d-ons/lwepgen/
It works just fine, at least for me.
EDIT (08.02.11):
Recently i needed the lwepgen and it seems that this is not working corect anymore - i supose because of the changed openssl libraries during the system updates. The new and best working solution is this litle script based on
openwrt wiki. This can be placed somewhere in $PATH and invoked with parameter the string that need to be converted:
Code:
#!/bin/bash
echo -n "$1 (64-bit) : "
echo -n $1 | hexdump -e '5/1 "%02x" "\n"'
echo -n "$1 (128-bit): "
echo -n $1 | hexdump -e '13/1 "%02x" "\n"'