note 44035 added to function.md5
| From: | EricP at rn2 dot php dot net | Date: | Tue, 13 Jul 2004 10:39:46 +0000 |
| Subject: | note 44035 added to function.md5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73142@lists.php.net to get a copy of this message | ||
You can use the MD5 function to calculate WEP keys from passphrases.
<?php
function passToKey($passphrase) {
return substr(md5(substr(str_repeat($passphrase,64),0,64)),0,26);
}
print "WEP key: ".passToKey("password"); // will print 'WEP key:
2b204a3f1042643e480fdd655e'
?>
----
Manual Page -- http://www.php.net/manual/en/function.md5.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44035
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44035&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44035&report=yes
Search -- http://master.php.net/manage/user-notes.php