|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-09-07 09:21 UTC] sunshine dot cst dot 07 at gmail dot com
Description: ------------ --- From manual page: http://www.php.net/intro.password --- While using "crypt($password, $salt)" function for two different strings with same $salt, it returns same encrypted text. Test script: --------------- $email = "bforbiswajit@outlook.com"; $password = "biswajit"; //use "biswajit123" and it gives same cipher $salt = "1234"; $saltedPassword = crypt($password, $salt); echo $saltedPassword; PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 23:00:01 2025 UTC |
This is a hash. Hashes are expected to have collisions. However, nice finding. Also: / Standard DES-based hash with a **two character salt** from the alphabet "./0-9A-Za-z". / / password_hash() uses a strong hash, generates a strong salt, and applies proper rounds automatically. password_hash() is a simple crypt() wrapper and compatible with existing password hashes. Use of password_hash() is encouraged. / -- <https://secure.php.net/manual/en/function.crypt.php>