3
$\begingroup$

Digesting doesn't require any key and can be performed on the client side. Why does the PKCS#11 token interface standard have a C_digest method? For example, why should I send my data to a PKCS11 HSM whereas I can do this in my client?

$\endgroup$
2
$\begingroup$

What defining the digest as part of the API does is allow the device to be a completely self-contained cryptographic system. This system can then be tested as a unit -- if you did, say, hashes on the client side, you would have to ensure that the hash implementation was secure for each and every new implementation. By putting everything in one module, you can test and secure that module independently of everything else on the system -- you know your PKCS #11 device has a proper implementation, and don't have to bother re-implementing it yourself. That gives you a lot more flexibility as well, as everything you need is in that device (so you don't have to reimplement digesting every time you have a new system, as it's in the device).

FIPS actually requires a similar thing -- all cryptography has to be within a FIPS-certified device, because that outsources all the needed compliance steps to the FIPS device (you only have to check that device for compliance, and can then use it anywhere without worrying about the cryptographic implementation in the rest of the system).

$\endgroup$

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.