|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
8 + 9 = ?
Subscribe to this entry?

 [2013-02-21 18:19 UTC] sarciszewski at knights dot ucf dot edu
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:


Add a Patch

Pull Requests

Add a Pull Request


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]
-Status: Closed +Status: Not a bug
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Mar 28 19:01:27 2020 UTC