Generate a 128 (104) bit WEP key
Looking for WPA? WPA PSK Key Generator - http://www.badtech.org/tools/wpa/
NOTE: WEP is deprecated and insecure. This tool is here for legacy use or for those interested in how WEP keys are made from ASCII strings. Please use WPA or WPA2 to secure your wireless networks. Also, please download and run the source. Do not transmit any important passwords over plaintext on the internet.
This form is AJAX enabled, so using the submit button is not necessary unless you aren't using JavaScript.
wepkey.php - PHP shell script to generate a 128 bit WEP key.
#!/usr/bin/php -q
<?php
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// This program is a shell script that generates a 104 (128) bit WEP key from an ASCII string
$phrase = @$_SERVER[argv][1];
if (!$phrase) {
echo "Usage:\n" . $_SERVER['PHP_SELF'] . " <passphrase>\n\n";
exit;
}
$length = 64;
// If phrase is too long, trim to 64 characters
$phrase = substr($phrase,0,64);
// Repeat the string as many times as necessary and then trim to 64
$phrase = substr(str_repeat($phrase, ($length / strlen($phrase))), 0, 64);
echo "Pass phrase: ". $_SERVER[argv][1] . "\n";
// Use the first 26 digits of the MD5 sum
echo "104 (128) bit WEP Key: " . substr(md5($phrase), 0, 26) . "\n";
?>
wepkey.php - Downloadable source file.
Adam Field - adam AT badtech DOT org






