Verfahren zur krypto raphischen Absicherung der Kommunikation mit einem tragbaren Datenträger Process for cryptographically securing communication with a portable data carrier
Die Erfindung betrifft ein Verfahren zur kryptographischen Absicherung der Kommunikation mit einem tragbaren Datenträger. Weiterhin betrifft die Erfindung ein Sicherheitsmodul zur kryptographischen Absicherung der Komrnunikation mit einem tragbaren Datenträger und ein Endgerät mit einem derartigen Sicherheitsmodul.The invention relates to a method for cryptographically securing communication with a portable data carrier. Furthermore, the invention relates to a security module for cryptographically securing the communication with a portable data carrier and a terminal with such a security module.
Tragbare Datenträger können sehr vielfältig eingesetzt werden, beispielsweise im Zahlungsverkehr oder als Ausweisdokumente. Beim Einsatz eines tragbaren Datenträgers ist es erforderlich, mit dem Datenträger zu kommunizieren. Für die Komrnunikation mit dem tragbaren Datenträger kann ein Endgerät eingesetzt werden, das zudem die im Rahmen der jeweiligen An- wendung vorgesehenen Aktionen durchführt. Beispielsweise kann es sich bei einem derartigen Endgerät um ein Za ungsverkehrsterminal handeln, mit dessen Hilfe der tragbare Datenträger eine Zahlung abwickeln kann.Portable data carriers can be used in a wide variety of ways, for example in payment transactions or as identification documents. When using a portable data carrier, it is necessary to communicate with the data carrier. A terminal can be used for communication with the portable data carrier, which also carries out the actions provided for in the respective application. For example, such a terminal can be a payment traffic terminal, with the aid of which the portable data carrier can process a payment.
Bei vielen Anwendungen ist es erforderlich, die Komrnunikation zwischen dem Endgerät und dem tragbaren Datenträger kryptographisch abzusichern, um ein Ausspähen oder Manipulationen zu verhindern. Zu diesem Zweck werden im tragbaren Datenträger und im Endgerät kryptographische Schlüssel gegen unberechtigten Zugriff geschützt gespeichert. Da es sehr aufwendig ist, das gesamte Endgerät mechanisch und elektrisch gegen unbe- rechtigte Zugriffe zu schützen, wird auch von der Möglichkeit Gebrauch gemacht, das Endgerät mit einem Sicherheitsmodul auszustatten, in dem die kryptographischen Schlüssel und gegebenenfalls weitere Geheimdaten gespeichert werden. In diesem Fall muss nicht das gesamte Endgerät, sondern lediglich das Sicherheitsmodul geschützt sein. Diese Vorgehensweise bietet allerdings nur dann einen zuverlässigen Schutz, wenn darauf geachtet wird, dass die Geheimdaten das Sicherheitsmodul zu keinem Zeitpunkt verlassen.
Bei einem Endgerät mit Sicherheitsmodul steuert die Elektronik des Endgeräts in analoger Weise, wie bei einem insgesamt geschützten Endgerät die Abläufe während der KorrLmunikation mit dem tragbaren Datenträger. Allerdings werden beispielsweise kryptographische Operationen nicht von der Elektronik des Endgeräts, sondern vom Sicherheitsmodul durchgeführt. Hierzu werden die Daten, die einer kryptographischen Operation zu unterziehen sind, von der Elektronik des Endgeräts an das Sicherheitsmodul übermittelt. Dort wird die kryptographische Operation ausgeführt und das Ergebnis der Operation wird an die Elektronik des Endgeräts ausgegeben. In diesem Zusammenhang ist es beispielsweise bekannt, zur kryptographischen Absicherung von Kommandoeinheiten, die das Endgerät an den tragbaren Datenträger übermittelt, jeweils ein Datenfeld, das Bestandteil der Kommandoeinheiten ist, an das Sicherheitsmodul zu übermitteln. Das Sicherheitsmodul führt eine kryptographische Absicherung des Datenfelds durch und gibt das abgesicherte Datenfeld an die Elektronik des Endgeräts aus. Die Elektronik des Endgeräts erzeugt unter Einbeziehung des kryptographisch abgesicherten Datenfelds eine Komrnandoeinheit in einem standardisierten Format und übermittelt diese an den tragbaren Datenträger.In many applications, it is necessary to cryptographically secure the communication between the terminal and the portable data carrier in order to prevent spying or manipulation. For this purpose, cryptographic keys are stored in the portable data carrier and in the terminal so that they are protected against unauthorized access. Since it is very complex to mechanically and electrically protect the entire terminal against unauthorized access, use is also made of the possibility of equipping the terminal with a security module in which the cryptographic keys and possibly further secret data are stored. In this case, it is not necessary to protect the entire end device, but only the security module. However, this procedure only offers reliable protection if care is taken to ensure that the secret data never leaves the security module. In the case of a terminal with a security module, the electronics of the terminal control the processes during the communication with the portable data carrier in a manner analogous to that of an overall protected terminal. However, cryptographic operations, for example, are not carried out by the electronics of the terminal, but by the security module. For this purpose, the data to be subjected to a cryptographic operation are transmitted from the electronics of the terminal to the security module. The cryptographic operation is carried out there and the result of the operation is output to the electronics of the terminal. In this context, it is known, for example, to transmit a data field, which is part of the command units, to the security module in order to cryptographically secure command units that the terminal device transmits to the portable data carrier. The security module cryptographically secures the data field and outputs the secured data field to the electronics of the end device. The electronics of the end device, including the cryptographically secured data field, generates a command unit in a standardized format and transmits it to the portable data carrier.
Der Erfindung liegt die Aufgabe zugrunde, die kryptographische Absicherung der Komrnunikation mit einem tragbaren Datenträger möglichst effizient und sicher zu gestalten.The invention has for its object to make the cryptographic security of the communication with a portable data carrier as efficient and secure as possible.
Diese Aufgabe wird durch ein Verfahren gemäß Anspruch 1 gelöst.This object is achieved by a method according to claim 1.
Beim erfindungsgemäßen Verfahren zur kryptographischen Absicherung der Komrnunikation mit einem tragbaren Datenträger wird wenigstens eine in einem standardisierten Format ausgebildete und kryptographisch abgesicherte Kornrnandoeinheit an den tragbaren Datenträger übermittelt. Die Be-
sonderheit des erfindungsgemäßen Verfahrens besteht darin, dass die im standardisierten Format ausgebildete und kryptographisch abgesicherte Kommandoeinheit von einem Sicherheitsmodul bereitgestellt wird.In the method according to the invention for cryptographically securing communication with a portable data carrier, at least one Kornrnando unit designed and cryptographically secured in a standardized format is transmitted to the portable data carrier. Thieves- A special feature of the method according to the invention is that the command unit, which is designed and cryptographically secured in the standardized format, is provided by a security module.
Das erfindungsgemäße Verfahren hat den Vorteil, dass sich mit einem relativ niedrigen Aufwand ein hoher Sicherheitsstandard erzielen lässt. Durch das Handling der kompletten Kommandoeinheit im Sicherheitsmodul lässt sich zudem die Verarbeitungsgeschwindigkeit im Vergleich zur Bearbeitung einzelner Datenobjekte der Kommandoeinheit steigern.The method according to the invention has the advantage that a high security standard can be achieved with relatively little effort. By handling the complete command unit in the security module, the processing speed can also be increased compared to processing individual data objects of the command unit.
Bei einem ersten Ausführungsbeispiel des erfindungsgemäßen Verfahrens wird die für die Übermittlung an den tragbaren Datenträger vorgesehene Kommandoeinheit im standardisierten Format ausgebildet und zur kryptographischen Absicherung an das Sicherheitsmodul übertragen. Insbesondere wird die im standardisierten Format ausgebildete Kommandoeinheit als ein Datenfeld in eine weitere im standardisierten Format ausgebildete Kommandoeinheit eingebettet, die zur Ausführung an das Sicherheitsmodul übertragen wird. Dies hat den Vorteil, dass beim Einsatz des erfindungsgemäßen Verfahrens weitgehend auf bereits vorhandene Standardabläufe auf- gebaut werden kann.In a first exemplary embodiment of the method according to the invention, the command unit provided for transmission to the portable data carrier is designed in a standardized format and transmitted to the security module for cryptographic security. In particular, the command unit designed in the standardized format is embedded as a data field in a further command unit designed in the standardized format, which is transmitted to the security module for execution. This has the advantage that when using the method according to the invention it is largely possible to build on existing standard processes.
Bei einem zweiten Ausführungsbeispiel des erfindungsgemäßen Verfahrens wird die für die Übermittlung an den tragbaren Datenträger vorgesehene Kommandoeinheit vom Sicherheitsmodul im standardisierten Format aus- gebildet und kryptographisch abgesichert. Dies hat den Vorteil, dass eine Übertragung der für die kryptographische Absicherung vorgesehenen Korrunandoeinheit an das Sicherheitsmodul nicht erforderlich ist. Insbesondere kann die Ausbildung und Absicherung der Komrnandoeinheit durch das Sicherheitsmodul auf Anforderung erfolgen, so dass die Kontrolle über
den Ablauf außerhalb des Sicherheitsmoduls ausgeübt werden kann. Dabei ist es vorteilhaft, wenn die Anforderung mittels einer im standardisierten Format ausgebildeten Kommandoeinheit an das Sicherheitsmodul gerichtet wird.In a second exemplary embodiment of the method according to the invention, the command unit provided for transmission to the portable data carrier is designed by the security module in the standardized format and is cryptographically secured. This has the advantage that it is not necessary to transmit the correspondence unit provided for the cryptographic security to the security module. In particular, the command module can be designed and secured by the security module on request, so that control over the process can be carried out outside the security module. It is advantageous if the request is directed to the security module by means of a command unit designed in a standardized format.
Um sowohl Manipulationen als auch einem Ausspähen entgegenzuwirken, können zur kryptographischen Absicherung der Kommandoeinheit in der Kommandoeinheit enthaltene Daten verschlüsselt werden und eine kryptographische Prüf summe der Komrnandoeinheit angefügt werden. Ein beson- ders hoher Sicherheitsstandard lässt sich dadurch erzielen, dass vom Sicherheitsmodul ein Zähler geführt und bei der kryptographischen Absicherung berücksichtigt wird. Die Kommandoeinheit ist insbesondere als APDU ausgebildet.In order to counteract both manipulation and spying, data contained in the command unit can be encrypted for cryptographic protection of the command unit and a cryptographic check sum of the command unit can be added. A particularly high security standard can be achieved by keeping a counter by the security module and taking it into account in the cryptographic security. The command unit is designed in particular as an APDU.
Die im standardisierten Format ausgebildete und kryptographisch abgesicherte Kommandoeinheit kann von einem Endgerät an den tragbaren Datenträger übermittelt werden. In diesem Fall kann die im standardisierten Format ausgebildete und kryptographisch abgesicherte Kommandoeinheit zuvor vom Sicherheitsmodul an das Endgerät übertragen werden. Das Endge- rät erhält dadurch die Möglichkeit, das weitere Handling der Kommandoeinheit in eigener Regie durchzuführen.The cryptographically secured command unit, which is designed in a standardized format, can be transmitted from a terminal to the portable data carrier. In this case, the command unit, which is designed in a standardized format and is cryptographically secured, can be transmitted beforehand from the security module to the terminal. This gives the terminal the option of further handling the command unit itself.
Das erfindungsgemäße Sicherheitsmodul dient der kryptographischen Absicherung der Kommunikation mit einem tragbaren Datenträger, bei der we- nigstens eine in einem standardisierten Format ausgebildete und kryptographisch abgesicherte Kommandoeinheit an den tragbaren Datenträger übermittelt wird. Die Besonderheit des erfindungsgemäßen Sicherheitsmoduls besteht darin, dass es über Mittel zur Bereitstellung der im standardisierten
Format ausgebildeten und kryptographisch abgesicherten Kommandoein- heit verfügt.The security module according to the invention is used to cryptographically secure communication with a portable data carrier, in which at least one command unit designed in a standardized format and cryptographically secured is transmitted to the portable data carrier. The special feature of the security module according to the invention is that it has means for providing the standardized Command-trained format and cryptographically secured command unit.
Das erfindungsgemäße Sicherheitsmodul kann insbesondere als eine Chip- karte ausgebildet sein. Dies hat den Vorteil, dass sich auf kostengünstige Weise ein hoher Sicherheitsstandard erzielen lässt. Ein weiterer Vorteil besteht darin, dass die Chipkarte nur einen relativ geringen Bauraum beansprucht.The security module according to the invention can in particular be designed as a chip card. This has the advantage that a high security standard can be achieved in an economical manner. Another advantage is that the chip card takes up only a relatively small amount of space.
Die Erfindung bezieht sich weiterhin auf ein Endgerät für einen tragbaren Datenträger, das mit dem erfindungsgemäßen Sicherheitsmodul ausgerüstet ist. Ein derartiges Endgerät lässt sich unter Einhaltung eines hohen Sicherheitsstandards mit einem relativ niedrigen Aufwand herstellen. Insbesondere kann das Sicherheitsmodul entfernbar im Endgerät angeordnet sein. Da- durch lässt sich die Sicherheitsfunktionalität des Endgeräts inklusive dazu benötigter Geheimdaten erforderlichenfalls mit sehr geringem Aufwand auf den gewünschten Stand bringen.The invention further relates to a terminal for a portable data carrier, which is equipped with the security module according to the invention. Such a terminal can be manufactured with relatively little effort while maintaining a high security standard. In particular, the security module can be removably arranged in the terminal. As a result, the security functionality of the terminal, including the secret data required, can be brought to the desired level with very little effort, if necessary.
Die Erfindung wird nachstehend anhand der in der Zeichnung dargestellten Ausführungsbeispiele erläutert.The invention is explained below with reference to the embodiments shown in the drawing.
Es zeigen:Show it:
Fig. 1 eine schematische Darstellung eines Endgeräts zur Veranschaulichung eines ersten Ausführungsbeispiels des erfindungsgemäßen Verfahrens,1 shows a schematic representation of a terminal to illustrate a first exemplary embodiment of the method according to the invention,
Fig. 2 eine schematische Darstellung für die Abwicklung der Korruτtunikati- on des Endgeräts mit der Benutzer-Chipkarte inklusive der verwende-
ten Dateneinheiten gemäß dem in Fig. 1 dargestellten Ausführungsbeispiel,2 shows a schematic illustration for handling the correspondence of the terminal with the user chip card, including the th data units according to the exemplary embodiment shown in FIG. 1,
Fig. 3 eine schematische Darstellung des Ablaufs in der Benutzer-Chipkarte undFig. 3 is a schematic representation of the process in the user chip card and
Fig. 4 eine schematische Darstellung für die Abwicklung der Koπimunikati- on des Endgeräts mit der Benutzer-Chipkarte inklusive der verwendeten Dateneinheiten gemäß einem zweiten Ausführungsbeispiel des er- findungsgemäßen Verfahrens.4 shows a schematic illustration for handling the communication of the terminal with the user chip card, including the data units used, according to a second exemplary embodiment of the method according to the invention.
Fig. 1 zeigt eine schematische Darstellung eines Endgeräts 1 zur Veranschaulichung eines ersten Ausführungsbeispiels des erfindungsgemäßen Verfahrens. Das Endgerät 1 weist eine Elektronik 2 auf, mit der der Betrieb des Endgeräts 1 gesteuert wird und die über eine interne Schnittstelle 3 und eine externe Schnittstelle 4 verfügt. Weiterhin weist das Endgerät 1 ein Sicherheitsmodul 5 auf, das mit der internen Schnittstelle 3 verbunden ist und beispielsweise in Form einer in das Endgerät 1 eingesteckten Chipkarte ausgebildet sein kann. Das Sicherheitsmodul 5 ist so ausgelegt, dass die darin gespeicherten Daten und die damit durchgeführten Operationen gegen Ausspähen und gegen Manipulationen geschützt sind. Sämtliche Geheimdaten des Endgeräts 1 sind im Sicherheitsmodul 5 abgelegt. Weiterhin werden sämtliche sicherheitsrelevante Operationen des Endgeräts 1 vom Sicherheitsmodul 5 abgewickelt. Dadurch entfällt die Notwendigkeit, aufwendige Maßnahmen zum Schutz der Elektronik 2 des Endgeräts 1 vorzusehen.1 shows a schematic illustration of a terminal 1 to illustrate a first exemplary embodiment of the method according to the invention. The terminal 1 has electronics 2, with which the operation of the terminal 1 is controlled and which has an internal interface 3 and an external interface 4. Furthermore, the terminal 1 has a security module 5, which is connected to the internal interface 3 and can be designed, for example, in the form of a chip card inserted into the terminal 1. The security module 5 is designed in such a way that the data stored therein and the operations performed with it are protected against spying and manipulation. All secret data of the terminal 1 are stored in the security module 5. Furthermore, all security-relevant operations of the terminal 1 are handled by the security module 5. This eliminates the need to provide complex measures to protect the electronics 2 of the terminal 1.
Für die Durchführung einer Anwendung, für die das Endgerät 1 vorgesehen ist, wird eine Benutzer-Chipkarte 6 temporär in das Endgerät 1 eingeführt und dadurch mit der externen Schnittstelle 4 verbunden, so dass eine Kom-
munikation zwischen der Elektronik 2 des Endgeräts 1 und der Benutzer- Chipkarte 6 möglich ist. Die Kommunikation wird mit Hilfe eines standardisierten Übertragungsprotokolls abgewickelt, mit dem Kommandos von der Elektronik 2 des Endgeräts 1 an die Benutzer-Chipkarte 6 übermittelt wer- den. Die Benutzer-Chipkarte 6 führt die Kommandos aus und übermittelt vom Ergebnis der Ausführung abhängige Antworten an die Elektronik 2 des Endgeräts 1. Die Kommandos und die Antworten werden jeweils in Form von standardisierten Dateneinheiten der Übertragung zugeführt. Diese Dateneinheiten werden üblicherweise als APDUs oder ausgeschrieben als application protocol data units bezeichnet. Die APDUs, die ein Kommando enthalten, werden als Kommando- APDUs bzw. command- APDUs oder kurz C- APDUs bezeichnet. Entsprechend heißen die jeweils als Antwort auf eine Kommando- APDU hin übermittelten Dateneinheiten Antwort- APDUs bzw. response- APDUs oder R- APDUs. Teils wird die Bezeichnung APDU primär für die Kommando- APDUs verwendet. Die Antwort- APDUs werden dann lediglich als Antwort bezeichnet. Um Verwechslungen zu vermeiden, wird im Folgenden jeweils die erstgenannte, ausführliche Notation verwendet. Die Struktur der Kommando- APDUs und der Antwort- APDUs wird anhand von Fig. 2 noch näher erläutert. Um ein Ausspähen bzw. eine Manipulation der Kommunikation zwischen dem Endgerät 1 und der Benutzer-Chipkarte 6 zu verhindern, wird die Kommunikation kryptographisch abgesichert. Eine kryptographisch abgesicherte Komrnunikation zwischen dem Endgerät 1 und der Benutzer-Chipkarte 6 wird im Rahmen der Erfindung folgendermaßen durchgeführt:To carry out an application for which the terminal 1 is provided, a user chip card 6 is temporarily inserted into the terminal 1 and thereby connected to the external interface 4, so that a com- Communication between the electronics 2 of the terminal 1 and the user chip card 6 is possible. The communication is carried out with the aid of a standardized transmission protocol, with which commands from the electronics 2 of the terminal 1 are transmitted to the user chip card 6. The user chip card 6 executes the commands and transmits responses dependent on the result of the execution to the electronics 2 of the terminal 1. The commands and the responses are each sent to the transmission in the form of standardized data units. These data units are usually referred to as APDUs or written out as application protocol data units. The APDUs that contain a command are called command APDUs or command APDUs or C-APDUs for short. Correspondingly, the data units transmitted in response to a command APDU are called response APDUs or response APDUs or R-APDUs. The name APDU is primarily used for the command APDUs. The response APDUs are then simply referred to as the response. To avoid confusion, the first detailed notation is used below. The structure of the command APDUs and the response APDUs is explained in more detail with reference to FIG. 2. To prevent spying or manipulation of the communication between the terminal 1 and the user chip card 6, the communication is cryptographically secured. Cryptographically secured communication between the terminal 1 and the user chip card 6 is carried out as follows within the scope of the invention:
In einem Schritt SI wird von der Elektronik 2 des Endgeräts 1 über die interne Schnittstelle 3 eine für die Übermittlung an die Benutzer-Chipkarte 6 vorgesehene Kommando- APDU im Klartext an das Sicherheitsmodul 5 übertragen, ohne eine Ausführung der Kommando- APDU zu veranlassen. Das Si-
cherheitsmodul 5 führt eine kryptographische Absicherung der Kommando- APDU durch und überträgt die kryptographisch abgesicherte Kommando- APDU in einem Schritt S2 über die interne Schnittstelle 3 an die Elektronik 2 des Endgeräts 1. Auch bei Schritt S2 erfolgt die Übertragung so, dass eine Ausführung der Kommando- APDU unterbleibt. Das diesbezügliche Vorgehen wird anhand von Fig. 3 erläutert. Die Elektronik 2 des Endgeräts 1 sendet die kryptographisch abgesicherte Kommando- APDU in einem Schritt S3 über die externe Scrrnittstelle 4 zur Ausführung an die Benutzer-Chipkarte 6. Die Benutzer-Chipkarte 6 führt die Kommando- APDU aus und antwortet in einem Schritt S4 mit einer kryptographisch abgesicherten Antwort- APDU, die der Elektronik 2 des Endgeräts 1 über die externe Schnittstelle 4 zugeführt wird. In einem Schritt S5 leitet die Elektronik 2 des Endgeräts 1 die verschlüsselten Daten der kryptographisch abgesicherte Antwort- APDU über die interne Schnittstelle 3 an das Sicherheitsmodul 5 weiter. Das Sicher- heitsmodul 5 ermittelt daraus die Daten der Antwort- APDU im Klartext und übermittelt diese in einem Schritt S6 über die interne Schnittstelle 3 an die Elektronik 2 des Endgeräts 1. Einzelheiten zur vorstehend beschriebenen Vorgehensweise werden anhand von Fig. 2 erläutert.In a step SI, the electronics 2 of the terminal 1 transmit a command APDU intended for transmission to the user chip card 6 in plain text to the security module 5 via the internal interface 3 without causing the command APDU to be executed. The Si Security module 5 carries out cryptographic protection of the command APDU and transmits the cryptographically secured command APDU in a step S2 to the electronics 2 of the terminal 1 via the internal interface 3. The transmission also takes place in step S2 so that the command is executed - APDU is omitted. The procedure in this regard is explained with reference to FIG. 3. The electronics 2 of the terminal 1 sends the cryptographically secured command APDU in a step S3 via the external interface 4 for execution to the user chip card 6. The user chip card 6 executes the command APDU and responds in a step S4 with a cryptographically secured response APDU, which is supplied to the electronics 2 of the terminal 1 via the external interface 4. In a step S5, the electronics 2 of the terminal 1 forwards the encrypted data of the cryptographically secured response APDU to the security module 5 via the internal interface 3. From this, the security module 5 determines the data of the response APDU in plain text and transmits them in a step S6 to the electronics 2 of the terminal 1 via the internal interface 3. Details of the procedure described above are explained with reference to FIG. 2.
Fig. 2 zeigt eine schematische Darstellung für die Abwicklung der Kommunikation des Endgeräts 1 mit der Benutzer-Chipkarte 6 inklusive der verwendeten Dateneinheiten gemäß dem in Fig. 1 dargestellten Ausführungsbeispiel. Dargestellt ist jeweils der Datenfluss zwischen der Elektronik 2 des Endgeräts 1 und den beiden Schnittstellen 3 und 4. Die Weiterleitung der Dateneinheiten zwischen der internen Schnittstelle 3 und dem Sicherheitsmodul 5 sowie zwischen der externen Schnittstelle 4 und der Benutzer- Chipkarte 6 erfolgt wie in Fig. 1 dargestellt. Die im Schritt SI von der Elektronik 2 des Endgeräts 1 über die interne Schnittstelle 3 im Klartext (piain) an das Sicherheitsmodul 5 übertragene Kommando- APDU (C-APDU) weist
gemäß dem Standard für derartige Dateneinheiten als Header ein Class-Byte CLA, ein Instruction-Byte INS und zwei Parameter-Bytes Pl und P2 auf. Als Body sind drei Elemente vorgesehen die als Lc field, data field und Le field bezeichnet werden. Das Class-Byte CLA kann dazu benutzt werden, An- Wendungen und ihren spezifischen Befehlssatz zu kennzeichnen. Das Instruction-Byte INS stellt eine Kodierung des Kommandos der Kommando- APDU dar, wobei das Kommando durch die Parmeter-Bytes Pl und P2 näher spezifiziert wird. Die Elemente Lc field und Le field stellen Längenangaben dar. Lc field gibt die Länge des Datenteils an, der mit der Kommando- APDU gesendet wird. Le field legt die Länge der bei der korrespondierenden Antwort- APDU (R-APDU) erwarteten Daten fest. Die Daten selbst sind im Element data field enthalten. Da die Kommando- APDU im Schritt SI nicht zur Ausführung, sondern zur Durchführung von kryptographischen Sicherungsmaßnahmen an das Sicherheitsmodul 5 übertragen wird, wird sie zur Übertragung insgesamt in eine weitere Kommando- APDU verpackt, d. h. sie ist Bestandteil des Elements data field der weiteren Kommando- APDU.FIG. 2 shows a schematic illustration for handling the communication of the terminal 1 with the user chip card 6 including the data units used according to the exemplary embodiment shown in FIG. 1. The data flow between the electronics 2 of the terminal 1 and the two interfaces 3 and 4 is shown in each case. The forwarding of the data units between the internal interface 3 and the security module 5 and between the external interface 4 and the user chip card 6 takes place as in FIG. 1 shown. The command APDU (C-APDU) transmitted in step SI from the electronics 2 of the terminal 1 via the internal interface 3 in plain text (piain) to the security module 5 in accordance with the standard for such data units, a class byte CLA, an instruction byte INS and two parameter bytes PI and P2 as headers. Three elements are provided as the body, which are designated as Lc field, data field and Le field. The class byte CLA can be used to identify applications and their specific instruction set. The instruction byte INS represents an encoding of the command of the command APDU, the command being specified in more detail by the parameter bytes P1 and P2. The elements Lc field and Le field represent length specifications. Lc field specifies the length of the data part that is sent with the command APDU. Le field specifies the length of the data expected for the corresponding response APDU (R-APDU). The data itself is contained in the element data field. Since the command APDU in step SI is not transmitted to the security module 5 for execution, but rather for the implementation of cryptographic security measures, it is packaged overall for transmission in another command APDU, ie it is part of the data field element of the further command. APDU.
Das Sicherheitsmodul 5 entnimmt die im Schritt SI übertragene Kommando- APDU dem Element data field der weiteren Kommando- APDU und führt eine kryptographische Absicherung der Kommando- APDU durch. Diese Absicherung kann beispielsweise darin bestehen, dass der Kommando- APDU eine kryptographische Prüfsumme angefügt wird und die im Element data field enthaltenen Daten verschlüsselt werden. Durch die kryptographische Absicherung werden die Elemente Lc field, data field und Le field der Kommando- APDU in new Lc field, new data field und new Le field geändert und die Kommando- APDU für ein Secure Messaging (SM) ausgebildet. Im CLA-Byte wird vorzugsweise Secure Messaging und/ oder ein Hinweis angezeigt, ob der Kommando-Header in eine MAC-Berechnung (Message Au-
thentication Code) eingeht. Ein CLA-Byte, das Secure Messaging indiziert, wird mit CLA* bezeichnet.The security module 5 takes the command APDU transmitted in step SI from the element data field of the further command APDU and carries out cryptographic protection of the command APDU. This protection can consist, for example, of adding a cryptographic checksum to the command APDU and encrypting the data contained in the data field element. The elements Lc field, data field and Le field of the command APDU are changed to new Lc field, new data field and new Le field by the cryptographic security and the command APDU is designed for secure messaging (SM). Secure messaging and / or an indication of whether the command header is included in a MAC calculation (Message Au- thentication code) is received. A CLA byte that indicates secure messaging is called CLA *.
Um die kryptographisch abgesicherte Kommando- APDU im Schritt S2 über die interne Schnittstelle 3 an die Elektronik 2 des Endgeräts 1 übertragen zu können, wird sie in eine Antwort- APDU verpackt. Die Antwort- APDU besteht standardmäßig aus einem Body und einem Trailer, wobei der Body ein Element data field zur Aufnahme von Daten aufweist und der Trailer zwei Statuswörter SW1 und SW2 enthält. Die Statuswörter SW1 und SW2 enthal- ten Informationen über die Ausführung der Kommando- APDU, von der die Antwort- APDU ausgelöst wurde. Die im Schritt S2 übertragene Antwort- APDU ist selbst nicht kryptographisch abgesichert, enthält aber im Element data field eine kryptographisch abgesicherte Kommando- APDU.In order to be able to transmit the cryptographically secured command APDU to the electronics 2 of the terminal 1 via the internal interface 3 in step S2, it is packaged in a response APDU. The response APDU consists of a body and a trailer as standard, the body having an element data field for receiving data and the trailer containing two status words SW1 and SW2. The status words SW1 and SW2 contain information about the execution of the command APDU from which the response APDU was triggered. The response APDU transmitted in step S2 is not itself cryptographically secured, but contains a cryptographically secured command APDU in the element data field.
Die Elektronik 2 des Endgeräts 1 entnimmt die kryptographisch abgesicherte Kommando- APDU dem Element data field der im Schritt S2 übertragenen Antwort- APDU und sendet sie im Schritt S3 zur Ausführung über die externe Schnittstelle 4 an die Benutzer-Chipkarte 6. Einzelheiten zu dieser Ausführung werden anhand von Fig. 3 erläutert. Als Ergebnis der Ausführung übermittelt die Benutzer-Chipkarte 6 im Schritt S4 eine kryptographisch abgesicherte Antwort- APDU über die externe Schnittstelle 4 an die Elektronik 2 des Endgeräts 1. Da die Elektronik 2 des Endgeräts 1 die kryptographisch abgesicherten Daten im Element data field der Antwort- APDU nicht auswerten kann, verpackt sie diese in eine Kommando- APDU und sendet sie im Schritt S5 über die interne Schnittstelle 3 zum Sicherheitsmodul 5. Das Sicherheitsmodul 5 entschlüsselt die kryptographisch abgesicherten Daten des Elements data field der übermittelten Kommando- APDU, überprüft den MAC und sendet in einem Schritt S6 die entschlüsselten Daten in Form einer
Antwort-APDU über die interne Schnittstelle 3 an die Elektronik 2 des Endgeräts 1.The electronics 2 of the terminal 1 takes the cryptographically secured command APDU from the data field element of the response APDU transmitted in step S2 and sends them in step S3 to the user chip card 6 for execution via the external interface 4. Details of this embodiment are provided explained with reference to FIG. 3. As a result of the execution, in step S4 the user chip card 6 transmits a cryptographically secured response APDU via the external interface 4 to the electronics 2 of the terminal 1. Since the electronics 2 of the terminal 1 contains the cryptographically secured data in the element data field of the response. APDU cannot evaluate them, packs them into a command APDU and sends them in step S5 via the internal interface 3 to the security module 5. The security module 5 decrypts the cryptographically secured data of the element data field of the transmitted command APDU, checks the MAC and sends the decrypted data in the form of a in step S6 Answer APDU via the internal interface 3 to the electronics 2 of the terminal 1.
Besonders wichtig für die Erfindung ist es, dass auf die vorstehend beschriebene Weise eine komplette Kommando- APDU zur kryptographischen Absicherung von der Elektronik 2 des Endgeräts 1 an das Sicherheitsmodul 5 übermittelt wird. Die kryptographisch abgesicherte Kommando- APDU wird an die Elektronik 2 des Endgeräts 1 zurückgesandt und von dort zur Ausführung an die Benutzer-Chipkarte 6 weitergeleitet.It is particularly important for the invention that a complete command APDU for cryptographic security is transmitted from the electronics 2 of the terminal 1 to the security module 5 in the manner described above. The cryptographically secured command APDU is sent back to the electronics 2 of the terminal 1 and from there forwarded to the user chip card 6 for execution.
Fig. 3 zeigt eine schematische Darstellung des Ablaufs in der Benutzer- Chipkarte 6 nach Eingang der im Schritt S3 übermittelten kryptographisch abgesicherten Kommando- APDU. Zunächst werden in einem Schritt S7 die Secure Messaging Daten der Kommando- APDU von einer Secure Messaging Schicht der Benutzer-Chipkarte 6 geprüft. In einem anschließenden Schritt S8 wird die Kommando- APDU ausgeführt. Danach wird in einem Schritt S9 eine Antwort- APDU erzeugt. Die Antwort- APDU wird in einem Schritt S10 kryptographisch abgesichert und an das Endgerät 1 ausgegeben.3 shows a schematic representation of the sequence in the user chip card 6 after receipt of the cryptographically secured command APDU transmitted in step S3. First, in a step S7, the secure messaging data of the command APDU is checked by a secure messaging layer of the user chip card 6. In a subsequent step S8, the command APDU is executed. A response APDU is then generated in a step S9. The response APDU is cryptographically secured in a step S10 and output to the terminal 1.
Fig. 4 zeigt eine schematische Darstellung für die Abwicklung der Kommunikation des Endgeräts 1 mit der Benutzer-Chipkarte 6 inklusive der verwendeten Dateneinheiten gemäß einem zweiten Ausführungsbeispiel des erfindungsgemäßen Verfahrens. Das zweite Ausführungsbeispiel unterscheidet sich vom ersten Ausführungsbeispiel im Wesentlichen darin, dass das Sicherheitsmodul 5 in der Lage ist, für die Übermittlung an die Benutzer- Chipkarte 6 vorgesehene Kommando- APDUs auszubilden, d. h. für die kryptographische Absicherung der APDUs müssen diese zuvor nicht im Klartext von der Elektronik 2 des Endgeräts 1 an das Sicherheitsmodul 5 übertragen werden. Darüber hinaus besteht auch die Möglichkeit, dass dem
Sicherheitsmodul 5 Protokollabläufe für den Datenaustausch mit der Benutzer-Chipkarte 6 bekannt sind. Im Einzelnen kann eine sichere Kominunikati- on des Endgeräts 1 mit der Benutzer-Chipkarte 6 beim zweiten Ausführungsbeispiel folgendermaßen ablaufen:FIG. 4 shows a schematic illustration for handling the communication of the terminal 1 with the user chip card 6 including the data units used according to a second exemplary embodiment of the method according to the invention. The second exemplary embodiment differs from the first exemplary embodiment essentially in that the security module 5 is able to design command APDUs provided for the transmission to the user chip card 6, ie for the cryptographic protection of the APDUs they do not have to be clear in advance the electronics 2 of the terminal 1 are transmitted to the security module 5. In addition, there is also the possibility that the Security module 5 protocol sequences for data exchange with the user chip card 6 are known. In detail, secure communication of the terminal 1 with the user chip card 6 in the second exemplary embodiment can take place as follows:
In einem Schritt Sll übermittelt die Elektronik 2 des Endgeräts 1 über die interne Schnittstelle 3 im Klartext eine Kommando-APDU zur Ausführung an das Sicherheitsmodul 5, um eine gewünschte Anwendung zu selektieren. Das Sicherheitsmodul 5 antwortet in einem Schritt S12 ebenfalls im Klartext mit einer Antwort- APDU. Diese Antwort weist kein Element data field auf, da lediglich die Ausführung der Selektion bestätigt wird. Danach übermittelt die Elektronik 2 des Endgeräts 1 in einem Schritt S13 über die interne Schnittstelle 3 im Klartext eine Kommando-APDU zur Ausführung an das Sicherheitsmodul 5, um eine für die Benutzer-Chipkarte 6 vorgesehene abge- sicherte Kommando-APDU anzufordern. Das Sicherheitsmodul 5 ermittelt daraufhin die gewünschte kryptographisch abgesicherte Kommando-APDU. Als weiterer Ablauf schließen sich die Schritte S2 bis S6 des ersten Ausführungsbeispiels in identischer Weise an, d. h. die kryptographisch abgesicherte Kommando-APDU wird an die Elektronik 2 des Endgeräts 1 übertragen und von dort zur Ausführung an die Benutzer-Chipkarte 6 gesandt. Die Benutzer-Chipkarte 6 übermittelt der Elektronik 2 des Endgeräts 1 eine kryptographisch abgesicherte Antwort- APDU, deren Daten an das Sicherheitsmodul 5 weitergeleitet, vom Sicherheitsmodul 5 entschlüsselt und im Klartext wieder an die Elektronik 2 des Endgeräts 1 zurück übertragen werden.In a step S11, the electronics 2 of the terminal 1 transmit a command APDU for execution to the security module 5 in plain text via the internal interface 3 in order to select a desired application. In a step S12, the security module 5 also replies in plain text with a response APDU. This answer does not have a data field element, since only the execution of the selection is confirmed. Then, in a step S13, the electronics 2 of the terminal 1 transmit a command APDU in plain text via the internal interface 3 for execution to the security module 5 in order to request a secure command APDU provided for the user chip card 6. The security module 5 then determines the desired cryptographically secured command APDU. As a further sequence, steps S2 to S6 of the first exemplary embodiment follow in an identical manner, i. H. the cryptographically secured command APDU is transmitted to the electronics 2 of the terminal 1 and from there to the user chip card 6 for execution. The user chip card 6 transmits to the electronics 2 of the terminal 1 a cryptographically secured response APDU, the data of which are forwarded to the security module 5, decrypted by the security module 5 and transmitted back to the electronics 2 of the terminal 1 in plain text.
Auf die vorstehend beschriebene Weise können anschließend noch weitere kryptographisch abgesicherte Kommando- APDUs zur Ausführung an die Benutzer-Chipkarte 6 gesandt werden.
Das Sicherheitsmodul 5 kann bei allen Ausführungsbeispielen so ausgebildet sein, dass es in der Lage ist, Zähler zu führen, zu erhöhen und bei der kryptographischen Absicherung zu berücksichtigen. Weiterhin kann das Sicherheitsmodul 5 jeweils in der Lage sein, bei der kryptographischen Absiche- rung Challenges zu berücksichtigen. Die Challenge wird hierzu an das Sicherheitsmodul 5 übergeben oder im Sicherheitsmodul 5 erzeugt. Die kryptographischen Schlüssel und die verwalteten Zähler können in einer Authen- tisierung zwischen dem Sicherheitsmodul 5 und der Benutzer-Chipkarte 6 ausgehandelt werden. Ebenso besteht die Möglichkeit, dass diese an das Si- cherheitsmodul 5 übergeben werden oder bereits im Sicherheitsmodul 5 vorhanden sind.In the manner described above, further cryptographically secured command APDUs can then be sent to the user chip card 6 for execution. In all of the exemplary embodiments, the security module 5 can be designed in such a way that it is able to keep counters, to increase them and to take them into account in the cryptographic security. Furthermore, the security module 5 can in each case be able to take challenges into account in the cryptographic security. For this purpose, the challenge is transferred to the security module 5 or generated in the security module 5. The cryptographic keys and the managed counters can be negotiated in an authentication between the security module 5 and the user chip card 6. There is also the possibility that these are transferred to the security module 5 or are already present in the security module 5.
Prinzipiell besteht auch die Möglichkeit, dass das Sicherheitsmodul 5 analog zur vorstehend beschriebenen Vorgehensweise kryptographisch abgesicher- te Antwort- APDUs bereitstellt.
In principle, there is also the possibility that the security module 5 provides cryptographically secured response APDUs analogously to the procedure described above.