File size: 417 Bytes
af1d8cd
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from passlib.context import CryptContext

try:
    pwd_context = CryptContext(schemes=["pbkdf2_sha256"], deprecated="auto")
    print("Context created")
    hash = pwd_context.hash("password123")
    print(f"Hash created: {hash}")
    verify = pwd_context.verify("password123", hash)
    print(f"Verify result: {verify}")
except Exception as e:
    import traceback
    traceback.print_exc()
    print(f"Error: {e}")