Chipkarten-Betriebssysteme Wolfgang Effing, Giesecke & Devrient GmbH Vortrag an der TU Dresden am 29. April 2004 1
Chipkarten-Mikrocontroller Chipkarten-Mikrocontroller CPU (CISC, RISC, 8-/16-/32-Bit, Takt, Spannung) Kontaktflächen Modulator + Demodulator + Anti-Kollisionsmechanismus Taktgenerator Coprozessor + Prozessor Arbeitsspeicher NPU (RSA, ECC, DES, CRC) Speicherarten und Eigenschaften: RAM, Flash, EEPROM, ROM Stromaufnahme und Takt NPU RAM Sleep-Mode I/O CLK CPU EEPROM RST Vcc GND ROM Antenne Spannungsregelung + Reseterzeugung Datenspeicher + Betriebssystemteile Betriebssystem RF-Interface Mikrocontroller 1602 1099/MCD 2
Chips im Vergleich SLE 66CX160S Chipgröße: 4.3 x 5.5 mm Chipfläche: 23,65 m² 0,5 µ-prozeß Pentium III Chipgröße: 9,5 x 11 mm Chipfläche: 104,5 m² 0,18 µ-prozeß 3
Modul und elektrische Schnittstellen Versorgungsspannung [5 V; 3 V; 1,8 V] Reset Takt [1 5 MHz] z.zt. nicht benutzt 4 Masse Programmierspannung (i.d.r. nicht mehr benutzt) serielle Schnittstelle z.zt. nicht benutzt
Standards ISO/IEC defines the complete Smart Card OS ISO/IEC 7816-3: Electronic Signals/Transmission Protocols ISO/IEC 7816-4: Organisation, Security, Commands ISO/IEC 7816-5: Numbering System, Registration of application identifier ISO/IEC 7816-6: Interindustry Data Elements ISO/IEC 7816-8: Commands for Security Operations ISO/IEC 7816-9: Commands for Card Management IOS/IEC 7816-11: Personal Verification through biometric methods ISO/IEC 7816-12: USB electrical interface and operating procedures ISO/IEC 7816-15: Cryptographic information application 5
Systematik Systematik der aktuellen Chipkarten- Betriebssysteme Betriebssystem i.d.r. im ROM, Patches u.ä. im EEPROM ( Komplettierung) zeitliche Entwicklung der Betriebssysteme Speicher- und Rechenleistungsanforderungen Chipkarten- Betriebssysteme bibliotheksorientierte Betriebssysteme monolithische Betriebssysteme schichtenorientierte Betriebssysteme C-Netz, GSM (SIM) G+D Maske 3, STARCOS u.ä. Monoapplikation Multiapplikation Interpreterbasiert Compilerbasiert Javacard, Windows for Smartcards maskenbasierte Anwendungen dateibasierte Anwendungen codebasierte Anwendungen 6
Lebenszyklus Testmode, Benutzermode, Feldtestmode Umschaltprozesse (Fuse, PIN o.ä., Authentisierung) Komplettierung, Initialisierung, Personalisierung Anwendungseinbringung (Kartenhersteller, im Feld) ISO-/VOP-Zustände Testmode Usermode Umschalten Hardwaretest Authentisierung Betriebssystemkomplettierung Umschalten Karte gesperrt Authentisierung Authentisierung Anwendungsbenutzung Umschalten Anwendungsinitialisierung Anwendungspersonalisierung 7
Dateisystem, Teil 1 Dateitypen ISO/IEC 7816-4 Verzeichnisse, Daten Verzeichnisse Datendateien Dateiebenen, Anzahl der Ebenen MF (Master File) DF (Dedicated File) EF (Elementary File) Internal EF Working EF MF, DF, EF, EFI, EFW Applikation mit Daten und Schlüsseln MF EF DF DF EF EF DF DF DF-Ebene 1 2 3 8
Dateisystem, Teil 2 Dateinamen MF (Master File) DF (Dedicated File) EF (Elementary File) FID (File Identifier) FID (File Identifier) FID (File Identifier) DF Name SFI (Short FID) Dateinamen sind für Rechner und wenig Speicherplatz optimiert und nicht für Menschen FID, SFI MF FID ist '3F00 DF Name, AID, RID, PIX 0 16 Byte DF Name 5 16 Byte AID RID PIX 5 Byte (obligatorisch) 0 11 Byte (optional) 9
Dateisystem, Teil 3 Zugriffsbedingungen Kommandos Dateien Reihenfolge Parameter Alle Secure Messaging Erzeugen Sperren Entsperren Löschen (Datei) Terminieren Datendateien Lesen Suchen Schreiben Löschen (Inhalt) Vergrößern Zugriffsbedingungen auf Dateien und Kommandos zustandsorientierte / kommandoorientierte Zugriffsbedingungen ISO/IEC 7816-9 Beispiel: Datei bei GSM mit Lesezugriff nach korrekter PIN-Eingabe Beispiel: Zustände in Abhängigkeit von der PIN-Prüfung PIN nicht geprüft PIN-Prüfung erfolgreich PIN-Prüfung nicht erfolgreich Maximalwert der PIN-Fehleingaben erreicht 10
Dateistrukturen EF Strukturen amorph Record orientiert individuell transparent linear fixed linear variable cyclic transparent execute linear fixed linear variable Datenbank Datenobjekte Datengrößen (theoretisch, typisch) cyclic Dateien sind so kompakt wie möglich abgelegt Bytenummer 1 2 3 4 5 n Recordnummer 1 2 Bytenummer 1 2 3 4 5 n Codierung von gespeicherten Daten (z.b.: TLV) 3 m Bytenummer Bytenummer Recordnummer 1 2 1 2 3 4 5 n Recordnummer 1 2 1 2 3 4 5 n 3 3 m m 11
Datenübertragung Anwendungsschicht OSI-Schicht 7 Leitungsschicht OSI-Schicht 2 Physikalische Schicht OSI-Schicht 1 ISO/IEC 7816-4, -7, -9 EN 726-3, 1546-3 GSM 11.11, 11.14 EMV ISO/IEC 7816-3 ISO/IEC 10 536-4 ISO/IEC 7816-3 ISO/IEC 10 536-3 (T=0, T=1) (T=2) (kontaktbehaftet) (kontaktlos) ISO/IEC 7816-3 serielle halb-duplex Kommunikation Master-Slave-Verhalten ATR PPS (ex PTS) TPDU, APDU Ablauf bei ATR, PTS, APDUs IFD (Terminal) ICC (Chipkarte) Reset ATR (Answer to Reset) PTS-Request (optional) PTS-Response (optional) Command-APDU Nr. 1 Response-APDU Nr. 1 12
Systematik der Kommandos Klassen von Kommandos Dateioperationen Sicherheit Dateiverwaltung Hauptaufgaben einer Chipkarte sicheres Speichern von Daten Identifizierung von Personen & Authentisierung von Geräten sicheres Ausführen von Programmen Auswahl Suchen Schreiben/Lesen numerische Operationen Identifizieren Authentisieren Ver-/Entschlüsseln Signieren/Verifizieren Erzeugen/Löschen Sperren/Entsperren Terminieren Datenbank Test & Produktion anwendungsspezifisch Benutzerverwaltung Datenbankverwaltung Datenbankabfrage Telekommunikation Zahlungsverkehr Gesundheit Personenverkehr 13
Systematik der Returncodes Returncodes, SW1 SW2 '9000 bedeutet OK Returncode (SW1 SW2) Prozeß abgeschlossen ( Process completed) Prozeß abgebrochen ( Process aborted) normale Bearbeitung ( Normal processing) Warnung ( Warning processing) Ausführungsfehler ( Execution error) Prüfungsfehler ( Checking error) '61XX' und '9000' '62XX' '63XX' '64XX' '65XX' '67XX' bis '6FXX' NVM geändert NVM nicht geändert 14
STARCOS 3.0 - General Model Command set STARCOS 3.0 is as far as possible a modular Smart Card Operating Systems < 95% Source Code in C Generic functionality Application specific functionality Applications Adding of new applications to the base OS is possible Security Manager I/O File system Basic service functions Cryptog raphy STARCOS Kernel 15
STARCOS 3.0 - Implementation Fully ISO-compliant Smart Card Operating System ISO/IEC 7816-3 Contact Protocols T=0 and T=1 available ISO/IEC 7816-4 All File Types supported, Data Object parallel available Hierarchical File System with more than 8 Levels 4 Logical Channels for Multi-Tasking Mode Secure Messaging All Commands available ISO/IEC 7816-8 All PSO-Commands available RIPEMD 160 and SHA-1 implemented ISO/IEC 7816-9 Administration Commands: Delete, Create, Deactivate available Extended Rules for Access Conditions 16
STARCOS 3.0 - Additional Features Full dynamic file system transparent Files > 32kBytes possible (new ISO-proposal) Flexible Production Models for Initialisation and Personalisation Key Pair Generation on Card Security Certification according CC EAL 4+ (Ongoing) Contact Transmission Protocols T=0, T=1 (USB soon) Contactless T=CL Protocol Type A (ISO/IEC 14443) with 106,212 and 424 KBit/s available Elliptic Curves Algorithms available (GF(P)) Extension of OS with new functionality in EEPROM prepared 17
Security - Logical Authentication Methods Internal Authentication External Authentication Mutual Authentication Card Holder Verification Digital Signature Secure Messaging MACs (Message Authentication Codes) Cryptograms Security Attributes Access Mode (Command Types, Variants, Groups) Access Rule ( DO for SM, Authentication, Digitale Signature) Sessions (Diversified derived keys, Challenge/Response) 18
Security - Physical Data Integrity Internal Checksums Recovery Mechanisms (Rollback/Roll Forward) Protection by Hardware mechanisms (Sensors) Software Measurements against Attacks (DPA/SPA) Attacker Detection in Soft- and Hardware Special Measurements for Secret Protection (PINs/Keys) embedded in OS 19
Command List File related Commands Select Read/Update Binary Read/Update Records Search Record Append Records Create File Delete File DO related Commands Put Data Get Data Authentication Internal Authentication External Authentication Mutual Authentication Security Environment Manage Security Environment Perform Security Operation Compute Digital Signature Hash Verify Digital Signature Verify Certificate Encipher Decipher PIN related Commands Verify Reset Retry Counter Change Reference Data Generate Public Key Pair Get Key Info 20
Used Chip Hardware: P5CT072/P5CD072 8-bit CPU, extended 8051-instruction set Fast internal Clock (till 40 MHz) linear addressable160 Kbytes ROM 72 Kbytes EEPROM 4,5 Kbytes RAM Crypto-Engine Serial UART for contact transmission protocols SIO for ISO/IEC 14443 communication, Type A, till 424 kbit/s available USB controller Internal hardware security measurements 21