php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64268 crypt() outputting *0 for unknown reason
Submitted: 2013-02-21 18:19 UTC Modified: 2013-02-21 19:20 UTC
From: sarciszewski at knights dot ucf dot edu Assigned:
Status: Not a bug Package: *Encryption and hash functions
PHP Version: 5.4.11 OS: Ubuntu 12.04 kernel 3.2.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sarciszewski at knights dot ucf dot edu
New email:
PHP Version: OS:

 

 [2013-02-21 18:19 UTC] sarciszewski at knights dot ucf dot edu
Description:
------------
crypt() seems to be breaking for some reason with this password and salt combination

I've not read anything about limitations on the characters supplied to crypt() in the PHP documentation

Test script:
---------------
<?
$plain = "W9no`y_vr.!b<W'.Wp44NU~\"Vf}n{G077<^UnqFyWwKyaz1YuyrO9H+1/T8J3Ha_C|X=gU^?EBrc2";
$salt = '$2a$10$CqenGirJlEl6sCA2/w2ay';

echo crypt($pre, $salt);
?>

Expected result:
----------------
$2a$10$CqenGirJlEl6sCA2/w2a (followed by hashed data)

Actual result:
--------------
*0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-21 18:30 UTC] sarciszewski at knights dot ucf dot edu
-Status: Open +Status: Closed
 [2013-02-21 18:30 UTC] sarciszewski at knights dot ucf dot edu
After all that concern of an unknown buffer overflow or disallowed character, I forgot to end the salt with a $ character :(
 [2013-02-21 19:20 UTC] rasmus@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC