2016-11-20 02:16:04 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
"""
|
|
|
|
Password hashing utility for PyLink IRC Services.
|
|
|
|
"""
|
|
|
|
|
2016-11-20 02:47:55 +01:00
|
|
|
from pylinkirc.coremods.login import pwd_context
|
2016-11-20 02:16:04 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(description='Hashes a password for use with PyLink IRC Services.')
|
|
|
|
parser.add_argument('password', help='specifies the password to hash')
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2017-01-23 01:16:25 +01:00
|
|
|
assert pwd_context, 'Cannot hash passwords because passlib is missing! Install it via "pip3 install passlib".'
|
2016-11-20 02:16:04 +01:00
|
|
|
assert args.password, "Password cannot be empty!"
|
|
|
|
print(pwd_context.encrypt(args.password))
|