note 53593 deleted from function.crypt by joey

From: Date: Mon, 27 Dec 2010 12:19:48 +0000
Subject: note 53593 deleted from function.crypt by joey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-175226@lists.php.net to get a copy of this message
Note Submitter: ceo at l-i-e dot com ---- The people confused about the first 2 characters of the plain-text password being used as the salt are... confused. AFTER you crypt() your plain-text password, with 2 RANDOM characters, the RESULTING scrambled output with have the 2 randomly-selected characters as its first 2 characters. Later, to check a password presented by the user, you use the first 2 characters of the SCRAMBLED password as the salt. So you do not need to remember the salt elsewhere -- it is buried in the encrypted output. This is by design by very very very clever cryptologists, and in no way, shape, or form decreases the "security" of the algorithm. The same is true of all the encryption algorithms here -- The salt may be 27 characters long, and embedded in the middle of the crypted string, but it's still there, and that's Good. I hope this note decreases the confusion caused by the 2 early notes discussing salt.

« previous php.notes (#175226) next »