Matthias Brüstle Smart Cards mit SOSSE sind lecker 1 SOSSE Simple Operating System for Smartcard Education Matthias Brüstle <m@mbsks.franken.de> Kommunikationsnetz Franken e.v.
Matthias Brüstle Smart Cards mit SOSSE sind lecker 2 Overview Smart Card Operating System Open Source GPLed Runs on easily available hardware Suitable for education Not suitable for security applications
Matthias Brüstle Smart Cards mit SOSSE sind lecker 3 Why? Open Source PC operating systems: */Linux, *BSD No equivalent for smart cards Only cards with VMs (Java, MEL, Basic) Therefore no tinkering on OS level No easy way to learn smart card OS programming And not promotion of pay TV cracking!
Matthias Brüstle Smart Cards mit SOSSE sind lecker 4 Smart Card Hardware AVR commercial of the shelf controller: AT90S8515/35: 512B RAM, 8kB Flash, 512B EEPROM ATmega161: 1kB TAM, 16kB Flash, 512B EEPROM Packaged as smart card from satellite shops (Funcard) Card flashing devices
Matthias Brüstle Smart Cards mit SOSSE sind lecker 5 In System Programming Flash and EEPROM writeable with special protocol
Matthias Brüstle Smart Cards mit SOSSE sind lecker 6 Design of SOSSE Similar to commercial systems Based on ISO/IEC 7816 Reduced functionality because of small code space: 8kB 16kB Flash Commercial 6kB 300kB Flair of phase 1 GSM SIM
Matthias Brüstle Smart Cards mit SOSSE sind lecker 7 Design of SOSSE Modular Unneeded parts can be omitted Frees code space for own code Implemented in C Easier to understand Portable Modern card operating systems are also developed in C
Matthias Brüstle Smart Cards mit SOSSE sind lecker 8 Development Software GNU C Compiler for the AVR Small code size even compared to commercial compilers GCC 3.0.2 for classic AVR: 486 bytes SDCC 2.3.0 for classic AVR: 1030 bytes Code Vision AVR 1.0.2.1b for classic AVR: 476 bytes Keil C51 6.11d for 8051 (compact memory model): 377 bytes
Matthias Brüstle Smart Cards mit SOSSE sind lecker 9 Development Software (cont.) Software for writing binary to card: PonyProg TwoProg...
Matthias Brüstle Smart Cards mit SOSSE sind lecker 10 Building Blocks Hardware Abstraction Layer Filesystem Transactions Streams Access Control Cryptography Commands
Matthias Brüstle Smart Cards mit SOSSE sind lecker 11 Hardware Abstraction Layer Improves portability Provided functions: Initialization of hardware I/O: with T=0 error recovery EEPROM: Continuous address space for all EEPROMs RNG: True or pseudo random number generator
Matthias Brüstle Smart Cards mit SOSSE sind lecker 12 Hardware Abstraction Layer (cont.) Supported Systems: AVR Internal and external EEPROM Unix (*/Linux) No T=0 error recovery
Matthias Brüstle Smart Cards mit SOSSE sind lecker 13 File System Very simple to reduce code size MF, DFs and transparent (plain) EFs supported 6 byte file header: Size 2 bytes File body length FID 2 bytes File ID Type 1 byte File type (DF, tr. EF) AC 1 byte Access contr (PIN/Key)
Matthias Brüstle Smart Cards mit SOSSE sind lecker 14 Cryptography Small code size Doesn t have to be very strong TEA fits well on AVR architecture 658 bytes on AVR Over 1kB on other 8bit architectures Standard authentication commands External Authenticate Internal Authenticate
Matthias Brüstle Smart Cards mit SOSSE sind lecker 15 Commands Create / Delete Select Read / Update Binary External Authenticate / Get Challenge Internal Authenticate Change / Unblock / Verify PIN Get Response Read / Write EEPROM
Matthias Brüstle Smart Cards mit SOSSE sind lecker 16 Development Aids Doxygen documentation User manual Source documentation CT API library with virtual reader and card Development and testing without AVR hardware Easy debugging
Matthias Brüstle Smart Cards mit SOSSE sind lecker 17 Project Suggestions Encryption of external EEPROM with system key Encryption of total EEPROM with user key Card intrusion detection Mobile firmware storage Remotely keyed encryption system Elliptic Curve Cryptography (ATmega)
Matthias Brüstle Smart Cards mit SOSSE sind lecker 18 Links SOSSE: http://www.mbsks.franken.de/sosse/ AVR: http://www.atmel.com/atmel/products/ prod23.html GCC: http://combio.de/avr/ TEA: http://www.cl.cam.ac.uk/ftp/users/djw3/ tea.ps Rankl, W.; Effing, W. Handbuch der Chipkarten, 4. Aufl.; Hanser: 2002
Matthias Brüstle Smart Cards mit SOSSE sind lecker 19 Mahlzeit Matthias Brüstle m@mbsks.franken.de ftp://ftp.franken.de/pub/crypt/chipcards/