Created master_pass encryption function

This commit is contained in:
StNicolay 2022-09-26 20:41:42 +03:00
parent 6cd1016249
commit ba72f9f2d4

View File

@ -0,0 +1,10 @@
import bcrypt
print("Hi")
def encrypt_master_pass(passwd: str) -> tuple[bytes, bytes]:
"""Hashes master password and return tuple of hashed password and salt"""
salt = bcrypt.gensalt()
hashed = bcrypt.hashpw(passwd.encode("utf-8"), salt)
return (hashed, salt)