Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- Bug #73058 crypt broken when salt is 'too' long --FILE-- <?php $pass = 'secret'; ..
Decoded Output download
--TEST--
Bug #73058 crypt broken when salt is 'too' long
--FILE--
<?php
$pass = 'secret';
$salt = '$2y$07$usesomesillystringforsalt$';
var_dump(crypt($pass, $salt));
$salt = '$2y$07$usesomesillystringforsaltzzzzzzzzzzzzz$';
var_dump(crypt($pass, $salt));
$salt = '$2y$07$usesomesillystringforx';
var_dump(crypt($pass, $salt));
?>
==OK==
--EXPECT--
string(60) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVO"
string(60) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVO"
string(60) "$2y$07$usesomesillystringforuw2Gm1ef7lMsvtzSK2p/14F0q1e8uOCO"
==OK==
Did this file decode correctly?
Original Code
--TEST--
Bug #73058 crypt broken when salt is 'too' long
--FILE--
<?php
$pass = 'secret';
$salt = '$2y$07$usesomesillystringforsalt$';
var_dump(crypt($pass, $salt));
$salt = '$2y$07$usesomesillystringforsaltzzzzzzzzzzzzz$';
var_dump(crypt($pass, $salt));
$salt = '$2y$07$usesomesillystringforx';
var_dump(crypt($pass, $salt));
?>
==OK==
--EXPECT--
string(60) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVO"
string(60) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVO"
string(60) "$2y$07$usesomesillystringforuw2Gm1ef7lMsvtzSK2p/14F0q1e8uOCO"
==OK==
Function Calls
crypt | 1 |
Stats
MD5 | e93425303208776219bfc7a90de9c89c |
Eval Count | 0 |
Decode Time | 89 ms |