Re: MD5 Passwords?
| From: | H. Wade Minter | Date: | Wed, 20 Dec 2000 18:39:14 +0000 |
| Subject: | Re: MD5 Passwords? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31282@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
A while back someone posted this function that returns an MD5-encrypted
password. There may be a better way to do it:
function MakeEncPw($strPW)
{
// Returns an MD5 encrypted password
// First we need 8 random charaters to fit between $1$...$
$strMidMd5 = substr(crypt($strPW),0,8);
// Create the MD5 hash
$strMd5 = "$1$".$strMidMd5."$";
// Now create the encrypted password
return (crypt($strPW,$strMd5));
}
On Wed, 20 Dec 2000, Devin Atencio wrote:
>
> I run FreeBSD which uses MD5 passwords and I was wondering how I could have
> my php4
> script create an MD5 password that the FreeBSD system would accept. I notice
> all my
> MD5 passwords in the password file start with $1$ but when I tried like
> md5($password) it comes out very random and never starts with $1$. Does
> anyone know
> how I can do this?
>
> /'^'\
> ( o o )
> ------------------------------------------oOOO--(_)--OOOo----
> Devin Atencio
> ArosNet Systems Administration .oooO
> EMail: dreamboy@aros.net ( ) Oooo.
> --------------------------------------------\ (----( )-----
> \_) ) /
> (_/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
- --
H. Wade Minter | NeTraverse, Inc.
System Administrator | minter@netraverse.com
"Whatever it is that you're not doing, go don't do it somewhere else."
--Sheriff, "Manos: Hands of Fate"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE6QPzVX5y4ZKLK2pMRAmeyAJ9WICCFqJ7NTbAkMUCaGsPIUweAXgCeNvQA
LUkqTS8eUdC2mUczjjPSPLo=
=lp3Y
-----END PGP SIGNATURE-----