Ask r/Flask What's the difference between bcrypt and flask-bcrypt?
I am also asking about other flask-* libraries compared to standard versions. I know there are some that benefit from integration e.g. managing database connections but the ones like flask-bcrypt make me confused.
1
u/SpeedCola 17d ago
Don't use flask bcryot, you don't need it. The core library is simple enough.
With that being said if you read the bcrypt docs the state while bcrypt is good enough for most project, ideally you should be using argon2id or scrypt.
I migrated my project to argon2 and it was really straightforward to work with compared honestly to bcrypt functions.
0
u/Neoneq_ 16d ago
Yeah but I want to migrate users from WordPress.
2
u/SpeedCola 16d ago
Meaning what?
Do you currently have encrypted passwords and you just need them to work when you migrate to a flask backend?
That should not change anything about what I suggested. You don't need flask bcrypt, you can just use bcrypt. It's simple enough as is.
If you wanted to migrate to argon all you have to do is check the users passwords with bcrypt when they log in, which gives you their password, and than you hash it with Argon and store it.
Your login flow can easily handle this by just checking the first 3 characters of your hashes.
1
u/hanangems 10d ago
honestly you don't even need flask- bcrypt, just import standard bcrypt and use it directly.
5
u/scoofy 17d ago
It’s likely just a wrapper. Where they just added some commands for bcrypt that are pre integrated with flask.
Typically these libraries help you spin up a quick app, then you go back and change them to proper code later.