import getpass import bcrypt print( bcrypt.hashpw( getpass.getpass("Password: ").encode("utf-8"), bcrypt.gensalt() ).decode() )