note 42783 added to function.crypt

From: Date: Sat, 29 May 2004 01:16:19 +0000
Subject: note 42783 added to function.crypt
Groups: php.notes 
Request: Send a blank email to php-notes+get-70264@lists.php.net to get a copy of this message
An odd thing has been happening when I'm testing an encrypted file password against a submitted password--after encrypting the submitted password using the file password (or the piece of it from 0 to CRYPT_SALT_LENGTH), the encrypted submitted password has some extra characters at the end. I haven't actually fixed it yet (I'm not sure why it's happening), but if it happens to you, the workaround is simple. Instead of <?php $testpass=crypt($submitted_pass, $file_pass) ?> use: <?php $testpass=substr(crypt($submitted_pass, $file_pass), 0, 20) ?> (Or whatever the length of the file password is.) ---- Manual Page -- http://www.php.net/manual/en/function.crypt.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42783 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42783&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42783&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#70264) next »