Crypto USB Devices - where is the PIN/Password stored? I am currently looking at the security of cryto USB drives for storing x509 certificates. I have one in possession currently. It can be read/written to using the Microsoft Crypto APIs. Anytime one reads/writes to/from the device it prompts for a PIN. The PIN can be changed using a UI which installs with the device.

I was wondering how exactly this PIN is stored/used?. 
Does the device store the PIN on the device itself? Or is the PIN used to generate a symmetric encryption key which is then used to encrypt the contents of the device. Which will mean that only the right PIN will allow you to read from the device and also the PIN is not available on the device itself.

So I was wondering if there is a standard way in which device vendors do this. If so, what is it?

This is what the PKCS#11 standard says


  If a device does not have a tamper-proof environment or protected
  memory in which to store private and sensitive objects, the device may
  encrypt the objects with a master key which is perhaps derived from
  the user’s PIN. The particular mechanism for protecting private
  objects is left to the device implementation, however.


It's not clear what's a tamper-proof environment or protected memory in case of a USB crypto device.
It's impossible to say what the device really does; there are so many possible ways.

If you don't find any technical specification describing it, I would be wary of the actual security of the device.

If the device is FIPS 140 approved at any level, you can find back the FIPS certificate and the relevant security policy on this NIST web page.