Changed the way the master password hashing works
Switched from Bcrypt to Scrypt for master password hashing Changed models to use new sizes for hashes and salts, doubled the size of enc_login and enc_passwd for accounts Created new function to check master password validity Increased salt sizes for accounts and master passwords Removed bcrypt from requirements
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import base64
|
||||
|
||||
import bcrypt
|
||||
import os
|
||||
|
||||
from cryptography.fernet import Fernet
|
||||
from cryptography.hazmat.backends import default_backend
|
||||
@ -25,7 +24,7 @@ def encrypt_account_info(
|
||||
) -> tuple[bytes, bytes, bytes]:
|
||||
"""Encrypts login and password of a user using their master password as a key.
|
||||
Returns a tuple of encrypted login, password and salt"""
|
||||
salt = bcrypt.gensalt()
|
||||
salt = os.urandom(64)
|
||||
key = _generate_key(salt, master_pass)
|
||||
f = Fernet(key)
|
||||
enc_login = f.encrypt(login.encode("utf-8"))
|
||||
|
Reference in New Issue
Block a user