Jump to content

Prestashop 1.7 Customer Password Encryption?


Anıl Türk
 Share

Recommended Posts

I made some third party system based with php for Prestashop 1.6. It works with connecting directly the Prestashop Database. And know Im upgraded my Presta to 1.7.5.1 and IT WORKS. Only It dont log in customers anymore because as I can see Password encryption is changed. I was using md5(COOKIE_KEY.'password') for 1.6, but I see the passwords on 1.7 nothing like md5. Could you tell me how encryption is. (it become much better if you tell me with php code)

Prestashop 1.7.5.1

$2y$10$6b460aRLklgWblz75NAMteYXLJwjfV6a/uN8GJKgJgPDBuNhHs.ym

for 123456

Share this post


Link to post
Share on other sites

  • 10 months later...

Hello,
I'm also loocking how to check the filled in password with the password in the database for cutomer login. I'm using prestashop 1.7.6 and creating a app so customers can login.
Anybody a idea what to combine and how to encrypt it? Already tried to combine the cookie_key with the password in MD5 and bCrypt with salt versions..

Thanks!

Share this post


Link to post
Share on other sites

  • 1 year later...
On 3/7/2020 at 12:44 AM, fbenoist.com said:

Hi,

Encryption is defined in src/Core/Crypto/Hashing.php

Example of use :

use PrestaShop\PrestaShop\Core\Crypto\Hashing;
...

$crypto = new Hashing();
$encryptedPassword = $crypto->hash($textPasswd);

 

Thanks for solution @fbenoist.com

I try this but I get return "false"
 

use PrestaShop\PrestaShop\Core\Crypto\Hashing;

....

$crypto = new Hashing();
$passwd_hash = $crypto->hash($passwd);
$customer_auth = Customer::checkPassword($customer_data['id_customer'], $passwd_hash);      // using checkPassword  method of customer class
dump($customer_auth);     //return always "false"



I also tried 2nd option:

 

use PrestaShop\PrestaShop\Adapter\ServiceLocator;

....

$crypto = ServiceLocator::get('\\PrestaShop\\PrestaShop\\Core\\Crypto\\Hashing');
$passwd_hash = $crypto->hash($passwd);
dump($customer_auth);     //its also always returns "false"  

I am using Prestashop 1.7.6.7

I  am trying to create user Login custom module for login API, please let me know where I am wrong in my code.
Thanks in Advance :)
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More