1

I want to create an API point where the admin user can update their password, but I don't know what encrypt method used to encrypt the admin password and save it in the database, roughly what I want is like this:

$data = array(
          'user_id' => '1',
          'password' => 'magento2',
          'firstname' => 'Jane'
        );

$user = Mage::getModel('admin/user')->load($id);

if(isset($data['password')) $data['password'] = $this->encryptPassword($data['password']);
$user->addData($data);
$user->save();

2 Answers 2

1

In Magento 1.x, the admin password is saved as CONCAT(MD5('qXpassword'), ':qX'), where 'qX' is salt value for encryption and it can be any other string.

If you don't use salt concatenation, i.e. use a blank salt value, then you can simply use:

MD5('password')

to save the password of the admin user.

I hope I was clear enough to explain.

Please let me know if you have any confusion.

0

Unless it's changed recently it's MD5 See this post (found with a quick google search) What encryption model does Magento1 use?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.