Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I have a basic understanding of private/public key cryptography and have been using it for SSH logins and GPG encryption/signing for a while now. However, I have always kept the private key/keyrings in the default location, in my home directory (.gnupg and .ssh). Obviously, I can transfer the keys to a usb drive, which theoretically means neither a keylogger on my computer or the usb drive alone will be enough to get at my private key.

What benefits do smart cards capable of storing private keys, and devices like the YubiKey Neo (which seems to be a smart card + usb reader in a single dongle) offer above storing private keys on a plain-old usb thumb drive?

Does the smart card ever "reveal" the private key to applications like SSH or GPG? If so, it seems anyone who has the PIN and the device itself can still get at the private key, and offers no advantages over regular USB drives. If not, how exactly do applications work without knowing the private key?

share|improve this question

3 Answers 3

Does the smart card ever "reveal" the private key to applications like SSH or GPG? If so, it seems anyone who has the PIN and the device itself can still get at the private key, and offers no advantages over regular USB drives. If not, how exactly do applications work without knowing the private key?

Ideally, No.

The primary advantage of such a token is that it keeps its key secret, and performs crypto activity (such as decrypting, signing, etc.) on the hardware device itself, never disclosing the private key.

So, for example, you can request the public key from the device, and use that public key to encrypt a file (with or without the device present). But to decrypt the file, you have to plug in the token and ask it to decrypt the file for you.

The actual implementation details vary between devices, but this is the general idea of what you want to happen.

Additionally, these crypto tokens often employ some physical security measures to help prevent an attacker from disassembling the device and directly retrieving the key. It's not possible to protect with 100% certainty, but measures like using a single chip design (instead of including a discreet memory chip) and generous helpings of epoxy are common.

share|improve this answer

Honestly, it all really depends on the card itself. External security devices for this job typically take one of three forms: store secrets that PC computes on; do all secret storage and computation themselves; something in between. The cards that provide real security do the signing with onboard keys, preferably generated on device too. The idea is the key never leaves the device under any circumstances because the client can't be trusted (i.e. malware).

Using these helps you in two ways:

  1. Malware on PC is reduced to message forgery while the smartcard is insider. Depending on configuration, it might also take customization of the malware reducing your risk even further.

  2. Loosing a smartcard to a thief shouldn't worry you as much as loosing a laptop or USB drive full of secrets.

  3. You can put a smartcard in the wallet you'll likely be carrying anyway.

  4. Quite a few commercial laptops have smartcard readers these days.

One particular feature you should look for is a PIN pad built into the reader. The reason is that this can help you establish a trusted path where your PIN goes directly to smartcard. Without this, you might have entered it into a malware-infested computer via keyboard. A trusted path would have prevented compromises via password/pin of certain "certified," encrypting USB sticks. An example of one with this feature is in the link below. (Along with old links to GPG smart card instructions.)

http://www.gnupg.org/howtos/card-howto/en/ch02s02.html

OpenSSH with smart cards here.

http://www.gooze.eu/howto/using-openssh-with-smartcards

share|improve this answer

OpenPGP smartcards usually do not reveal your secret keys. Basic signing work is done by the cards, and is only available after entering your PIN code. The card has a small processor built-in for those tasks.

Imagine your OpenPGP client (eg., GnuPG) sends a request "decrypt this block cypher" which then is performed by the card (the actual encryption is done using a block cypher which is much faster), or "sign this user ID of this key", which is again performed by the card.

It is possible to download your keys from the card, but you need another special "admin PIN" for it.

So as long you're not entering your admin PIN, all an attacker in control over your computer could do is "use" your key as long as the smartcard is attached, he could not revoke, delete, download it. Furthermore, most card readers will reveal access to the card by some flashing lights.


Thumb drives store the whole key which can be accessed. If it is attached to your computer, the private keys can be downloaded from it.

share|improve this answer
1  
1. Does your answer refer to just OpenPGP cards, all smart cards capable of doing PK encryption? 2. Do you mean "decrypt this block cypher key", after which the actual symmetric crypto is done on the host? 3. How does a tiny, inexpensive device like a smart card do the supposedly computation-intensive math required for PK crypto efficiently? –  user2243865 Jul 14 '13 at 9:21
    
I don't know about other smartcards than the OpenPGP ones. The symmetric crypto is done on the host, yes. The current smartcards - as far as I know - are limited to 2k RSA keys for which the math isn't too expensive, especially not if a somewhat specialized processor is used. But regarding the hardware stuff others probably can tell much more. –  Jens Erat Jul 14 '13 at 9:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.