Example #1
0
 def encode(self, wallet, msg):
     password, iv, wallet_id = self.wallets[wallet]
     encrypted = aes_encrypt_with_iv(password, iv, msg.encode('utf8'))
     return base64.b64encode(encrypted).decode()
Example #2
0
 def encode(self, wallet: 'Abstract_Wallet', msg: str) -> str:
     password, iv, wallet_id = self.wallets[wallet]
     encrypted = aes_encrypt_with_iv(password, iv, msg.encode('utf8'))
     return base64.b64encode(encrypted).decode()
Example #3
0
 def encode(self, wallet, msg):
     password, iv, wallet_id = self.wallets[wallet]
     encrypted = aes_encrypt_with_iv(password, iv,
                                                      msg.encode('utf8'))
     return base64.b64encode(encrypted).decode()
Example #4
0
 def encode_xpub(self, xpub, msg):
     mpk = xpub.encode('ascii')
     password = hashlib.sha1(mpk).hexdigest()[:32].encode('ascii')
     iv = hashlib.sha256(password).digest()[:16]
     encrypted = aes_encrypt_with_iv(password, iv, msg.encode('utf8'))
     return base64.b64encode(encrypted).decode()