HSM For Dummies
HSM For Dummies
in g H a rd wa
Und erstand
keys are
Open the book
and find: Hardwa re S ec urit y
• How HSMs are designed
• What application interfaces
are available today Mod ule s (H SM )
What you need to know • What certification methods
exist
about Hardware Security
• How to start with the
Modules! Utimaco HSM Simulator
HSM
for Dummies
Wiley, the Wiley logo, Für Dummies, the Dummies Man logo, and related trademarks
and trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc.
and/or its affiliates, in the United States and other countries. Used by permission.
Wiley, die Bezeichnung »Für Dummies«, das Dummies-Mann-Logo und darauf bezogene
Gestaltungen sind Marken oder eingetragene Marken von John Wiley & Sons, Inc.,
USA, Deutschland und in anderen Ländern.
Das vorliegende Werk wurde sorgfältig erarbeitet. Dennoch übernehmen Autoren und Verlag
für die Richtigkeit von Angaben, Hinweisen und Ratschlägen sowie eventuelle Druckfehler
keine Haftung.
Chapter 1
How It All Started: A Crypto Recap 11
Payment Systems: The Starting Point for HSMs 12
Signed and Sealed with Standardization 13
Chapter 2
HSM Technology Today 15
HSM Formats 16
Security Requirements 17
HSM Design Principles 17
Physical Protection 18
Standards and Norms 20
Conclusion 20
Chapter 3
The Interface: The Key to the Application 21
Overview of the Current Interfaces for HSMs 22
PKCS#11 Cryptographic Token Interface Standard 23
JCE: Java Cryptography Extension 23
Microsoft Cryptography API: Next Generation 24
Other Standard Interfaces 24
Purposes of Interfaces 25
Selecting the Correct Interface 25
Designing and Realizing Your Own API 26
5
HSM for Dummies
Chapter 4
Certification: A Quality Accolade 27
The FIPS 140 Standard 27
Common Criteria and HSMs 29
What Does Certification Mean for My Project? 30
Appendix
The HSM Simulator 31
Installing the CryptoServer Simulator 31
Launching the CryptoServer Simulator 33
Connecting to the CryptoServer Simulator via CAT 34
Logging On to CryptoServer Simulator as the Admin 35
6
Introduction
Hardware security modules are integrated into the most diverse of applications
nowadays, and are a key part of our modern infrastructures. You’re well versed
in the field of IT security – be it the protection of corporate infrastructures, or
security infrastructures for electronic identities or smart metering. Working in
these fields, you’ve come across hardware security modules, or have worked
more closely with the odd device or two.
In this guide, we give you an overview of hardware security modules (HSMs for
short) – from their historic development and current hardware and software
solutions, to the trends and developments of the future. Alongside, we cover in
detail certification to standards such as FIPS and Common Criteria. Finally, we
introduce the standard interfaces that are currently on the market, and look at
all their benefits and downsides.
With HSM for Dummies at hand, you have an easy reference guide on the sub-
jects of hardware security modules, technologies, interfaces and certifications.
7
HSM for Dummies
This is where you can find interesting tips and more sources of infor-
mation.
This is where the engineer steps in, providing background and infor-
mation on all aspects of HSM technology.
8
Introduction
9
1
How It All Started: A Crypto Recap
In This Chapter
Why HSMs were developed
What initial devices looked like and which techniques they used
What initial forms of standardization and certification existed
I t probably comes as no surprise to you that HSMs were initially invented and
developed for military deployment. Security modules were developed at a
time when running cryptographic operations required special hardware. This is
because the performance of computer systems back then wasn’t exactly up to
mathematical functions. So the obvious approach was to build a coprocessor to
run the cryptography mathematics.
With the Data Encryption Standard (DES), in the late ’70s and early ’80s IBM
then introduced an algorithm to the market that developers could implement ef-
ficiently in hardware. This led to efficient implementations in software and hard-
ware, but evidently a solution for the protection of cryptographic keys used was
still lacking. So the industry developed the first HSMs. Some of the initial de-
vices were fitted with self-destructive technology.
The combination of effective encryption methods (as they were at the time) and
the goal of protecting the computer system on which the algorithm is used drove
forward the development of HSMs. However, HSM technology wasn’t opened up
to the commercial, industrial world until the blanket introduction of Automated
Teller Machines (ATMs).
11
HSM for Dummies
IBM and Racal deployed the first commercial devices at about the same time. Uti-
maco also launched its first device for the German banking system at this time.
Figure 1.1: The first Hardware Security Module ’KryptoServer’ from Utimaco
12
1 How It All Started: A Crypto Recap
With its 3845 (table-top devices) and 3846 (rack-mounted devices) series, IBM
focused entirely on deployment inside the mainframe. Racal’s application focus
was more on alternative deployment for multipurpose usage. Utimaco’s ’Krypto-
Server’ was an ISA(E) embedded card system that supported all the necessary re-
quirements of German banking technology. It was also one of the first commer-
cially available devices that came with active tamper-responding technology.
What was noticeable back then for such devices was the separate input unit, en-
abling security administrators to enter key material. These devices were always
designed so as to satisfy the following requirements:
Physical protection of the data storage areas in which cryptographic keys are
kept. (Protection here means detection of unauthorised access.)
Moving of program code relevant to security inside the HSM.
Access control supported by means of a permissions-and-roles model.
13
2
HSM Technology Today
In This Chapter
Delineation of HSMs from smartcards and crypto devices
Hardware security module formats of today
Security requirements for hardware security modules
HSM design principles
Physical security mechanisms
Standards and norms for HSMs
S earch for ‘hardware security modules’ in your browser. You find links to
The Wikipedia definition of hardware security modules
Manufacturer websites
Other definitions
A tip: don’t enter ‘HSM’ or you’ll end up with the High School Musical
movie!
Searching for the term ‘hardware security modules’ on the internet brings up
different manufacturer sites and numerous definitions. Unfortunately, many ar-
ticles out there still put HSMs on a par with chip cards, and compare them.
Here’s an example: ‘Hardware security modules (HSMs), like smartcards, are
hardware devices that are used to store cryptographic key material in a secure
way and to perform cryptographic operations’ (NetKnights, 2014). The compari-
son isn’t wrong, but it doesn’t highlight the full capabilities of HSMs in terms of
computing speed and data-processing volume that we’re familiar with today in
modern data centers.
15
HSM for Dummies
HSM Formats
The classic format of an HSM is certainly the plug-in card. This is essentially an
adapter card via which the secured computer unit enables the connection to the
host computer, and that simultaneously activates the secured area of the hard-
ware module. Figure 2.1 shows different variants of HSMs that we explain in
more detail further on.
Can you see the benefits of the plug-in card over the server variant?
The card is the product of choice when the requirement is a one-to-
one relationship between the application and the trust anchor (HSM).
The network appliance is the preferred form factor for use in data cen-
ters where it operates as the root of trust for distributed applications.
16
2 HSM Technology Today
Security Requirements
Over the years, the security requirements of HSMs have remained essentially the
same, satisfying the following needs:
Protection against attacks on the HSM device hardware – tamper resistant
Protection from side channel attacks, such as timing attacks and differential
power analysis (so attacks that draw conclusions on the keys based on time-
based behavior or power consumption of the devices)
Protection of the cryptographic application environment
Protection of the software environment from tampering and loading of
third-party programs
Generation of keys by an authentic true random number generator
Support of all cryptographic operations currently established (signing, en-
crypting and so on)
These are the fundamental, across-the-board requirements that define HSMs.
(We intentionally omit the whole subject of interfaces at this point, and discuss
this in detail in Chapter 3.)
17
HSM for Dummies
Bear in mind that the separation of duty may not be the case in all ap-
plications. In addition, the communication channel to the HSM must
be protected.
So when applications are using an HSM, the security zone provides maximum
protection from key information being subjected to spyware. The security zone
and secure communication channel guarantee that no information can enter the
outside world, in particular when an attacker steals a device from its operating
environment.
Physical Protection
As we’ve seen, the security zone in the HSM is particularly important. In con-
trast to the security mechanisms for smartcards and security chips, HSMs use a
combination of mechanical, sensory and logical components as protection
mechanisms.
Essentially, two types of physical protection exist for commercially available
HSMs:
Tamper resistance: This is the most widespread method for protecting
HSMs. The objective is to make it as difficult as possible for an attacker to
physically get to the circuitry. Coating the entire circuitry with an epoxy-like
resin is a proven method.
18
2 HSM Technology Today
19
HSM for Dummies
Conclusion
You’ve seen in this section which design principles, which security requirements
and which physical protection measures are deployed for HSMs. We’ve also brief-
ly introduced to you the current standards for HSMs. These fundamental defini-
tions appear also in the different certification schemes, such as FIPS and Com-
mon Criteria. Please head to Section 4 for more information.
20
3
The Interface:
The Key to the Application
In This Chapter
Which interfaces exist today for HSMs
The purpose of each interface
W e’re all familiar with the logical software interfaces in IT. Taking a look at
an HSM means being faced with different interfaces for which the diverse
array of applications and operating systems is designed. Looking at application
interfaces (hereafter called APIs) from the viewpoint of the HSM means identify-
ing three APIs that are essentially logically independent:
21
HSM for Dummies
For today’s function interfaces for HSMs, such as PKCS#11, the de-
signing committees realize some of the key management and user
management functions over the command interface. Unfortunately,
developers have mixed different APIs here, which can result in security
vulnerabilities in the device if application programmers don’t imple-
ment it properly.
Now we take a look at the APIs of HSMs from the viewpoint of the calling appli-
cation. We start with a definition of the security API:
The security API enables non-trusted code run within an application to access
the sensitive resources of an HSM in a secure manner. It’s the interface between
running processes on the host system and the HSM.
22
3 The Interface: The Key to the Application
Benefits
One of the key benefits of the PKCS#11 interface is interoperability between ap-
plication and security module. PKCS#11 also offers a universal approach for
symmetric as well as asymmetric cryptographic methods.
Downsides
However great the aforementioned interoperability may be, many manufacturers
have installed enhancements, or vendor defined mechanisms, in their PKCS#11
implementation, and so have reduced the benefit of manufacturer neutrality to
absurdity. The standard has also developed such a high level of complexity that
attacks on the interface in particular have very high success rates with sequences
of commands. Take a look at this article, http://www.dsi.unive.it/
~focardi/Articoli/bmfs-ASA09.pdf, which describes the problem very
well.
The JCE is part of the Java Cryptography Architecture (JCA). The split
into JCE and JCA meant that in the past the API could comply with US
restrictions for cryptography. Because the JCA contains only hash
functions, key generators and so on, they could be freely exported.
The JCE is based on a provider model that enables programmers to link in differ-
ent cryptographic models. The JCE is independent of the implementation of the
23
HSM for Dummies
specific algorithms (as is the JCA). The JCE can use a Service Provider Interface
(SPI) to link different implementations from different suppliers into the Java run-
time environment simultaneously. From Version 1.4, Java has a JCE and JCA im-
plementation. The provider can subsequently load other implementations both
statically and dynamically. The JCE Provider from the Institute for Applied Infor-
mation Processing and Communication Technology (IAIK) at the Technical Uni-
versity of Graz (Austria) is one of the most widely known JCE implementations.
But what would IT be without its exceptions? Microsoft has another interface for
HSMs in the field of database servers. This is a SQL server data encryption func-
tion Extensible Key Management (EKM). This function interface makes it possi-
ble to use an HSM to realize database encryption stipulated in many application
areas. The EKM interface is essentially another standard Microsoft interface.
24
3 The Interface: The Key to the Application
Purposes of Interfaces
The interface for communication with cryptographic devices is, unfortunately,
an Achilles’ heel in the deployment of HSMs. An HSM is a system offering the ca-
pability to represent a very high level of complexity. But from this attribute
comes the potential to make major implementation errors and therefore enable
a successful attack by means of a combination of different command structures.
25
HSM for Dummies
Apache Tomcat
TrueCrypt
Oracle Database
Also, different security applications (such as a Public Key Infrastructure (PKI)
application or card-management system) naturally provide the capability of link-
ing in an HSM using a defined interface.
But you need to exercise caution. Only seasoned experts should design
and implement a security API. Involving outside experts is also very
helpful.
26
4
Certification: A Quality Accolade
In This Chapter
Which certification schemes currently exist for HSMs
The benefits and downsides of HSM certifications
What you, as a user, must know about certifications
I n order to assess the quality and security level of a device for the purposes of
information security, product companies can perform expert assessment and
subsequent certification in accordance with defined test regulations and require-
ment lists. Addressing the issue of certification for HSMs is actually relatively
easy. Only two globally recognized certification schemes exist:
FIPS: The Federal Information Processing Standards Publications (FIPS
PUBS) is from the National Institute of Standards and Technology.
Common Criteria: The Common Criteria for Information Technology Secu-
rity Evaluation is an international standard for the testing and evaluation of
the security properties of IT products.
But certification isn’t as easy as it appears, because a broad array of diverse audit-
ing and certification schemes exists in different national industries. In the Ger-
man credit business, for example, separate requirements for HSMs exist for
deployment in monetary transaction networks. The payment card industry also
has its own definitions for HSMs.
27
HSM for Dummies
The CMVP website has all information you could want on FIPS 140;
see http://csrc.nist.gov/groups/STM/cmvp/index.html.
The ‘Module Validation Lists’ section has an overview of certified de-
vices sorted by manufacturer. The ‘Modules in Process’ section con-
tains all manufacturers whose modules are currently under evalua-
tion.
28
4 Certification: A Quality Accolade
The security requirements that are detailed and specified in the standard address
a total of 11 areas of design and implementation of products in applied cryptog-
raphy. The standard differentiates between four security levels (from lowest, 1, to
highest, 4) depending on the scope of these requirements.
FIPS 140 is a key basis for the certification of products with cryptographic func-
tions. Successful certification to FIPS 140-2 entails certification of an overall se-
curity level (1 to 4) and also individual test results in different areas. For specific
applications, the latter are of far more informational value than the overall re-
sult.
29
HSM for Dummies
If you’re searching for protection profiles for an HSM, you’ll find protection pro-
files for so-called security modules. Caution is called for here, because these are
only security modules in smartcard format. The only protection profile that’s
currently evaluated and published is provided by the German Federal Office for
Information Security (BSI) with the number BSI-CC-PP-0045: Cryptographic
Modules, Security Level ‘Enhanced’.
30
A
Appendix
The HSM Simulator
Y ou can start your own »software« HSM today by downloading the fully func-
tional Utimaco HSM Simulator. The Simulator package comes with the 100-
percent-functional HSM Runtime, including all administration and configura-
tion toolsets. You’ll also find a comprehensive library of integration and how-to
guides, so that you can integrate the HSM directly into your standard applica-
tion.
This chapter provides step-by-step instructions on how to download the Crypto-
Server Simulator, install it on a computer and start administrating the Crypto-
Server. It doesn’t cover all scenarios, and is intended to supplement the product
documentation provided on the SecurityServer product CD.
For detailed information on the full range of setup and configuration options,
please read the CryptoServer Manual for System Administrators 2.
31
HSM for Dummies
32
A Appendix: The HSM Simulator
33
HSM for Dummies
If you selected the ‘launch CAT’ option during the installation process,
the CAT is still running.
34
A Appendix: The HSM Simulator
For security reasons you should replace the default admin keyfile set-
tings with your own generated keyfile. To learn more about the key
material please consult the document ‘CryptoServer_Manual_System-
adminstrator.pdf’. You find this file in your install directory, in the
subfolder ‘Documentation/Administration Guides/’.
For integration into various applications, please look up the integration guides.
35
HSM for Dummies
36
Notes
37
Notes
38
Notes
39
Notes
40
Notes
41
Notes
42
Notes
43
Notes
44
Notes
45
Notes
46
Notes
47
Notes
48
Know where your re S e curity Modules
in g H a rd wa
Und erstand
keys are
Open the book
and find: Hardwa re S ec urit y
• How HSMs are designed
• What application interfaces
are available today Mod ule s (H SM )
What you need to know • What certification methods
exist
about Hardware Security
• How to start with the
Modules! Utimaco HSM Simulator