how to retrieve password in django

后端 未结 5 1146
灰色年华
灰色年华 2020-12-15 18:16

How do we retrieve a password of an user?

u = User.objects.get(username__exact=username)
print u.password

displays sha1$f0971$441cac8

5条回答
  •  悲哀的现实
    2020-12-15 19:09

    No, the field contains the salted hash of the password. from the string we know it's SHA1 function. If you have the password, you will be able to produce the same hash value which acts as the footprint. For security reason there should be now way to recover the password in a economical means (you can still brute force, but will take long time).,

提交回复
热议问题