|  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
 [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 Jun 03 20:01:26 2020 UTC