When using the magento api some times we need to find the ways on password encryption in magento. By accessing the customer data we can get the password_hash of the customer
is something like this fa23eb07d1c851f81707f4f649cb2c42:Dr
By analysing it we can see that it consist of two parts

  1. Password Hash
  2. Salt

So if we get the normal password in non encrypted form we can process it and get the values in the encrypted form

The formula to do so is $pass= md5($salt.$str).”:”.$salt;

The whole code will be

<?php

$str = "password";
$salt="Dr";
$pass= md5($salt.$str).":".$salt;
echo $pass; // the out put will be  fa23eb07d1c851f81707f4f649cb2c42:Dr 
?> 

So this post help us to know about the password encryption in magento

Leave a Reply

Your email address will not be published. Required fields are marked *