Edit report at https://bugs.php.net/bug.php?id=49954&edit=1
ID: 49954 Updated by: paj...@php.net Reported by: rgr at woodwing dot com Summary: Crypt() does not work for string < 4 character Status: Closed Type: Bug Package: *Encryption and hash functions Operating System: win32 only - Win XP 64-bit PHP Version: 5.3.0 Assigned To: pajoye Block user comment: N Private report: N New Comment: download it, unzip it anywhere you, open a cmd line, run: php.exe -n yourscript.php Easy, simple :) Previous Comments: ------------------------------------------------------------------------ [2011-09-13 12:17:20] c dot clix at tiscali dot it Hi, right now I cannot test it with PHP 5.3.8 Here is my test. Source code: <?php phpinfo(INFO_GENERAL); $user_input = 'tes'; $password = crypt($user_input); if (crypt($user_input, $password) == $password) { echo "Password verified!"; } else { echo "Password NOT verified!"; } echo "<br>"; $user_input = 'test'; $password = crypt($user_input); if (crypt($user_input, $password) == $password) { echo "Password verified!"; } else { echo "Password NOT verified!"; } ?> Here is the output (I've extracted the main information with copy&paste): PHP Version 5.3.6 System Windows NT T11972946 5.2 build 3790 (Windows Server 2003 Enterprise Edition Service Pack 2) i586 Build Date Mar 17 2011 10:46:06 Compiler MSVC9 (Visual C++ 2008) Architecture x86 Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet" "--with-mcrypt=static" Server API CGI/FastCGI Virtual Directory Support disabled Configuration File (php.ini) Path C:\WINDOWS Loaded Configuration File C:\Program Files\PHP\php.ini Scan this dir for additional .ini files (none) Additional .ini files parsed (none) PHP API 20090626 PHP Extension 20090626 Zend Extension 220090626 Zend Extension Build API220090626,NTS,VC9 PHP Extension Build API20090626,NTS,VC9 Debug Build no Thread Safety disabled Zend Memory Manager enabled Zend Multibyte Support disabled IPv6 Support enabled Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar Registered Stream Socket Transports tcp, udp, ssl, sslv3, sslv2, tls Registered Stream Filters convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*, bzip2.* Password NOT verified! Password verified! ------------------------------------------------------------------------ [2011-09-13 10:27:42] paj...@php.net And please try with 5.3.8, not any other version. ------------------------------------------------------------------------ [2011-09-13 10:19:37] rgr at woodwing dot com Hello c.clix, We tested this issue on 'win 2003 32bit' with PHP 5.3.6 and we cannot reproduce this issue anymore. Could you please elaborate and provide more details how you can still reproduce this issue on Win 32bit with PHP 5.3.6? ------------------------------------------------------------------------ [2011-09-10 21:31:59] c dot clix at tiscali dot it PHP 5.3.6 on WIN 32bit: The BUG is still unsolved. ------------------------------------------------------------------------ [2009-11-03 08:02:09] rgr at woodwing dot com Hello Pajoye, thank you for your response. I have tried the 5.3.2-dev build from snapshot and this issue is indeed fixed there. Good to know this is fixed in a later version. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=49954 -- Edit this bug report at https://bugs.php.net/bug.php?id=49954&edit=1