Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. from passlib.context import CryptContext
  2.  
  3. pwd_context = CryptContext(
  4. schemes=["pbkdf2_sha256"],
  5. default="pbkdf2_sha256",
  6. pbkdf2_sha256__default_rounds=30000
  7. )
  8.  
  9. def encrypt_password(password):
  10. return pwd_context.encrypt(password)
  11.  
  12.  
  13. def check_encrypted_password(password, hashed):
  14. return pwd_context.verify(password, hashed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement