Some time ago, I consulted a bank about their cryptography and security processing system, which was painstakingly slow. After one week of trying to find the problem, I looked at the cryptographic subsystem, which used Windows Crypto API and a certified CSP.
The server processed digitally-signed data and its cryptographic library calls were mixed with XML processing, database access and other code. This left the machine with absolutely no CPU time to make cryptographic computations. Their processing farm had 10 servers and they were preparing to add two more.
I asked, “Why don’t you use a hardware security module?” The team leader asked me what that was, while the project managers present kept silent, only nodding quietly. I was surprised by his response. This question could take place in 1985, but not in 2005. Taking a deep breath, I began my lecture about HSMs.
This story had a happy ending. The programming team rewrote the code, offloaded crypto to HSMs and the processing server processed as it should. I like happy endings; so, I’d like to share my successful experience of HSM usage.
The hardware security module (HSM) is a special “trusted” network computer performing a variety of cryptographic operations: key management, key exchange, encryption etc.
It seems to be obvious that cryptographic operations must be performed in a trusted environment. When I say trusted, I mean “no viruses, no malware, no exploit, no unauthorized access.” An HSM is trusted because it:
To prevent scenarios like this, we need to separate the operations into two different areas. One for the business logic and one for cryptography. You then need to entrust the cryptographic operation to a trusted computer aka an HSM.
A cryptographic key must be truly random. A computer by design, is unable to generate a really random value because it is a finite-state machine. Therefore, we need a special physical process to generate random numbers and keys. An HSM has special hardware that uses a physical process to create a good source of randomness (entropy) that in turn is used to generate good quality and “perfectly” random keys.
HSMs have outstanding and incomparable performance. The maximum you can get in any server is n * 1000 digital signatures per second, but an HSM can achieve millions. It performs a small number of tasks, but does so very efficiently because it’s designed and optimized for such tasks.
HSMs are built to protect cryptographic keys. Large-sized banks or corporate offices often operate a variety of HSMs concurrently. Key management systems control and update these keys according to internal security policies and external standards. A centralized design of key management brings the advantage of streamlining the management of keys and providing the best overview for the keys across many different systems.