Gourav bagora
Gourav bagora

Reputation: 73

Which encryption method does Prestashop use for the password field and how does it do it?

Which encryption method does Prestashop use for the password field and how does it do it? I want to encrypt the password field using the same technique as Prestashop. Currently I am using this one:

$pass=md5($password);

Upvotes: 2

Views: 14794

Answers (3)

Diego Baulde
Diego Baulde

Reputation: 15

After doing what Vividus says, you have to execute this query in phpmyadmin:

    UPDATE ps_employee SET passwd=md5("COOKIE_KEY+Your_new_pass") 
WHERE email="email_user

The "plus" sign does not go inside the quotes, it's all together COOKIE_KEY and your new password.

Upvotes: 1

Vivek Tailor
Vivek Tailor

Reputation: 226

In 1.6 _COOKIE_KEY_ is defined in /config/settings.inc.php

In 1.7 it is generated from this file /config/bootstrap.php but stored here /app/config/parameters.php

If you are trying to insert directly in database than select md5 first than paste _COOKIE_KEY_ and type password.

Upvotes: 6

TheDrot
TheDrot

Reputation: 4337

From Tools.php

line 1180 (version 1.6.1.x)

public static function encrypt($passwd)
{
    return md5(_COOKIE_KEY_.$passwd);
}

line 1069 (version 1.7)

public static function hash($passwd)
{
    return md5(_COOKIE_KEY_.$passwd);
}

In 1.6 _COOKIE_KEY_ is defined in /config/settings.inc.php

In 1.7 it's defined in /config/bootstrap.php

Upvotes: 14

Related Questions