I am creating a dice game and want to introduce password hashing and user is required to enter their username and password. I am new to hashing and I tried this:
from getpass import getpass
from hashlib import pbkdf2_hmac as pwhash
def login(users):
username = input('please enter username: ')
if username not in users:
print("access denied")
exit()
password_hash = None
while password_hash != users[username]:
password_hash = pwhash("sha256", getpass().encode("ascii"), b"t4h20p8g24j", 100000)
print("access granted")
return username
login(users)
I then received the following message on console:
GetPassWarning: Can not control echo on the terminal.
so I tried a different ide (went from idle to intellij pycharm) yet the same issue still came about.
I saw other questions but
an environment where stdin, stdout and stderr are connected to /dev/tty, or another PTY-compliant device.
doesn't really make sense to me I tried to comment but I need more rep.
Also I'm running on PyCharm not idle