This is a discussion on crypt function why do strings match within the PHP General forums, part of the PHP Programming Forums category; Below is a test piece of code I am using to test some crypt values. As you can see I ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Below is a test piece of code I am using to test some crypt values. As
you can see I have hard-coded a crypt string ($SetString) and then have another input field to input a string ($TypeString). What I find odd is if I type the string "mypasswordd" (two d's on the end) the variable $TypeString matches the variable $SetString? Even when I try "mypassword--d" or something crazy, no matter what it matches, I can type whatever past the last "d" and the crypted string matches $SetString. I am curious why? <? if(isset($PassToCrypt)) { $salt = "copymachine"; //crypt current $SetString = crypt("mypassword", $salt); $TypeString = crypt($password, $salt); echo "Inputted String: $TypeString<br>Set String: $SetString"; } echo "<form name=\"passwords\" action=\"$PHP_SELF\" method=\"POST\"> <input type=\"hidden\" name=\"PassToCrypt\" value=\"1\"> <input type=\"text\" name=\"password\"> <input type=\"submit\" name=\"submit\" value=\"submit\"> </form>"; ?> |