Would it be possible to use Yubico or Nitrokey as a HSM that is used infrequently?

Both devices seem to prevent users from accessing the private key. Does this seem to be correct?

How about if the target PC (where you insert the key) gets hacked (let's assume they capture the PIN)? Yubico has a button on it which I guess is used during signing (so you have to explicitly allow a signing request)?

  • this sounds like a perfect use for the yubikey Nano – user196499 Mar 1 '18 at 20:18

In general you could use Yubikey or Nitrokey but it depends on what you expect a HSM to do. Products of both vendors prevent users from accessing the private key being stored in the device. Only Nitrokey HSM has advanced key management features such as m-of-n access protection, key policies etc. which is usually expected of a professional HSM. See the Nitrokey HSM factsheet for more details. There is also a Yubikey HSM and its name implicates similar features but AFAIK it does not and instead contains features very specific for OTP usage.

Yubikey's button can be used to allow signing operations. Depending on your use case this might be an advantage. Professional HSMs may be used remotely or on dedicated trusted computers and in such cases a button may not be desired.

  • It depends on which features of an HSM they require. Smartcard HSM, on which the Nitrokey HSM operates, seems to just be a cryptographic provider with some logging and authentication. It appears to lack on-HSM programmability, but instead only provides API access to encryption operations. If the users is concerned about abuse of keys for local operations if his system is hacked, then the Nitrokey HSM would not be effective as it can not have custom routines added securely to it to prevent unauthorized operations. A programmable HSM would allow for greater protection in this case. – AJ Henderson Oct 2 '17 at 13:33

It depends on how much protection you need the HSM to provide. While Smartcard-HSM (which the Nitrokey HSM is an implementation of) will provide encryption operations on the dongle without releasing the key, it only supports external programmability from what I could find.

The problem with this is that while the HSM may protect the keys themselves from compromise, it can't protect the key from usage if authentication information is provided. If using a software authentication via the host, it would be potentially compromised via keyloggers or actions could be submitted by a hack when you next authenticate to the device.

A programmable HSM, on the other hand, will allow for more of the allowable encryption operations to be performed in card, including defining what operations should be performed and under what circumstances in a more secure manor. This provides an extra level of security as you can put further protections around the usage of a key that make it harder to abuse, however programmable HSMs are much more expensive devices.

  • You are right that Nitrokey HSM isn't programmable. But it can protect the key from usage by using m-of-n authentication where authentication is provided by other Nitrokey HSM in an end-to-end encrypted (and potentially remote) manner. This way a key logger in the central system won't be able to compromise the HSM. – jans Oct 2 '17 at 19:40
  • @jans - that'd improve it a bit in that authorization would have to be provided for a task, but does it provide a way to validate the action being requested. It would require some action to be authorized, but the attacker could feasibly do some other action than what it was believed was being authorized, depending on how exactly the m of n is implemented. – AJ Henderson Oct 2 '17 at 19:44
  • There is only a way to configure the cryptographical key usages per-key but not per-action. Also when using another client-side Nitrokey HSM for the authentication and authorization of m-of-n (on a central Nitrokey HSM), the administrator needs to connect his Nitrokey physically, which can't be done by a software attack. – jans Oct 7 '17 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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