trezor-agent icon indicating copy to clipboard operation
trezor-agent copied to clipboard

feature: password-agent: password derivation for trezor devices

Open f321x opened this issue 1 month ago • 3 comments

Implements a new feature, password-agent, which allows to derive passwords and mnemonic passphrases from the hardware wallet. This can be useful to obtain high entropy passwords for things like file encryption. The user provides a context string, e.g. gmail, confirms a signature on the hardware wallet and (with default args) receives a mnemonic passphrase.

Examples:

Default usage:
$ trezor-password gmail
> carton-unviable-backless-polo-steam-unwound-rocking-banister-polygon-ivy

Base 58 encoding with -b58 or --base58:
$ trezor-password gmail -b58
> 5B8qjnGqseE4KTb7CHCiRJ!

Raw hex output with --raw or -r:
$ trezor-password gmail --raw
> 21ced2f820074f2d557ab4aeea1a7b5d

Providing a custom wordlist with -w or --wordlist:
$ trezor-password gmail -w wordlist-german.txt
> Einweisens-Westinsel-Flugdatenprozessors-Fliegervereine-Säumer-zeitinvariantes-Softwaretitels

Currently it is only exposed for Trezor devices. I was testing with a Ledger Nano S as well, however it refused to sign my message, may investigate Ledger again if this gets merged.

f321x avatar Nov 23 '25 13:11 f321x

Rebased from https://github.com/romanz/trezor-agent/pull/506/commits/9c72dd92e5936e7a44fb09bd14eee30f18774baa to https://github.com/romanz/trezor-agent/pull/506/commits/0745a22028ac74612539d7d98a0aeaf3443a3967. Should fix the pycodestyle CI issues.

f321x avatar Nov 23 '25 14:11 f321x

Rebased from https://github.com/romanz/trezor-agent/commit/0745a22028ac74612539d7d98a0aeaf3443a3967 to https://github.com/romanz/trezor-agent/pull/506/commits/d903eabbd329cc5ee106ff4446c5b10b2d8d933b. Forgot to commit the changes to test_password.py. Now pycodestyle should be happy :)

f321x avatar Nov 23 '25 18:11 f321x

Rebased from https://github.com/romanz/trezor-agent/commit/d903eabbd329cc5ee106ff4446c5b10b2d8d933b to https://github.com/romanz/trezor-agent/pull/506/commits/65fc9bb4abaa0ed68d6ebe4a0baa3a79ec210e78. Now i ran the CI in my fork, should definitely pass.

f321x avatar Nov 23 '25 19:11 f321x