Guide to Using YubiKey as a SmartCard for GPG and SSH
github.com
github.com
http://www.engineerbetter.com/blog/yubikey-all-the-things/
http://www.engineerbetter.com/blog/yubikey-ssh/
Then FYI you should check, if you haven't already, the version of yubikey you have and replace it if necessary:
https://www.yubico.com/2017/10/infineon-rsa-key-generation-i...
And only those of 2048b or fewer.
> Yubikey provided an excellent service for replacing their products when I went through them. However, I hear the story is quite different if you bought one via Amazon.
I bought from Amazon; requested a replacement directly, great service as you say, it didn't matter where I'd bought it originally.
- https://blog.flameeyes.eu/2016/10/gnupg-agent-forwarding-wit...
- https://www.isi.edu/~calvin/gpgagent.htm (Mac OS)
I broke my head recently trying to get this to work recently. The error was in 2 different gpg binaries that ubuntu ships with. Using gpg2 instead of gpg gets it working.
https://rnorth.org/gpg-and-ssh-with-yubikey-for-mac
https://news.ycombinator.com/item?id=16145586
https://malcolmsparks.com/posts/yubikey-gpg.html
https://spin.atomicobject.com/2014/02/09/gnupg-openpgp-smart...
https://wiki.archlinux.org/index.php/GnuPG#Encrypt_and_decry...
https://www.jfry.me/articles/2015/gpg-smartcard/
https://www.yubico.com/support/knowledge-base/categories/art...
``` gpg: selecting openpgp failed: Operation not supported by device gpg: OpenPGP card not available: Operation not supported by device ```
and the only solution I found was to remove OSX and replace it with linux which is now working again.
I did find this: https://www.yubico.com/support/knowledge-base/categories/art...
[1] https://rzetterberg.github.io/yubikey-gpg-nixos.html
[2] https://developers.yubico.com/PGP/SSH_authentication/Windows...
A few weeks ago I found out about Bloomberg BUnit 4[0] (I was looking at their keyboards and got distracted).
I think we need something similar for consumers (as in, I don't want to end up spending 24k for a terminal just for a BUnit).
Basically it's a device that has a light sensor, a fingerprint reader and a code generator - all used to authenticate the user to Bloomberg services.
The closest I've gotten is using something like Trezor[1] or Ledger S Nano[2] (no fingerprint reader/light sensor - but it's protected via a passcode).
It's just one more level of protection on top of a hardware key (username + password + hardware key (protected by a password))
[0] https://www.bloomberg.com/professional/support/b-unit/
[1] https://preorder.trezor.io/ (the model T)
This is Ubuntu 16.04, which comes with GnuPG 2.1.11.
Ledger did an OpenPGP Card 3.0 implementation that looks interesting, though the token is pricey: https://github.com/LedgerHQ/blue-app-openpgp-card
Some gnuk tokens, such as the Nitrokey Start support Curve25519, also for SSH authentication (I use this). Of course, gnuk tokens have a different set of trade-offs:
- In contrast to Yubikeys, the firmware is open source and can be verified.
- It uses a curve that is considered safe [1]. Some security experts don't trust the NIST curves.
- In contrast to the Yubikey, it does not use tamper-resistant storage, but just a regular microcontroller. AFAIK it does store the keys encrypted though.
- There is no physical confirmation for key use, only PIN confirmation (with a maximum number of tries).
However, gnuk keys are very affordable. E.g. I purchased my Nitrokeys for 29 Euro each.
A completely different approach is to use your phone (and its secure element) as a crypto token. E.g. using Krypton [2]. Of course, this is only viable if you trust your phone manufacturer and operating system.
[1] https://safecurves.cr.yp.to
[2] https://krypt.co
(BTW re "AFAIK it does store the keys encrypted though," I'd be cautious about relying on that encryption. The keyspace for PINs is tiny and trivially brute-forceable. And if you choose to use a strong passphrase for your Gnuk token that is capable of resisting brute force, you're giving up one of the main usability benefits of committing a secret to a hardware token. I know they're working on something called KDF-DO that might offload key stretching to the host, but it's still going to be the case that PINs will be brute-forceable.)
Version 2.2.5.
The keyspace for PINs is tiny and trivially brute-forceable.
Good point!
For future reference, installing GnuPG 2.2.5 turned out to be easier than I expected. I visited http://http.us.debian.org/debian/pool/main/g/gnupg2/, downloaded the .deb I wanted, tried installing with dpkg -i, and then downloaded further dependencies until it worked.
Last time I tried, I built GnuPG from source, which ended up with something that mostly worked, but it failed my personal sysadmin test of being able to remember how I did it in case I needed to build a new machine with the same characteristics.
https://anonscm.debian.org/cgit/gnuk/gnuk/gnuk.git/tree/READ...
As for the PIV portion: Unfortunately, PIV will not work either. Right now, OpenSSH’s ssh-agent doesn’t have the ability to handle EDSA keys when using PKCS#11 (which is how the agent communicates with the “card”.
The enhancement request is at https://bugzilla.mindrot.org/show_bug.cgi?id=2474
Unfortunately, although people have been maintaining patches, there’s been no official action (that I know of) on this.
But, with regard's to the parent comments's "this or any guide" qualifier, then this can become an important point, and so I think it's worth noting.
Ideally, you don't deployments manually anyways.
Has anyone else had this experience? Is it possible to turn the flashing off?
It's be really great to have an auditable open source processor/soc design with PC/SC compatible interface and secure enclave implemented in an ISO standard smartcard form factor. Alas, to my knowledge nothing like that exists.
Yubikey designs used to be a lot more open than they are currently (you used to be able to run your own applets, IIRC - with some security compromises, of course). That said, I would still personally use them for non-critical things - it's a really handy form factor.
Not anymore! https://fsfe.org/news/2017/news-20171116-01.en.html
I was surprised, since I still received it, seems like I was one of the last. I feel like a five-digit /. user :)
Almost anything that can run NeuG can also run Gnuk. You're not going to get tamper-resistant hardware -- unfortunately it's not possible today to buy truly open hardware with a tamper-resistant design -- but you'll get something that most people consider open.
Someone is going to reply to this and note sagely that all commercial hardware is proprietary. I don't interpret craftyguy's question as a rhetorical statement that we're all doomed.
Yubikeys in U2F mode are better than any OTP because they protect you against phishing attacks. 1Password auto-filling arguably has this property too, but you should disable that sort of password manager behavior:
https://labs.detectify.com/2016/07/27/how-i-made-lastpass-gi...
Not really. The TOTP RFC recommends accepting TOTP tokens from before and after the current time step to make TOTP work with clock drift. Since most implementations use time steps of 30 seconds an allow TOTP codes of at least one past and one future time step, the window in which an TOTP code can be used is typically 90 seconds.
Consequently, TOTP only works against 'offline phishing' where a phisher collects data first and tries to take over the accounts later. For any kind of immediate phising, there is typically no problem to forward re-use the token, even with a small delay.
As you say, U2F protects against this, by using challenge-reponse and using the origin selecting the key handle.
Thanks. I certainly understand that but the convenience trumps the risk imo. Further, I don't want to reach for and insert a USB drive every time I want to log in somewhere. And what if there's no available USB port?
The only thing that would be more convenient would be if the browser authenticated itself using a client side TLS certificate as one factor in the authentication process.