pallets-eco / flask-security

Quick and simple security for Flask applications
MIT License
1.63k stars 513 forks source link

Doesn't support md5? #844

Open lishu2006ll opened 5 years ago

lishu2006ll commented 5 years ago

I use md5_crypt ,but tell me: ValueError: Invalid password hashing scheme 'md5_crypt'. Allowed values are bcrypt, des_crypt, pbkdf2_sha256, pbkdf2_sha512, sha256_crypt, sha512_crypt and plaintext

who knows why?

jwag956 commented 5 years ago

Yes - because the default list of SECURITY_PASSWORD_SCHEMES is: "PASSWORD_SCHEMES": [ "bcrypt", "des_crypt", "pbkdf2_sha256", "pbkdf2_sha512", "sha256_crypt", "sha512_crypt",

And always last one...

    "plaintext",
],

But of course - as stated here: https://passlib.readthedocs.io/en/stable/lib/passlib.hash.md5_crypt.html

dont' t use it. If you need to still honor OLD passwords encrypted with it - then simply add it to the list of PASSWORD_SCHEMES in your config.