1
0
Fork 0
asrc-dev/include/auth.py

24 lines
478 B
Python
Raw Normal View History

# includes/auth.py
#
# module version: 0.0.20130617
# for protocol version 0.2.20130617
#
class auth:
passwd = ""
def init(password):
#from Crypto.Hash import Hash
import hashlib
global passwd
passwd = password
def check_passwd(incpass):
"""
checks a given password
"""
if hashlib.sha512(bytearray(incpass)).hexdigest() == passwd: return True
else: return False