Hardware key management in IBM Z (IBM Z mainframe systems) is built around a strict hardware-rooted trust model, where cryptographic keys are never exposed in plaintext outside secure hardware boundaries. It combines specialized cryptographic hardware, hierarchical key encryption, and system software control.
Hereβs how it works end-to-end.
π 1. Root of Trust: Master Key in Hardware
At the center of IBM Z key management is the Master Key, stored inside secure cryptographic hardware:
-
Stored in:
-
Crypto Express adapters (CEX HSMs)
-
On-chip cryptographic coprocessors (CPACF for some functions)
π The Master Key is:
-
Never visible in plaintext to OS or users
-
Entered only through secure procedures (manual or secure load)
-
Protected inside tamper-resistant hardware
This creates a hardware root of trust.
π§© 2. Key Hierarchy (Core Concept)
IBM Z uses a layered key structure:
π Master Key (top level)
-
Resides in Crypto Express hardware
-
Used only to encrypt other keys
β
π Key Encryption Keys (KEKs)
-
Derived/enciphered under the Master Key
-
Used to protect operational keys
β
π Data Keys (working keys)
-
Used for actual encryption of data (DBs, files, TLS, etc.)
-
Always stored in encrypted (wrapped) form
π Important rule:
Keys are always stored βwrappedβ (encrypted), never plain.
ποΈ 3. How Key Storage Works (Step-by-Step)
Step 1: Key generation
A key is generated inside:
-
Crypto Express HSM or
-
ICSF (Integrated Cryptographic Service Facility) using hardware support
Step 2: Key wrapping
-
The key is immediately encrypted using a KEK or Master Key
-
Result = secure key token
Step 3: Storage
-
Wrapped key is stored in:
-
z/OS datasets
-
Databases
-
Security repositories (RACF profiles)
Step 4: Usage
When needed:
-
System sends encrypted key to HSM
-
HSM decrypts it internally
-
Performs crypto operation inside hardware
-
Plain key never leaves hardware boundary
π§ 4. Role of ICSF (Key Management Controller)
On z/OS ICSF, key management is controlled by:
-
Key generation
-
Key wrapping/unwrapping
-
Key lifecycle (rotation, deletion)
-
Secure APIs for applications
ICSF acts as the software interface to Crypto Express hardware.
π‘οΈ 5. Crypto Express (Hardware Security Boundary)
Crypto Express adapters enforce:
-
Secure key storage in HSM memory
-
Master Key isolation
-
Cryptographic domain separation
-
Secure execution of cryptographic instructions
They support modes like:
-
CCA (banking / enterprise secure key crypto)
-
EP11 (PKCS#11 HSM standard)
π 6. Key Protection via RACF Integration
Security policy is enforced by:
z/OS RACF
RACF controls:
-
Which user or LPAR can use a key
-
Key access permissions
-
Cryptographic role-based security
π Even if a key exists, it cannot be used without RACF authorization.
π§© 7. Secure Key States in IBM Z
Keys typically exist in 3 states:
| State | Description |
|---|
| Plain key | Exists only inside HSM during computation |
| Wrapped key | Encrypted under Master/KEK |
| Exported key | Rare; still encrypted for external use |
βοΈ 8. Multi-tenant isolation (LPAR level)
IBM Z supports multiple workloads using the same hardware via:
-
LPARs (Logical Partitions)
-
Crypto domains in Crypto Express
Each domain:
-
Has its own Master Key
-
Cannot access other domainsβ keys
π 9. Real-world usage flow (TLS example)
When a secure connection happens:
-
TLS handshake starts
-
Private key is stored as a wrapped key
-
HSM unwraps key internally
-
Cryptographic signing happens inside hardware
-
Result returned, key never exposed
π§Ύ Simple Summary
Hardware key management in IBM Z works like this:
-
π Master Key is stored inside Crypto Express HSM
-
π§© All keys are encrypted under this Master Key
-
βοΈ ICSF manages lifecycle and APIs
-
π‘οΈ RACF controls who can use keys
-
π Keys are always wrapped outside hardware
-
π« Plain keys never leave secure hardware