def vnc_authentication(self, challenge): # Take in 16 bytes, encrypt with 3DES using the password as the key, # and send the response. response = generate_response(self.password, challenge) self.transport.write(response) return self.security_result, 4
def check_password(challenge, response, password): password = password.ljust(8, "\x00")[:8] return generate_response(password, challenge) == response