implement password hashing function
This commit is contained in:
parent
b42ef06d91
commit
028fb6bf93
4
auth.py
4
auth.py
|
@ -1,6 +1,7 @@
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
|
from hashlib import sha256
|
||||||
|
|
||||||
PWDB_PATH = 'pwdb.json'
|
PWDB_PATH = 'pwdb.json'
|
||||||
|
|
||||||
|
@ -29,6 +30,9 @@ def write_pwdb(pwdb, PWDB_PATH):
|
||||||
json.dump(pwdb, pwdb_file)
|
json.dump(pwdb, pwdb_file)
|
||||||
|
|
||||||
|
|
||||||
|
def pwhash(pwd):
|
||||||
|
return sha256(pwd)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
PWDB_PATH = 'pwdb.json'
|
PWDB_PATH = 'pwdb.json'
|
||||||
pwdb = read_pwdb(PWDB_PATH)
|
pwdb = read_pwdb(PWDB_PATH)
|
||||||
|
|
Loading…
Reference in a new issue