diff --git a/Website/user.py b/Website/user.py index f8eb9e4..777380d 100644 --- a/Website/user.py +++ b/Website/user.py @@ -39,7 +39,7 @@ def hashing(password): Returns: str: Hexadecimal digest of the hashed password """ - return hashlib.sha512(password.encode()).hexdigest() + return hashlib.scrypt(password.encode(), salt=b'salt_1234567890').hexdigest() def check_nm_pwd(username, password): @@ -56,7 +56,7 @@ def check_nm_pwd(username, password): client = None try: client, users = _get_users_collection() - hashed_password = hashlib.sha512(password.encode()).hexdigest() + hashed_password = hashing(password) return users.find_one({'Username': username, 'Password': hashed_password}) finally: if client: