Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent of java BCryptPasswordEncoder() in python cli?

I have a spring boot web application without registration page or allowing users to register. I'm manually creating passwords using another web spring application which ones gives me encoded password on request. Using the below link to generate the encoded password: http://www.baeldung.com/spring-security-registration-password-encoding-bcrypt

But i was researching to find an alternate simple python equivalent,so i can use it on the cli easily.?

like image 894
MohanBabu Avatar asked Oct 15 '25 22:10

MohanBabu


1 Answers

I was facing the same problem, but the following worked for me:

bcrypt.gensalt(rounds = 10, prefix=b"2a")

This seems to be in sync with the bean BCryptPasswordEncoder in SpringBoot :)

like image 171
mavefreak Avatar answered Oct 18 '25 11:10

mavefreak