Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Password hasing in CakePHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 301
    Comment on it

    CakePHP uses a Security class for hashing the passwords. I am writing some examples below that will definitely help you out in understanding the different ways of password hashing in CakePHP:

    echo "I am md5 CAKE:".Security::hash("dinesh","md5");
    echo "I am SHA1CAKE:".Security::hash("dinesh");
    echo "<br/>I am core:".md5("dinesh");
    echo "<br/>I am core sha1:".sha1("dinesh");
    exit;
    

    For using the Security class you are not even required to change the salt value in app/config/core.php file. Right now my salt value is:

    Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi&#95;1');
    

    You are not needed to make it blank or comment the security.salt value.

    Configure::write('Security.salt', ''). 
    

    It will work perfectly.

    I am md5 CAKE:9c9f1c65b1dc1f79498c9f09eb610e1a;
    I am SHA1CAKE:d02f9eeeab3c10406e510f722877f8c6233e53cf
    I am core:9c9f1c65b1dc1f79498c9f09eb610e1a
    I am core sha1:d02f9eeeab3c10406e510f722877f8c6233e53cf
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: