4

I have list user information that I am pulling from some other database tool. The information in this tool is in plain text. I am using Django for my project and I need passowrd into <algorithm>$<iterations>$<salt>$<hash> format.

Which library or script that I can use to convert my plaintext to Hashed value ?

I have read about Django Hasher but wanted to get more information about it.

1 Answers1

7

If you are gonna save the password in a user model, just call user.set_password(<plain-text password>) on the instance. Otherwise, use make_password():

from django.contrib.auth.hashers import make_password

hashed_pass = make_password(plain_text_pass)
knbk
  • 52,111
  • 9
  • 124
  • 122