1 """Password hashing functions and constants for the mudpy engine."""
3 # Copyright (c) 2004-2017 mudpy authors. Permission to use, copy,
4 # modify, and distribute this software is granted under terms
5 # provided in the LICENSE file distributed with this software.
9 _CONTEXT = passlib.context.CryptContext(
10 default="pbkdf2_sha512", pbkdf2_sha512__default_rounds=1000,
11 schemes=["pbkdf2_sha512"])
15 return _CONTEXT.encrypt(password)
18 def verify(password, encoded_hash):
19 return _CONTEXT.verify(password, encoded_hash)