Secure Messaging
ProtocolAn ISO 7816-4 mechanism that applies cryptographic integrity and confidentiality protection to individual APDU commands and responses exchanged between card and host.
What Is Secure Messaging?
APDU command/response pairs." data-category="Protocol">Secure Messaging (SM) is an ISO 7816-4 mechanism that wraps individual APDU commands and responses with cryptographic integrity and confidentiality protection. When secure messaging is active, the data field of each APDU is encrypted, and a message authentication code (MAC) is appended, ensuring that neither the command nor the response can be eavesdropped or tampered with during transmission between the card and the host.
Secure messaging is the foundation of higher-level secure channel protocols like SCP03 in GlobalPlatform and the PACE/BAC protocols in ePassport applications.
How Secure Messaging Works
ISO 7816-4 defines two levels of protection applied to APDU data:
- Integrity (MAC only) -- a cryptographic checksum computed over the command header and data field. The card verifies the MAC before processing the command, rejecting tampered messages.
- Confidentiality + Integrity -- the command data is encrypted (typically with AES or 3DES) and then a MAC is computed over the encrypted payload. This prevents both eavesdropping and modification.
The CLA byte of the APDU indicates whether secure messaging is applied:
| CLA Bit Pattern | SM Mode |
|---|---|
| 0x0C | Command header + data authenticated and encrypted |
| 0x04 | Command header authenticated, data in plain |
| 0x00 | No secure messaging |
TLV Encoding
Secure messaging uses BER-TLV (Tag-Length-Value) encoding within the APDU data field. Protected data objects use specific tags:
- Tag 87 -- padding indicator + encrypted data (confidentiality)
- Tag 97 -- expected response length (Le) under SM
- Tag 8E -- cryptographic checksum (MAC, typically 8 bytes)
- Tag 99 -- processing status (SW1-SW2) under SM in responses
Practical Applications
Secure messaging is mandatory in several smart card ecosystems:
- GlobalPlatform AES-based secure channel protocol." data-category="Software">SCP03 -- all card management operations (applet install, key rotation) are protected by AES-based secure messaging.
- ePassport BAC/PACE -- biometric data retrieval requires establishing a secure messaging session first.
- eID cards -- personal data access is protected by secure messaging with session keys derived from PACE authentication.
Without secure messaging, APDU exchanges travel in plaintext over the contact pad or RF interface, making them vulnerable to interception in shared-reader environments.
Related Content
ISO 7816 Parts Guide
Standards & Protocols…nB 1B 1B Field Meaning CLA Class byte — channel number, secure messaging indicator INS Instruction — e.g., 0xA4 SELECT, 0xB0 READ…
Smart Card Cryptography
Security…with associated data (AEAD) and is preferred for in-applet secure messaging. Cards claiming Common Criteria EAL4+ must implement at…
eSIM and Remote SIM Provisioning
Industry Applications…Data Preparation+ Encrypts and packages operator profiles SM-DP+ Subscription Manager — Discovery Server Routes devices…
Smart Card in IoT
Industry Applications…eSIM (SGP.22), M2M eSIM uses a push model: the operator's SM-SR pushes profile updates to the device without any user…
SIM to eSIM Migration Guide
Industry Applications…on unboxing M2M scale Manage millions of devices via SM-SR Fleet provisioning without field visits RSP (Remote SIM…
Card Personalization Systems
Developer Tools…ISO/IEC 27001 Information security management GSMA SAS-SM For SIM/eSIM personalisation The issuer typically audits…
Pertanyaan yang Sering Diajukan
The smart card glossary is a comprehensive reference of technical terms, acronyms, and concepts used in smart card technology. It covers protocols (APDU, T=0, T=1), security (Common Criteria, EAL, HSM), hardware (SE, EEPROM, contact pad), and applications (EMV, ePassport, eSIM). It serves developers, product managers, and engineers.
Yes. SmartCardFYI provides glossary definitions in 15 languages including English, Korean, Japanese, Chinese, Spanish, Portuguese, Hindi, Arabic, French, Russian, German, Turkish, Vietnamese, Indonesian, and Thai.