Secure Cryptographic Operations with Hardware Security Modules

Mevan Karunanayake
4 min readAug 6, 2018

--

Cryptography is the study of different techniques to scramble or change data in order to disguise it. Original data can only be restored by those who are capable of unscramble and re-order it. Even though origin of cryptography can be back around 400CE, today cryptography has become a most essential tool for cyber security. Modern cryptography is based on permutation and substitution of data bits using a key. There is another key(asymmetric key encryption) or same key(symmetric key encryption) to restore the original data from ciphered data.

Cryptographic provider is responsible for carrying out cryptographic operations and key management process. A system’s cryptographic provider can be either software or both hardware and software. Major issue with software cryptographic providers is that there key management process depends on the hardware and OS level security of the server. This is where the hardware security modules(HSMs) comes into the picture. So lets see what is a HSM.

What is a HSM?

A HSM is a trusted, hardened, tamper resistant, dedicated crypto processor designed to perform strengthened cryptographic operations such as encrypting, decrypting, digital signing, digital sign verifying, hashing etc. A HSM has a specially designed, well-tested hardware to perform cryptographic operations faster than a normal computer and security-focused OS to secure sensitive data from intruders. Normally these modules can be attached to a computer or a network sever externally via a USB port. HSM plays a major role in the aspect of system’s security and it can become a single point of failure to the system. Because of that most of the HSM vendors provide capability of using HSM clusters for high availability and load balancing.

Benefits of having a HSM for cryptographic operations

There are several benefits of using HSMs over software cryptographic providers. Some of them are follows :

  • Secured key management process

A cryptographic key passes several phases in it’s life between generation and destruction. A secure and proper mechanism to manage complete life cycle of a cryptographic key is a crucial necessity. Typically in software cryptographic providers, they can only provide logical protection for sensitive materials. But HSMs are good at providing both logical and physical protection. HSMs keep sensitive materials such as private keys, symmetric keys within the HSM throughout their life cycle without exposing them to outside. Since all key operations are taking place inside the HSM so that only authorized users can use the keys. Also HSMs provide additional security by being tamper resistant which means device become inoperable in case of a tampering. A HSM maintains a log containing all information on operations carried out using keys which makes it easier to determine if any intrusions or misuse of keys have been taken place.

  • Increase the throughput of the system

Software cryptographic providers utilize server resources for cryptographic operations causing performance degradation in the server. As I mentioned earlier HSMs are designed and optimized to carry out cryptographic operations more efficiently and securely. Integrating a HSM to a system causes increase in the overall performance of the system since, server resources can be utilized for business logic processing and also HSMs are much faster at crypto processing than a normal CPU.

  • Strong key generation

A cryptographic key shouldn’t be something that is easily determined or calculated. So primary requirement of a cryptographic key is, it should highly random. A computer is a finite state machine, since it is not capable of generating truly random values. But when it comes to HSMs, it uses a special physical processes to generate truly random keys which makes generated keys strong. So keys generated using software are inherently weaker than those generated using HSMs.

  • Can meet current standards and regulations on cyber security

There are international standards and regulations on cyber security a system must adhere regardless of their size or the industry. FIPS 140-2 is an internationally recognized standard for hardware cryptographic devices which defines the level of security provided by them. There are four security levels defined in FIPS 140–2 and almost every HSM in the market is standardized under those levels. So integrating HSMs to a system makes it easier to get compliance with current security regulations.

  • Easy to integrate, configure and use

Most of HSM vendors provide implementations of common standard API PKCS#11 (Will be discussed in my next blog) which makes application development independent of the underlying cryptographic provider. Also vendors provide a proper documentation on how to use the device and required applications to view details of the hardware device making configuration process easier. As I mentioned earlier HSMs comes in form of a plug and play devices which is easier to integrate to a system and use for cryptographic operations after a simple configuration process.

I hope that you got some idea on what is a HSM and what are benefits of having a HSM as a cryptographic provider over a software cryptographic provider. My next blog will be on PKCS #11 standard which is a API specification for hardware cryptographic providers to expose their services to client applications.

Cheers!!!

--

--