示例#1
0
 def verify(password, password_verify):
     password = unicode_dados(password)
     return pbkdf2_sha256.verify(password, password_verify)
示例#2
0
 def encrypt(password):
     password = unicode_dados(password)
     return pbkdf2_sha256.encrypt(password, rounds=SecurityPassword.ROUNDS)
示例#3
0
 def decrypt(cls, token, ttl=None):
     token = unicode_dados(token)
     return cls.fernet().decrypt(token, ttl)
示例#4
0
 def verify(cls, token, key, ttl=None):
     key = unicode_dados(key)
     return cls.decrypt(token, ttl) == key
示例#5
0
 def encrypt(cls, key):
     key = unicode_dados(key)
     return cls.fernet().encrypt(key)