You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
518 B
16 lines
518 B
import base64, hashlib
|
|
|
|
secret_cookie = "IPreferSeaSaltCarmelIceCreamOverAnyLameCookies"
|
|
|
|
username = input("username: ")
|
|
password = input("password: ")
|
|
if input("retype password: ") != password:
|
|
print ("passwords do not match up! Lern 2 spel your password plz!")
|
|
exit()
|
|
|
|
hasher = hashlib.sha256()
|
|
hasher.update(password.encode('utf-8'))
|
|
hasher.update(secret_cookie.encode('utf-8'))
|
|
hashedpassword = base64.b64encode(hasher.digest()).decode('utf-8')
|
|
|
|
print ('"{}":{{"password":"{}"}}'.format(username,hashedpassword)) |