Giter VIP home page Giter VIP logo

Comments (7)

ircmaxell avatar ircmaxell commented on July 16, 2024

It will (by design) validate any crypt(3) format EXCEPT CRYPT_STD_DES (which is 13 characters). So if the passed in hash to password_verify is less than 13 characters, validation will ALWAYS fail. But if it's more than 13 characters, and it's a valid crypt() representation (using crypt-md5 for example) of that password, it will succeed.

There should be no danger feeding in an empty hash string...

from password_compat.

weirdan avatar weirdan commented on July 16, 2024

FYI native password_verify() does not reject DES hashes: https://3v4l.org/hKl4X

from password_compat.

GrahamCampbell avatar GrahamCampbell commented on July 16, 2024

It DOES ignore them though on 7.0+.

from password_compat.

weirdan avatar weirdan commented on July 16, 2024

3v4l snippet posted above shows opposite. Do you think they use patched php build that specifically enables this behavior?

from password_compat.

GrahamCampbell avatar GrahamCampbell commented on July 16, 2024

Don't know. I might be wrong though. ;)

from password_compat.

weirdan avatar weirdan commented on July 16, 2024

7.0.1 and 7.0.0 accept them:

❯ vendor/bin/phpunit test/Unit/PasswordVerifyTest.php --testdox                                                                                        password_compat/git/accept_des_hashes 
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

Runtime:    PHP 7.0.1 with Xdebug 2.4.0RC4-dev
Configuration:  /home/weirdan/src/password_compat/phpunit.xml.dist
Warning:    Deprecated configuration setting "strict" used

PasswordVerify
 [...snip...]
 [x] Des hashes are accepted
❯ vendor/bin/phpunit test/Unit/PasswordVerifyTest.php --testdox                                                                                        password_compat/git/accept_des_hashes 
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

Runtime:    PHP 7.0.0 with Xdebug 2.4.0RC4-dev
Configuration:  /home/weirdan/src/password_compat/phpunit.xml.dist
Warning:    Deprecated configuration setting "strict" used

PasswordVerify
 [...snip...]
 [x] Des hashes are accepted

from password_compat.

GrahamCampbell avatar GrahamCampbell commented on July 16, 2024

I'm wrong then. ;)

from password_compat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.