Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: oOoOo on May 16, 2014, 10:29:21 PM



Title: Securing Bitcoin-QT with a yubikey?
Post by: oOoOo on May 16, 2014, 10:29:21 PM
So I bought myself a yubikey and I plan to use it to create a more secure version of the main QT client whereby the regular passphrase prompt is replaced with a prompt for a one-time-password (OTP) authentication provided by the yubikey.

This will most likely require a custom built client. I can build QT on linux including necessary code changes.
There is also a yubico c library at https://github.com/Yubico/yubico-c

The question however is this:
Altough I'm somewhat familiar with the bitcoin client code, with the yubikey I'm starting at zero. What would, in your eyes, be the best way to approach this?

Has anyone attempted something similar?

Thanks in advance for any suggestions!


Title: Re: Securing Bitcoin-QT with a yubikey?
Post by: jonald_fyookball on May 17, 2014, 12:46:51 AM
Interesting project.

I'm wondering how it works.  I assume with the regular client, it is hashing the passphrase and then verifying it?

What can you get back from the yubikey on success?  Cause if you only get back a generic success message, that doesn't seem that secure because attacker with access to your machine could modify your code and bypass the key.


Title: Re: Securing Bitcoin-QT with a yubikey?
Post by: grue on May 17, 2014, 01:06:02 AM
yubikey authentication can only be done in a secure environment (ie. a trusted server), this can not be said of someone's computer.


Title: Re: Securing Bitcoin-QT with a yubikey?
Post by: Foxpup on May 17, 2014, 05:09:03 AM
Cause if you only get back a generic success message, that doesn't seem that secure because attacker with access to your machine could modify your code and bypass the key.
Correct. YubiKey does authentication, not encryption, which is what you really need to protect your wallet.

The way YubiKey (and similar 2FA systems) work is, the server runs software that generates one-time codes from a seed, and the YubiKey also generates one-time codes from the same seed, and sends it to the server. If the codes match, the server allows you to log in. If the don't match, your login is refused. This works exactly the same as if you had logged in with a password, except that the one-time code changes every time you log in, so old codes cannot be re-used, thwarting keyloggers.

The important thing to note here is that both the seed and the software to generate one-time codes are stored on the server, which is obviously not secure at all if an attacker is able to access files on the server (and if they can't access your files, your wallet is safe anyway - hence the usefulness of cold storage). To protect files that an attacker could potentially access, you need encryption, and YubiKey cannot help you with that.


Title: Re: Securing Bitcoin-QT with a yubikey?
Post by: behindtext on May 17, 2014, 06:13:53 AM
Cause if you only get back a generic success message, that doesn't seem that secure because attacker with access to your machine could modify your code and bypass the key.
Correct. YubiKey does authentication, not encryption, which is what you really need to protect your wallet.

The way YubiKey (and similar 2FA systems) work is, the server runs software that generates one-time codes from a seed, and the YubiKey also generates one-time codes from the same seed, and sends it to the server. If the codes match, the server allows you to log in. If the don't match, your login is refused. This works exactly the same as if you had logged in with a password, except that the one-time code changes every time you log in, so old codes cannot be re-used, thwarting keyloggers.

The important thing to note here is that both the seed and the software to generate one-time codes are stored on the server, which is obviously not secure at all if an attacker is able to access files on the server (and if they can't access your files, your wallet is safe anyway - hence the usefulness of cold storage). To protect files that an attacker could potentially access, you need encryption, and YubiKey cannot help you with that.
grue and foxpup make good points regarding how yubikeys work.

in order to use the yubikey in the manner you prescribe, you would need to have a configuration like

  • have wallet stored on a separate system
  • that separate system uses yubikey as a first authentication factor to prevent users without yubikey from getting in
  • once a user auths using yubikey, they can enter their passphrase and remotely unlock the wallet
  • transactions would need to be composed on this separate machine

this cannot be done properly on a single host for the reasons mentioned in the earlier posts. you are pretty much required to have a 2nd machine which houses the yubikey private key. we support yubikey at coinvoice.com using our (golang) yubikey library, https://github.com/conformal/yubikey .


Title: Re: Securing Bitcoin-QT with a yubikey?
Post by: oOoOo on May 18, 2014, 01:47:35 PM
yubikeys can be used in a "static" mode, always generating the same pwd. A very long/complex passphrase can be written onto the key and serve to secure the wallet. That would not be 2-factor auth though.


Title: Re: Securing Bitcoin-QT with a yubikey?
Post by: Geremia on July 25, 2014, 11:27:19 PM
yubikey authentication can only be done in a secure environment (ie. a trusted server), this can not be said of someone's computer.
YubiKeys do all kinds of things: generate one-time passwords (OTPs), do authentication with a trusted server, generate static passwords, etc.