Re: Adding encryption to passwords

From: Date: Fri, 19 Sep 2008 08:48:30 +0000
Subject: Re: Adding encryption to passwords
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-280486@lists.php.net to get a copy of this message
Thodoris wrote:
So what do you think is the best way to use crypt, mcrypt, hash or perhaps md5 and what are really the differences because I am not sure if I get it right.
    
We use md5 for that sort of thing. /Per Jessen, Zürich
I've noticed that crypt uses all the available encryption algorithms that you have. The manual gives an example to check what is available: <?php echo "<pre>"; if (CRYPT_STD_DES == 1) { echo 'Standard DES: ' . crypt('rasmuslerdorf', 'rl') . "\n"; } if (CRYPT_EXT_DES == 1) { echo 'Extended DES: ' . crypt('rasmuslerdorf', '_J9..rasm') . "\n"; } if (CRYPT_MD5 == 1) {
   echo 'MD5:          ' . crypt('rasmuslerdorf', '$1$rasmusle$') . "\n";
} if (CRYPT_BLOWFISH == 1) {
   echo 'Blowfish:     ' . crypt('rasmuslerdorf', '$2a$07$rasmuslerd...........$') . "\n";
} ?> I addition to that I know that md5 is not the strongest way to encrypt but I guess it is enough for me. -- Thodoris

« previous php.general (#280486) next »