Mastercard Secure Messaging
Derive session keys, encrypt a PIN block and calculate a command MAC.
Use test data. No commands are sent to a card.
Session keys
Enter card-specific UDKs, not issuer master keys. Uses AC-based common derivation without parity adjustment. The common session key stays constant across commands in the same session; command-specific MAC data must still follow the card profile.
PIN encryption
ISO 9564 format 2, encrypted under TDES. The eight-byte block needs no extra padding for this Mastercard profile.
MAC
Enter the exact authenticated bytes, including any required header and transaction data. The tutorial includes its final 80 padding marker; choose the matching input mode.
Calculator reference
Verification evidence and limitations →
What it calculates
Derive session keys, encrypt a PIN block and calculate a command MAC.
Inputs and methods
Enter the HEX and decimal fields labelled on each tab. Profile-specific lengths are enforced.
Worked example
Worked Session keys example: UDK-SMI · HEX, 16 bytes: 0123456789ABCDEFFEDCBA9876543210; UDK-SMC · HEX, 16 bytes: 0123456789ABCDEFFEDCBA9876543210; Application cryptogram · HEX, 8 bytes: 0102030405060708
Diversification value: 0102030405060708 SK-SMI: 72069E08CAC5BC2A1E06947B7B12B20E SMI KCV: DF2591 SK-SMC: 72069E08CAC5BC2A1E06947B7B12B20E SMC KCV: DF2591
Specification and limits
This demonstrates the first tab only. Other stages need their own profile inputs; outputs do not prove issuer authorization.
PyEMV ↗