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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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-2019 The PHP Group
All rights reserved.
Last updated: Sat Feb 23 23:01:26 2019 UTC