0

I want to store a password using python and then re-use it . I want to store a password using python and then re-use it . How can I do this in a secured way ?

Bellerofont
  • 1,081
  • 18
  • 17
  • 16
Bacem Tayeb
  • 45
  • 3
  • 8

1 Answers1

0

Searching around I found this: PassLib. You can pip install it

pip install passlib

And then use it. This is from the example in their link.

>>> # import the hash algorithm
>>> from passlib.hash import pbkdf2_sha256

>>> # generate new salt, and hash a password
>>> hash = pbkdf2_sha256.hash("toomanysecrets")
>>> hash
'$pbkdf2-sha256$29000$N2YMIWQsBWBMae09x1jrPQ$1t8iyB2A.WF/Z5JZv.lfCIhXXN33N23OSgQYThBYRfk'

>>> # verifying the password
>>> pbkdf2_sha256.verify("toomanysecrets", hash)
True
>>> pbkdf2_sha256.verify("joshua", hash)
False
Pablo Reyes
  • 3,073
  • 1
  • 20
  • 30