Allow encrypted passwords

This commit is contained in:
Fabian Affolter committed 2016-03-19 22:15:23 +01:00
1 parent 0bf13dbf26
commit 505b3b198e
2 files changed
+33 -6

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/python3
"""Generate hashes from given strings."""
import getpass
from passlib import hash
response1 = getpass.getpass('Please enter your string/password/API key: ')
response2 = getpass.getpass('Please enter the string/password/API key again: ')
hashed = hash.sha256_crypt.encrypt(response1)
if hash.sha256_crypt.verify(response2, hashed):
print('Put the hash in your configuration.yaml file.')
print(hashed)
else:
print('No match! Please try again.')