Skip to content

Commit

Permalink
feat(core): Use sha256 instead of sha1 to make activation keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ERosendo committed Jun 9, 2023
1 parent cb1cc69 commit 562a9bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bc/core/utils/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def sha1_activation_key(s):
"""Make an activation key for a user
:param s: The data to use with the salt to make the activation key
:return: A SHA1 activation key
:return: A SHA256 activation key
"""
salt = hashlib.sha1(str(random.random()).encode()).hexdigest()[:5]
activation_key = hashlib.sha1((salt + s).encode()).hexdigest()
salt = hashlib.sha256(str(random.random()).encode()).hexdigest()[:5]
activation_key = hashlib.sha256((salt + s).encode()).hexdigest()
return activation_key

0 comments on commit 562a9bd

Please sign in to comment.