SeedSigner / seedsigner

Use an air-gapped Raspberry Pi Zero to sign for Bitcoin transactions! (and do other cool stuff)
MIT License
715 stars 164 forks source link

[Feature] QRcode option for passphrase input and backup #71

Open openoms opened 3 years ago

openoms commented 3 years ago

Being able to scan the seed from a QR code is a great feature, but the manual input of the passphrase discourages the use of long phrases. An option to show the passphrase as a QR code would make it possible to have it saved the same way the seed can be stored and an option to scan it back would speed up the loading of the device.

The complication is that the character types and the length of the passphrase is not fixed so cannot be translated to just numbers from the BIP39 wordlist. In case of for example using another 12-24 words as the passphrase would make the QRcode quite large. This limits the ability to record the QRcode manually more than the scanning of it.

Still I think the option would encourage the usage of long passphrases and improve the security of the keys. A long passphrase is also likely a better (or at least an alternative) solution to an encrypted QRcode. Both the seed and the passphrase itself can act as a decoy wallet and provide plausible deniability.

SeedSigner commented 3 years ago

Have discussed this a little bit with Nick and we are still mulling over how it would make sense to implement. Appreciate the suggestion.

kdmukai commented 3 years ago

A 25-char passphrase should fit in a 21x21 QR, no? That's not bad. And then a 25x25 would fit up to 47 chars.

My bigger concern is that you'd be reducing your 2nd factor of security to be essentially the same as your 1st factor. I definitely dislike the pain of typing in a long passphrase but I really like that I can store that passphrase in a totally different manner from the seed QRs which I need to have physically secured yet still accessible (bad combo of traits, obv).

david-bakin commented 2 years ago

With the help of some conversation on Telegram I arrived at the following suggestion:

  1. If you want 2-part security but only want to hide 1 QR code around the house and are ok with memorizing a short memorable passphrase then: use a passphrase with the current UI for entering it (or something like it). And you get decoy wallets by using the QR code with no passphrase or with any different decoy passphrase.

  2. If you want the ease of entering 2 QR codes for two-part security, and are ok with hiding two separate QR codes around the house (in whatever plausible manner you like) then you use seedxor. And you also get decoy wallets by using either one or the other of the QR codes or any other QR code you've also hidden around the house (easier to find, heh..., when the knowledgable attacker finds 2 QR codes he ... stops looking for more!)

1. And finally, if you decide to convert from seed phrase + passphrase to seedxor: SeedSigner can help you there by converting your BIP39-wallet to a BIP-32 wallet - which is what Coinkite calls "lock down the seed"!

openoms commented 2 years ago

@david-bakin great recap thanks.

Agree with your point 1 (similar to what @kdmukai wrote above), although being able to type passphrases should not stop the UI having and option to scan them as well, but I understand it is not a priority.

re 2: being able to add two seeds together with seedxor would add the same security as seed + PP and being discussed here: https://github.com/SeedSigner/seedsigner/issues/43. It is a very good option for new or seed-only wallets.

re 3: @david-bakin not sure how "converting a BIP39-wallet to a BIP-32" would help here. Seedxor can only generate an other seed and we can't assign a a new seed to the wallet which has it's private keys generated from words+passphrase.

david-bakin commented 2 years ago

ah, my mistake - I didn't know the seed wasn't the xprv itself. so NVM about that.

KyleOfTheCorn commented 1 year ago

Bumping this. While working with the Seed Tool, I've found that it would actually be very beneficial to users, especially with airgapped computers, to be able to type in their passphrases on a real keyboard, then scan them in with the SeedSigner. Which ever standard is used to display the QR code could then be implemented in Seed Tool.

CC @SuperPhatArrow & @BitcoinQnA for visibility.

dmonakhov commented 12 months ago

If we are talking about use case I have one in mind, it is related with cold backup vs normal-use

So right now I have to chose, to have backup with non ideal privacy, or to have a pain of typing passphrase every time. But I want both advantages, secure and private backup (seed+passprase), and easy to use seed+passprase as QR code. What do you think?

earthdiver commented 7 months ago

I am interested in having a QR code option for entering CJK passphrases. Although the software wallets I use (Sparrow, Electrum, BlueWallet, etc.) accept CJK passphrases, I am unable to use them with SS due to its lack of support for non-ASCII passphrases. Krux already has this option.

For backup I prefer the 29x29 QR code format, which is capable of storing 53 bytes of UTF-8 data.

BTW, I use the English BIP39 wordlist (for compatibility) with CJK passphrase (for added security).

kdmukai commented 7 months ago

For those of us (me!) who are unfamiliar with the term:

https://en.wikipedia.org/wiki/CJK_characters

earthdiver commented 7 months ago

@kdmukai thank you for your supplementary comment.

I don't think we need to fully understand the encoding. We simply need to be able to directly read the byte array data as the salt for the PBKDF2 function from the QR code.

Personally, I don't mind if the passphrase displayed for verification on SS gets garbled due to the ASCII font. By verifying the fingerprint, you can confirm if it has been read correctly.

earthdiver commented 3 months ago

It didn't seem to be an issue that interested many people, so I took care of it myself over the weekend. (no backup feature) Using it in combination with a smartphone app like 'Binary Eye' makes entering long passphrases easier. If you are concerned about passphrase leaks due to malware, you might want to create a QR code with a string that is slightly different from the actual passphrase and then correct it in the SS. https://github.com/earthdiver/seedsigner/releases image