PHP :: Bug #68518 :: Error: 1-charater in salt on crypt()
php.net |  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
Description:
------------
---
From manual page: http://www.php.net/function.crypt
---

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:
----------------
i$hos7IDHFpPk

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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-2018 The PHP Group
All rights reserved.
Last updated: Thu Aug 16 19:01:24 2018 UTC