Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from .comm import getDongle
import argparse
import getpass
def auto_int(x):
return int(x, 0)
parser = argparse.ArgumentParser()
parser.add_argument("--persistent", help="Persist passphrase as secondary PIN", action='store_true')
args = parser.parse_args()
dongle = getDongle(False)
passphrase = getpass.getpass("Enter BIP39 passphrase : ")
if len(passphrase) != 0:
if args.persistent:
p1 = 0x02
else:
p1 = 0x01
apdu = bytearray([0xE0, 0xD0, p1, 0x00, len(passphrase)]) + bytearray(passphrase)
dongle.exchange(apdu, timeout=300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment