note 42783 deleted from function.crypt by aidan
| From: | aidan@php.net | Date: | Mon, 05 Jul 2004 10:30:08 +0000 |
| Subject: | note 42783 deleted from function.crypt by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72600@lists.php.net to get a copy of this message | ||
Note Submitter: relsqui@armory.com
----
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.)