def decrypt(self): shares = [x.text() for x in self.textboxes if x.text()] if not shares: return hex_shares = [] for share in shares: hex_share = hex(self.mm.mnemonic_decode(share))[2:] hex_share = hex_share[0] + "-" + hex_share[2:] hex_shares.append(hex_share) decrypted = HexToHexSecretSharer.recover_secret(hex_shares) self.original.setText(self.mm.mnemonic_encode(int(decrypted, 16))) for tb in self.textboxes: tb.setText("")
def open(self, num_addr, shares, passphrase, pwd_array=None): # Rebuild the seed from shares _shares = [] x = 0 for share in shares: if pwd_array is not None: _shares.append(self.AESEncrypt(pwd_array[x], share)) else: _shares.append(share) x += 1 entropy_from_seed = HexToHexSecretSharer.recover_secret(_shares) w = self.fromEntropy(binascii.unhexlify(entropy_from_seed), passphrase) x = 0 while x < num_addr: key = w.create_address(save=True, addr_type=0) x += 1 return w
def recover_passphrase(shares): return HexToHexSecretSharer.recover_secret(shares)
def recover_passphrase(shares): return HexToHexSecretSharer.recover_secret(shares)