2017-06-13 22:21:31 -04:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import getpass
|
2017-09-09 13:53:58 -04:00
|
|
|
import src.my_scrypt
|
2017-09-09 14:21:57 -04:00
|
|
|
import binascii
|
|
|
|
import src.password_provider
|
2017-08-13 19:43:33 -04:00
|
|
|
|
2017-06-13 22:21:31 -04:00
|
|
|
password1 = getpass.getpass()
|
2017-09-09 13:53:58 -04:00
|
|
|
password2 = getpass.getpass(prompt='Repeat the same password:')
|
2017-06-13 22:21:31 -04:00
|
|
|
|
|
|
|
if password1 == password2:
|
2017-09-09 13:53:58 -04:00
|
|
|
hash = src.my_scrypt.getVerificationHash(password1)
|
2017-09-05 21:22:16 -04:00
|
|
|
|
2017-09-09 14:21:57 -04:00
|
|
|
src.password_provider.setPasswordHash(binascii.hexlify(hash))
|
|
|
|
|
|
|
|
print('Password has been generated and saved into password.txt. You can now login.')
|
2017-06-13 22:21:31 -04:00
|
|
|
else:
|
|
|
|
print('Entered passwords are not identical!')
|