|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68518 Error: 1-charater in salt on crypt()
Submitted: 2014-11-27 17:34 UTC Modified: 2014-11-27 23:01 UTC
From: r at inbox dot ru Assigned:
Status: Not a bug Package: *Encryption and hash functions
PHP Version: 5.6.3 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: r at inbox dot ru
New email:
PHP Version: OS:


 [2014-11-27 17:34 UTC] r at inbox dot ru
From manual page:

Today i moved one script on server with php 5.6.3

Why crypt() on 5.6.3 does not working with 1-character salt ? But, on 5.4.22 all working.

Test script:
echo crypt("iz289q","i");

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-27 23:01 UTC]
-Status: Open +Status: Not a bug
 [2014-11-27 23:01 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

A one-character salt is not supported. crypt() should not have allowed it in the past and now it properly returns failure (with "a string that is shorter than 13 characters and is guaranteed to differ from the salt").
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Aug 12 10:01:25 2020 UTC