Created master_pass encryption function
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/cryptography/master_pass.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								src/cryptography/master_pass.py
									
									
									
									
									
										Normal 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)
 | 
			
		||||
		Reference in New Issue
	
	Block a user