def encrypt_data(self, data): try: return cryptotool.encrypt(data, self._read_crypto_key()) except: raise rpc.InvalidRequestError('Failed to encrypt data. Error: %s' % (sys.exc_info()[1], ))
def decrypt_data(self, data): try: return cryptotool.decrypt(data, self._read_crypto_key()) except: raise rpc.InvalidRequestError('Failed to decrypt data')