Skip to content

Commit 05f0495

Browse files
committed
Combine the salt and pepper
1 parent 8d8a290 commit 05f0495

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pubsub/pubsub.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ def search(phrase: str, limit: Optional[int] = None) -> List[Post]:
7474
def hash_password(password: str, salt: Optional[bytes] = None) -> HashAndSalt:
7575
pepper = b'alchemists discovered that gold came from earth air fire and water'
7676
salt = salt or secrets.token_bytes(16)
77-
salted_pass = salt + password.encode('utf-8')
78-
return hashlib.pbkdf2_hmac('sha512', salted_pass, pepper, 100000), salt
77+
return hashlib.pbkdf2_hmac('sha512', password.encode(), salt+pepper, 100000), salt
7978

8079
def set_user(user: User, displayname: str, email: str, password: str, bio: Optional[str]=None, photo: Optional[str]=None) -> None:
8180
user = intern(user)

pubsub/webapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ def fetch_static(filename):
9393
return static_file(filename, root='static')
9494

9595
if __name__ == '__main__':
96-
run(host='localhost', port=8080)
96+
run(host='localhost', port=8081)

0 commit comments

Comments
 (0)