WEP

From ArchWiki

Jump to: navigation, search

Generating passphrase from commandline

You can generate a WEP key from a passphrase but iwconfig doesn't support this option. The key is generated using md5. The following script in perl creates a key from a passphrase :

#!/usr/bin/perl
# Perl script to convert a passphrase to a WEP key.
# By Aki Mimoto
use strict;
@ARGV or die "Usage: $0 passphrase\n";
print generate_key( @ARGV ), "\n";
sub generate_key {
# --------------------------------------------------
        require Digest::MD5;
        return substr Digest::MD5::md5_hex( substr( shift() x 64, 0, 64 ) ), 0, 26;
}

It will work with a lot of access points except Apple because they don't use the same implementation.

Personal tools