Esempio n. 1
0
 def encrypt(self, data):
     """
     Encrypt the data with self.pub and return the ciphertext.
     @raises Exception: The encryption failed.
     """
     assert self.pub, "Attempt to encrypt without key."
     cryptor = Cryptor(pubkey_hex=self.pub)
     return cryptor.encrypt(data)
Esempio n. 2
0
 def encrypt(self, data):
     """
     Encrypt the data with self.pub and return the ciphertext.
     @raises Exception: The encryption failed.
     """
     assert self.pub, "Attempt to encrypt without key."
     cryptor = Cryptor(pubkey_hex=self.pub)
     return cryptor.encrypt(data)