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))