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.

It seems that the majority of commercially available hardware HSMs are only designed to allow authenticated users to generate, store, and use cryptographic keys with various cryptographic algorithms implemented within the firmware of the HSM.

Reading the datasheets it looks like I can use the provided API to make my (external) application interact with the HSM and use its cryptographic muscles, maybe using keys generated/stored within the HSM. But, it seems that long term storage of the data/objects cryptographically processed by the HSM within the HSM boundary is not available.

Why aren’t there any HSMs that allow for user code and user data to be persistently stored and managed within the physically protected memory space of the HSM?

Does anybody have experience with HSMs and could point me towards a commercially available hardware HSM solution that at the least allows me to store some registers beyond cryptographic keys?

Ideally I would like my application to be stored at rest in the HSM boundary, executed by the same processor that runs the crypto provided by the HSM and to persisytently store a few registers within the HSM's protected area.

share|improve this question
add comment

4 Answers

up vote 10 down vote accepted

The Thales nShield HSM (previously nCipher) allow for generic programming. This is a rather expensive option; it must first be enabled in the HSM (through a "feature file" which is signed by Thales and specific to the serial number of a HSM), and then the extra code can run as long as it is signed with a key known to the HSM for such usage.

With that option, you will get a C compiler with a reduced C library, and some API which give access to the HSM features. The internal OS allows for one process (but multi-threaded) and cryptographic operations are done with transactions; there are also transactions to exchange arbitrary binary blobs with the external world (the host PC). The core CPU is not very powerful (think 60 MHz ARM or PowerPC) but there is some substantial RAM (megabytes, even dozens of megabytes).

Thales/nCipher HSM do not have a lot of permanent storage features (there are a few kilobytes of EEPROM but that's all). Actually, the HSM only stores a master key (which you cannot access), and everything, including the "keys" which are "in the HSM" are off-loaded, with encryption. You can do the same: store your data stored on the host, sent back to your internal module; the data is encrypted with one of the keys (which are virtually "in the HSM"), and your code in the HSM does the decryption.

share|improve this answer
2  
Resources available for application development: • 16MB standard RAM, • 32 MB RAM for JVM development • 8 KB non-volatile RAM for secure user memory • Real-time clock –  Drew Lex Nov 28 '12 at 0:36
    
Does anybody know the approximate cost for the development tools and HSM? –  Drew Lex Dec 6 '12 at 22:07
    
Thales would probably be eager to respond to you, but the order of magnitude would be 10000$ (I am not entitled to give prices, but don't expect it to be as cheap as a PC, even a big one). –  Thomas Pornin Dec 7 '12 at 1:04
add comment

The reason that there are no HSMs that allow user code to be stored is that isn't what they are for. HSMs a) take the cryptographic load off of systems, and b) (arguably to some) make enterprise cryptographic security better through the use of hardened, single-purpose boxes.

Allowing user code to be stored dilutes the purpose of the HSM, having some detrimental effects:

  • Shows them down: putting HSM system resources to other uses makes them less available for their needed purpose
  • Increases their attack surface: it is easier to harden a box if it has as few entry and exit points as possible. Adding all sorts of functionality would greatly decrease their security
  • User code and data could be used as an attack vector. Why would you want a high security system processing user generated data of unknown nature?

It sounds inviting to use HSMs for purposes other then their stated use, they are expensive and powerful, however it's not a good idea, so those types of features generally aren't offered.

share|improve this answer
1  
I have found one HSM family that allows for third party applications to be run by the HSM - CodeSafe™ Developer Kit which is supported by some nCipher HSMs. –  Drew Lex Nov 27 '12 at 9:14
add comment

The Utimaco/Sophos HSM has got plenty of FLASH for internal storage of keys, which you can manage via (for instance) the PKCS#11 interface.

If you want to develop your own cryptographic algorithms or security protocols , there is also an SDK available. The CPU is a bit exotic (Texas Instruments DSP), but it is fully programmable in C and comes with a simulator. Code loading is simple and very well-thought through, with proper authentication and possibly code encryption.

Bonus point: certain models have partial support for FIPS 140-2 Level 4 (that is, active zeroization of root secrets in case of physical attack), if that sort of stuff makes your boat float. Of course, keep in mind that if you develop your own firmware, the FIPS certification is not valid anymore.

share|improve this answer
add comment

SafeNet HSMs allow for the loading of custom code into the module. Depending on the requirements, there are different options available.

share|improve this answer
    
Mark, welcome to Information Security. If you have a commercial relationship with a vendor you are referring to, it is considered good form to disclose this relationship in your answer. See the FAQ... –  AviD May 30 '13 at 9:22
add comment

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.