Beispiel #1
0
 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], ))
Beispiel #2
0
 def decrypt_data(self, data):
     try:
         return cryptotool.decrypt(data, self._read_crypto_key())
     except:
         raise rpc.InvalidRequestError('Failed to decrypt data')