I am currently working on a PHP Project where i need to integrate user information from a CakePHP driven website.
CakePHP using the following method for password encryption:
Security::hash($user['User']['password'],null,true);
I know, CakePHP By default use the SHA1 encryption method.
i have tried to encrypt a password using SHA1 by using PHP but i come to know that is not matching with cakePHP encryption.
<?php
$str = 'apple';
if (sha1($str) === 'd0be2dc421be4fcd0172e5afceea3970e2f3d940') {
echo "login info found?";
}
else{
echo "No info found";
}
?>
if any one has a solution. please help me.
Because your 3rd argument is true, CakePHP will salt the hash with the value stored in your configuration:
$string = Configure::read('Security.salt') . $string;See http://api.cakephp.org/view_source/security#line-91