Software- und Systemsicherheit
| Titel: | Software- und Systemsicherheit |
| Dozent(in): | Dr. Kurt Stenzel, Nina Moebius, Marian Borek |
| Termin: | Vorlesung: Di, 12:15-13:45 (erste Vorlesung am 18.10.2011) |
| Gebäude/Raum: | Vorlesung: Raum 1058 N (Informatikgebäude) |
| Ansprechpartner: | Nina Moebius |
Downloads:
Inhalt der Lehrveranstaltung:
Überblick
Der Lehrstuhl Softwaretechnik und Programmiersprachen bietet im WS 2011/12 die Veranstaltung "Software- und Systemsicherheit" (integrierte V + Ü) an. Grundlegende Sicherheitsaspekte bei der Entwicklung von Software werden am Beispiel Smartcards (Chipkarten mit einem Prozessor) verdeutlicht. Smartcards erhalten immer größere Verbreitung - aktuell sind mehrere Milliarden weltweit im Einsatz. Sie sind flexibler und sicherer als Karten mit Magnetstreifen und erobern sich einen riesigen Zukunftsmarkt von Anwendungen. Der neueste Trend geht in Richtung multi-applikativer Karten, die mehrere `Anwendungen' enthalten, und auf die dynamisch neue Anwendungen geladen werden können. Beispiele hierfür sind digitale Unterschrift, elektronische Geldbörse, intelligente Tickets, Loyalty Cards etc. Die Veranstaltung bietet einen Einstieg in die neueste Chipkartentechnologie. Für die Programmierung wird die Sprache JavaCard verwendet, die eine Teilmenge von Java ist. Da eine Chipkarte nur sehr beschränkte Ressourcen hat, ist das Einsparen von Speicherplatz oberstes Gebot. Neben der korrekten Programmierung ist das richtige Design der Kommunikationsprotokolle (zum Schutz vor Hackern, dem Verlust von Daten usw.) ein entscheidendes Sicherheitskriterium. Die Veranstaltung ist eine integrierte Vorlesung und Übung. In dem Vorlesungsteil werden Kenntnisse in JavaCard, der Chipkartentechnologie, dem Design der Anwendungsprotokolle und in kryptographischen Methoden vermittelt. In dem praktischen Teil werden am Rechner (und Chipkartenleser) in Zweiergruppen mehrere JavaCard Anwendungen erstellt (als größte Anwendung eine elektronische Bahnfahrkarte, die es in dieser Form noch nicht gibt). Dabei müssen die Protokolle spezifiziert und die Chipkarte sowie die Terminals mit GUI programmiert werden. Als Chipkarten werden Java SmartCards von Giesecke & Devrient eingesetzt, die 64 K EEPROM, 3DES und 1024 Bit RSA bieten.
![]()
Organisatorisches
Vorkenntnisse:
- Unbedingt erforderlich: Programmierkenntnisse in Java, Software-Engineering (Info II, Sopra, Softwaretechnik)
- Nicht erforderlich: Kenntnis kryptographischer Protokolle
Wert: 8 Leistungspunkte
Anforderungen: Erfolgreiche Teilnahme an den Übungen, Hausarbeit, Abschlußprüfung
Termine:- Vorlesung: Di., 12:15 - 13:45 Uhr, 1058 N (Neubau Informatik)
- Übungen: Mittwoch, 8:30 - 11:30 Uhr, 14:00 - 17:00 Uhr, 3017 N (Beginn: 2. Semesterwoche)
- Bitte denken Sie daran sich in Studis anzumelden.
Anmerkung:
- Diese Veranstaltung findet in Zweiergruppen statt. Daher ist es von Vorteil bereits zur Auftaktveranstaltung eine Gruppe gebildet zu haben.
- Die Anmeldung findet im Rahmen der ersten Veranstaltung statt.
Aufgaben:
Aufgabe 0: Erste Schritte (keine Abgabe, Bearbeitung in der ersten Übung am 26.10.)
Aufgabe 1: Mastermind (Abgabe bis So., 13.11.2011, 23:59 Uhr)
Aufgabe 2: Unsigned Arithmetik (Abgabe bis So., 27.11.2011, 23:59 Uhr)
Aufgabe 3: Kopierkarte (Abgabe bis So., 18.12.2011, 23:59 Uhr) Abgabetermin verschoben!! Abgabe der modellierten Protokolle (d.h. das MagicDraw Projekt) bis zum 18.12.2011, 23.59 Uhr. Abgabe des generierten Codes sowie der GUI bis zum 25.12.2011, 23.59 Uhr
Aufgabe 4: ETicket (Zwei Abgabetermine: erste Abgabe bis Mi., 25.01.2012, 23:59 Uhr; zweite Abgabe bis So., 12.02.2012)
Abnahmen:
Die Abnahmen finden in der Woche vom 19.-23. Dezember im Praktikumsraum (3017N) statt.
![]()
Links
- Häufig gestellte Fragen unbedingt durchlesen!
- Leitfaden zur Programmierung und Spezifikation
- Installationsanleitung SmartCafe
- SecureMDD FAQ
- Java Card Applet Developer's Guide (pdf, 62 Seiten). Dieses Dokument sollte man unbedingt lesen. Es enthält in Kürze die Einschränkungen von JavaCard gegenüber Java. Ausserdem wird der Applet live cycle, der Umgang mit APDUs usw. beschrieben. Interessant sind die ersten drei Kapitel. (Das File system ist für uns uninteressant, die Kryptographie veraltet.)
- JavaCard 2.2 API (pdf). Die API für die Karte - leider nur als PDF.
- JavaCard 2.1 API (html). JavaCard 2.1 ist gegenüber 2.1.1 etwas veraltet, besonders bei der Kryptographie. Im Zweifelsfalle muss man also im PDF nachsehen.
- Programming Satan's Computer (pdf) von Ross Anderson und Roger Needham. Ein sehr hübscher einführender Artikel über die Fallstricke kryptographischer Protokolle. Sollte man unbedingt lesen.
- Openplatform Card Specification 2.0.1 (pdf) Für alle, die genau wissen wollen, wie das Laden von Applets funktioniert.
- JavaCard 2.2 Runtime Environment Specification (pdf) mit weiteren Details zu Applets
- JavaCard 2.2 Virtual Machine Specification (pdf) - wer alles über Bytecode, CAP Dateien etc. wissen will
- RSA Security - PKCS#1 (externer Link). Hier kann man Spezifikationen über RSA und anderes im Original nachlesen.
![]()
ISO Statusworte
Diese Liste enthält die JavaCard-Definitionen des ISO-Standard. Folgende Liste wird im javacard.framework.ISO7816 definiert:
| 90 00 | No Error | SW_NO_ERROR |
| 61 00 | Response bytes remaining | SW_BYTES_REMAINING_00 |
| 67 00 | Wrong length | SW_WRONG_LENGTH |
| 69 82 | Security condition not satisfied | SW_SECURITY_STATUS_NOT_SATISFIED |
| 69 83 | File invalid | SW_FILE_INVALID |
| 69 84 | Data invalid | SW_DATA_INVALID |
| 69 85 | Conditions of use not satisfied | SW_CONDITIONS_NOT_SATISFIED |
| 69 86 | Command not allowed | SW_COMMAND_NOT_ALLOWED |
| 69 99 | Applet selection failed | SW_APPLET_SELECT_FAILED |
| 6A 80 | Wrong data | SW_WRONG_DATA |
| 6A 81 | Function not supported | SW_FUNC_NOT_SUPPORTED |
| 6A 82 | File not found | SW_FILE_NOT_FOUND |
| 6A 83 | Record not found | SW_RECORD_NOT_FOUND |
| 6A 84 | Not enough memory space in the file | SW_FILE_FULL |
| 6A 86 | Incorrect parameters (P1,P2) | SW_INCORRECT_P1P2 |
| 6B 00 | Incorrect parameters (P1,P2) | SW_WRONG_P1P2 |
| 6C 00 | Correct Expected Length (Le) | SW_CORRECT_LENGTH_00 |
| 6D 00 | INS value not supported | SW_INS_NOT_SUPPORTED |
| 6E 00 | CLA value not supported | SW_CLA_NOT_SUPPORTED |
| 6F 00 | No precise diagnosis | SW_UNKNOWN |
Weitere Definitionen für APDUs in javacard.framework.ISO7816
| CLA_ISO7816 | 0 | Class-byte für ISO-konforme APDUs |
| INS_EXTERNAL_AUTHENTICATE | 0x82 | Instruction für das external_authenticate Kommando |
| INS_SELECT | 0xA4 | Instruction für das select Kommando |
| OFFSET_CLA | 0 | Index in den APDU-Buffer für das Class-Byte |
| OFFSET_INS | 1 | Index in den APDU-Buffer für das Instruction-Byte |
| OFFSET_P1 | 2 | Index in den APDU-Buffer für Parameter 1 |
| OFFSET_P2 | 3 | Index in den APDU-Buffer für Parameter 2 |
| OFFSET_LC | 4 | Index in den APDU-Buffer für Lc bzw. Le-Byte |
| OFFSET_CDATA | 5 | Index in den APDU-Buffer wo die eigentlichen Daten beginnen |
Folgende (spezifische) Statusworte könnte der Cardmanager bzw. die Java virtuelle Maschine noch zurückliefern:
| 61 XX | Normal processing, XX number of bytes still available |
| 62 83 | Selected applet blocked |
| 63 00 | Cryptogram not verified |
| 63 10 | More data available |
| 65 81 | Memory failure |
| 67 00 | Incorrect length |
| 69 82 | Security status not satisfied |
| 69 85 | Command conditions not satified |
| 69 99 | Command failed and no more applets are selected |
| 6A 80 | Incorrect data: unknown criteria or incorrect AID length |
| 6A 81 | Function not supported |
| 6A 82 | Applet not found in the selected application |
| 6A 84 | Insufficient memory |
| 6A 86 | Incorrect P1, P2 |
| 6A 88 | No element matches the search criteria |
| 6B 00 | Incorrect P1 or P2 parameter |
| 6C XX | Only XX bytes of data are available |
| 6D 00 | Unknown instruction code |
| 6E 00 | Incorrect instruction class |
| 6F 00 | No specific diagnosis (Exception im Applet) |
| 6F 80 | Stack Overflow (?) |
| 90 00 | Command processed without error |
| 92 40 | Memory problem |
| 94 02 | Acess out of range |
| 94 84 | Algorithm not supported |
| 94 85 | Invalid key check value |
| 9F XX | XX bytes of data available |
PC/SC Fehlercodes:
| 0x00000000 | SCARD_S_SUCCESS | No error was encountered. |
| 0x80100001 | SCARD_F_INTERNAL_ERROR | An internal consistency check failed. |
| 0x80100002 | SCARD_E_CANCELLED | The action was cancelled by an SCardCancel request. |
| 0x80100003 | SCARD_E_INVALID_HANDLE | The supplied handle was invalid. |
| 0x80100004 | SCARD_E_INVALID_PARAMETER | One or more of the supplied parameters' could not be properly interpreted. |
| 0x80100005 | SCARD_E_INVALID_TARGET | Configuration startup information is missing or invalid. |
| 0x80100006 | SCARD_E_NO_MEMORY | Not enough memory available to complete this command. |
| 0x80100007 | SCARD_F_WAITED_TOO_LONG | An internal consistency timer has expired. You'll probably have to restart the Resource Manager. |
| 0x80100008 | SCARD_E_INSUFFICIENT_BUFFER | The data buffer to receive returned data is too small for the returned data. |
| 0x80100009 | SCARD_E_UNKNOWN_READER | The specified IFD name is not recognized. |
| 0x8010000A | SCARD_E_TIMEOUT | The user-specified timeout value has expired. |
| 0x8010000B | SCARD_E_SHARING_VIOLATION | The ICC cannot be accessed because of other connections outstanding. |
| 0x8010000C | SCARD_E_NO_SMARTCARD | The operation requires an ICC, but no ICC is currently in the device. |
| 0x8010000D | SCARD_E_UNKNOWN_CARD | The specified ICC name is not recognized. |
| 0x8010000E | SCARD_E_CANT_DISPOSE | The system could not dispose of the media in the requested manner. |
| 0x8010000F | SCARD_E_PROTO_MISMATCH | The requested protocols are incompatible with the protocol currently in use with the card. (not in spec) |
| 0x80100010 | SCARD_E_NOT_READY | The reader or card is not ready to accept commands. (not in spec) |
| 0x80100011 | SCARD_E_INVALID_VALUE | One or more of the supplied parameters' values is not valid. |
| 0x80100012 | SCARD_E_SYSTEM_CANCELLED | The action was cancelled by the system, presumably to log off or shut down. |
| 0x80100013 | SCARD_F_COMM_ERROR | An internal communications error has been detected. |
| 0x80100014 | SCARD_F_UNKNOWN_ERROR | An internal error has been detected, but the source is unknown. |
| 0x80100015 | SCARD_E_INVALID_ATR | An ATR obtained from the configuration store is not a valid ATR string. |
| 0x80100016 | SCARD_E_NOT_TRANSACTED | An attempt was made to end a non-existent transaction. |
| 0x80100017 | SCARD_E_READER_UNAVAILABLE | The specified IFD is not currently available for use. |
| 0x80100019 | SCARD_E_PCI_TOO_SMALL | The PCI receive buffer was too small. (not in spec) |
| 0x8010001A | SCARD_E_READER_UNSUPPORTED | The reader driver does not meet minimal requirements for support. (not in spec) |
| 0x8010001B | SCARD_E_DUPLICATE_READER | The reader driver did not produce a unique reader name. (not in spec) |
| 0x8010001C | SCARD_E_CARD_UNSUPPORTED | The smart card does not meet minimal requirements for support. (not in spec) |
| 0x8010001D | SCARD_E_NO_SERVICE | The smart card resource manager is not running. (not in spec) |
| 0x8010001E | SCARD_E_SERVICE_STOPPED | The smart card resource manager has shut down. (not in spec) |
| 0x8010001F | SCARD_E_UNSUPPORTED_FEATURE | Feature not supported by this card. |
| 0x80100065 | SCARD_W_UNSUPPORTED_CARD | The reader cannot communicate with the card, due to ATR configuration conflicts. This error may be cleared by the SCardReconnect service. |
| 0x80100066 | SCARD_W_UNRESPONSIVE_CARD | The card is not responding to a reset. This error may be cleared by the SCardReconnect service. |
| 0x80100067 | SCARD_W_UNPOWERED_CARD | Power has been removed from the card, so further communication is not possible. This error may be cleared by the ScardReconnect service. |
| 0x80100068 | SCARD_W_RESET_CARD | The card has been reset, so any shared state information is invalid. This error may be cleared by the SCardReconnect service. |
| 0x80100069 | SCARD_W_REMOVED_CARD | The card has been removed, so further communication is not possible. This error may be cleared by the SCardReconnect service. |
| 0x8010006A | SCARD_W_INSERTED_CARD ??? |
weitere Informationen zu der Lehrveranstaltung:
| empfohlenes Studiensemester der Lehrveranstaltung: | Hauptstudium |
| Fachrichtung Lehrveranstaltung: | Informatik |
| Nummer der Lehrveranstaltung: | 07317 |
| Dauer der Lehrveranstaltung: | 2 SWS |
| Typ der Lehrveranstaltung: | V - Vorlesung |
| Leistungspunkte: | 8 LP für V + Ü |
| Bereich: | Softwaretechnik und Programmiersprachen |
| Prüfung: | Mündliche Prüfung |
| Begleitende Lehrveranstaltung(en): | 07318 |
| Semester: | WS 2011/12 |
