|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-30 14:18 UTC] pajoye@php.net
[2009-11-30 14:29 UTC] jani@php.net
[2009-11-30 14:31 UTC] jani@php.net
[2009-11-30 14:33 UTC] pajoye@php.net
[2009-11-30 14:42 UTC] hanno at hboeck dot de
[2009-11-30 14:45 UTC] pajoye@php.net
[2009-12-09 00:20 UTC] svn@php.net
[2009-12-09 00:48 UTC] pajoye@php.net
[2009-12-09 01:43 UTC] svn@php.net
[2009-12-09 10:39 UTC] svn@php.net
[2009-12-09 10:39 UTC] svn@php.net
[2009-12-09 17:40 UTC] svn@php.net
[2009-12-10 14:08 UTC] svn@php.net
[2009-12-11 15:57 UTC] svn@php.net
[2009-12-11 16:07 UTC] svn@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 17:00:01 2025 UTC |
Description: ------------ PHP has the crypt()-function which can create salted-hashes (e.g. usable for shadow-passwords). Although it's not documented, in PHP 5.2 it was possible to pass the prefix for sha512 like in the corresponding glibc-function. Example: echo crypt('foo','$6$$bar$'); gives $6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu. Now the same code in PHP 5.3.1 gives $6A86JNndVTdM (which is basically just crypt ignoring the $6-prefix for the salt) I assume may have something to do with (cited from crypt-documentation): "Note: As of PHP 5.3.0, PHP contains its own implementation and will use that if the system lacks of support for one or more of the algorithms. " Reproduce code: --------------- echo crypt('foo','$6$$bar$'); Expected result: ---------------- $6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu. Actual result: -------------- $6A86JNndVTdM