Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bed's avatar
Level 1

bcrypt hashing in laravel and python

I am restoring the users data into laravel application using pandas, There is plain password in users data which i want to encrypt while moving into laravel application's database. But python bcrypt and laravel bcrypt shows different hases and couldnot logged into laravel app with the pain password.

hash password from python secret $2b$12$isR80WmkdB8X2/SyZxWgXeijqReV59oOo1HrRj9qNN5wf6h5UU35i

hash password from laravel for secret $2y$10$tiAlohuSQmzgBFRQCKkNn.gLxedsxYfKioSWTM4iFCFkv3RB3/EKW

0 likes
1 reply
PatrickSJ's avatar

The hashes will vary because a random salt was created. If you hashed secret twice in laravel or twice in python each would generate a different hash within itself.

However, to figure out why you can't sign-in, could you post the code you are using to authenticate? Is it the default provided by Laravel with make:auth?

1 like

Please or to participate in this conversation.