Exemplo n.º 1
0
 def decrypt_keyvalue(self, n, key, value, ask_on_encrypt=True, ask_on_decrypt=True, iv=None):
     n = self._convert_prime(n)
     return self.call(proto.CipherKeyValue(address_n=n,
                                           key=key,
                                           value=value,
                                           encrypt=False,
                                           ask_on_encrypt=ask_on_encrypt,
                                           ask_on_decrypt=ask_on_decrypt,
                                           iv=iv if iv is not None else ''))
Exemplo n.º 2
0
 def encrypt_keyvalue(self,
                      n,
                      key,
                      value,
                      ask_on_encrypt=True,
                      ask_on_decrypt=True):
     n = self._convert_prime(n)
     return self.call(
         proto.CipherKeyValue(address_n=n,
                              key=key,
                              value=value,
                              encrypt=True,
                              ask_on_encrypt=ask_on_encrypt,
                              ask_on_decrypt=ask_on_decrypt))