Refonte authentification en crypté
This commit is contained in:
13
mkhash.py
Normal file
13
mkhash.py
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys, getpass, bcrypt
|
||||
|
||||
def main():
|
||||
if len(sys.argv) > 1:
|
||||
password = sys.argv[1]
|
||||
else:
|
||||
password = getpass.getpass("Mot de passe: ")
|
||||
h = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt(rounds=12)).decode("ascii")
|
||||
print(h)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user