php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12745 problem with the randomic generation of salt when a use crypt("pass")
Submitted: 2001-08-14 19:40 UTC Modified: 2001-08-18 21:54 UTC
From: marcus at marcusvinicius dot f2s dot com Assigned:
Status: Not a bug Package: *Encryption and hash functions
PHP Version: 4.0.6 OS: Linux Slackware 7.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marcus at marcusvinicius dot f2s dot com
New email:
PHP Version: OS:

 

 [2001-08-14 19:40 UTC] marcus at marcusvinicius dot f2s dot com
problem with the randomic generation of salt when a use $string = crypt("11lei11lao11") it allways generates a salt ( the first 2 chars from encrypted string ) that if use crypt("11lei11lao11blablabla") would work, and also crypt("11lei11lao11anythingwouldworkhere").

the code is

$cryptedpass = crypt("11lei11lao11");
if (crypt ( "11lei11lao11anythingwouldworkhere", substr ( $cryptedpass, 0, 2)) == $cryptedpass) {    
  echo "this is extremely strange for me";
}

and this works with this pass but not whit others!!!!!!!!!!!!!!!!!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-15 03:25 UTC] sniper@php.net
So what is the 'bug' here??

--Jani

 [2001-08-18 21:54 UTC] sniper@php.net
No feedback and this is not a bug.
This is how DES encryption works.

--Jani

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 16:01:30 2025 UTC