Skip to content

Commit

Permalink
👌 add salt to email generation
Browse files Browse the repository at this point in the history
  • Loading branch information
annashamray committed Jun 1, 2022
1 parent 7b825c1 commit 4d69aa0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/open_inwoner/utils/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

def generate_email_from_string(value: str) -> str:
"""generate email address based on string"""
hashed_bsn = md5(value.encode(), usedforsecurity=False).hexdigest()
salt = "generate_email_from_bsn"
hashed_bsn = md5((salt + value).encode(), usedforsecurity=False).hexdigest()

return f"{hashed_bsn}@example.org"

0 comments on commit 4d69aa0

Please sign in to comment.