# 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