mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-23 05:40:57 +00:00
parent
fd16bbfc8e
commit
9255507529
@ -98,13 +98,15 @@ def main():
|
||||
raise ValueError("32 bytes password expected")
|
||||
|
||||
bip32_path = [10, 0]
|
||||
sys.stderr.write('Generated password is {}\n'.format(passw))
|
||||
passw_encrypted = client.encrypt_keyvalue(bip32_path, label, passw, False, True)
|
||||
sys.stderr.write('Encrypted password is {}\n'.format(passw_encrypted))
|
||||
|
||||
data = {'label': label,
|
||||
'bip32_path': bip32_path,
|
||||
'password_encrypted_hex': binascii.hexlify(passw_encrypted)}
|
||||
'password_encrypted_hex': binascii.hexlify(passw_encrypted).decode('ascii')}
|
||||
|
||||
json.dump(data, open(passw_file, 'wb'))
|
||||
json.dump(data, open(passw_file, 'w'))
|
||||
|
||||
# Let's load password
|
||||
data = json.load(open(passw_file, 'r'))
|
||||
@ -115,6 +117,7 @@ def main():
|
||||
binascii.unhexlify(data['password_encrypted_hex']),
|
||||
False, True)
|
||||
|
||||
sys.stderr.write('Submitting password {}\n'.format(passw))
|
||||
print(passw)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user