TR-31 Key Block

Wrap and unwrap ANSI X9.143 / TR-31 key blocks (versions A–D, AES and TDES), with optional blocks and published test vectors.

Learn: K4 TR-31 key blocks
Wrap Unwrap

Keys

AES key: 32, 48 or 64 hex Random AES-128 AES-192 AES-256
Hex digits Random AES-128 AES-192 AES-256

Header

D — AES key derivationB — TDES key derivationC — TDES key variantA — key variant (deprecated)
B0 — BDK — base derivation keyB1 — DUKPT initial key (IPEK / IK)B2 — Base key variant key (deprecated)B3 — Key derivation key (non-X9.24)C0 — CVK — card verification keyD0 — Data encryption — symmetricD1 — Data encryption — asymmetricD2 — Decimalization table encryptionD3 — Sensitive data encryptionE0 — EMV IMK — application cryptogramsE1 — EMV IMK — secure messaging, confidentialityE2 — EMV IMK — secure messaging, integrityE3 — EMV IMK — data authentication codeE4 — EMV IMK — dynamic numbersE5 — EMV IMK — card personalizationE6 — EMV IMK — otherE7 — EMV asymmetric key pair for PIN encryptionI0 — Initialization vector (IV)K0 — Key encryption / wrapping key (KEK)K1 — TR-31 key block protection key (KBPK)K2 — TR-34 asymmetric key pairK3 — Asymmetric key pair — key wrapping / agreementK4 — ISO 20038 key block protection keyM0 — MAC — ISO 16609 algorithm 1 (TDES)M1 — MAC — ISO 9797-1 algorithm 1M2 — MAC — ISO 9797-1 algorithm 2M3 — MAC — ISO 9797-1 algorithm 3 (retail MAC)M4 — MAC — ISO 9797-1 algorithm 4M5 — MAC — ISO 9797-1:1999 algorithm 5M6 — MAC — ISO 9797-1:2011 algorithm 5 (CMAC)M7 — HMAC keyM8 — MAC — ISO 9797-1:2011 algorithm 6P0 — PIN encryption key (PEK / ZPK)P1 — PIN generation keyV0 — PIN verification — KPV, other algorithmV1 — PIN verification — IBM 3624V2 — PIN verification — Visa PVVV3 — PIN verification — X9.132 algorithm 1V4 — PIN verification — X9.132 algorithm 2S0 — Asymmetric key pair — digital signatureS1 — Asymmetric key pair — CA keyS2 — Asymmetric key pair — non-X9.24
A — AEST — Triple DES (TDEA)D — single DES (DEA, legacy)H — HMACR — RSAE — Elliptic curveS — DSA
B — encrypt and decrypt / wrap and unwrap ✓ typicalD — decrypt / unwrap only ✓ typicalE — encrypt / wrap only ✓ typicalC — generate and verify (MAC, CVV, PIN check)G — generate onlyN — no special restrictionsS — signature onlyT — sign and decryptV — verify onlyX — derive other keysY — create key variants
E — exportable under a KEK (X9.24-compliant form)N — non-exportableS — sensitive: exportable in a non-X9.24 form
0 — storage or key exchange1 — storage only2 — key exchange only
Two characters; 00 = not used.
Header preview D····P0AE00E0000

Optional blocks

None. Add blocks for a DUKPT key set ID (KS / IK), a time stamp, a label… The padding block (PB) that aligns the header is added for you.

Add block

Wrap

Fixed pad — to reproduce a test vector
Leave empty for a random pad. Length field + key + pad must fill whole cipher blocks.
Wrap key AES example TDES example Clear
Hex digits
Unwrap key AES example TDES example
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.