1
0
Fork 0
asrc-dev/include/auth.py
Christian Damken 25d3344104 - inserted more comm.header() and comm.encode_message()
- added loop to be able to process multiple commands within one session, send "exit" to exit
- added code 004: Exit
- added include/auth.py with init() and check_password()
- added settings variable PASSWORD (stores a SHA512-encrypted password)
- added authenticate() to class comm
2013-06-19 16:25:43 +02:00

23 lines
478 B
Python

# 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