JP2021114157A - Electronic information storage medium, authentication code generation method, authentication code verification method, and program - Google Patents
Electronic information storage medium, authentication code generation method, authentication code verification method, and program Download PDFInfo
- Publication number
- JP2021114157A JP2021114157A JP2020006741A JP2020006741A JP2021114157A JP 2021114157 A JP2021114157 A JP 2021114157A JP 2020006741 A JP2020006741 A JP 2020006741A JP 2020006741 A JP2020006741 A JP 2020006741A JP 2021114157 A JP2021114157 A JP 2021114157A
- Authority
- JP
- Japan
- Prior art keywords
- authentication code
- ciphertext
- plaintext
- command
- pso
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012795 verification Methods 0.000 title claims abstract description 54
- 238000000034 method Methods 0.000 title claims abstract description 11
- 230000004044 response Effects 0.000 claims abstract description 123
- 238000012545 processing Methods 0.000 claims description 27
- 230000015654 memory Effects 0.000 claims description 13
- 230000005540 biological transmission Effects 0.000 claims description 12
- 230000006870 function Effects 0.000 claims description 11
- 238000010586 diagram Methods 0.000 description 20
- 238000013475 authorization Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000013524 data verification Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000003936 working memory Effects 0.000 description 1
Images
Abstract
Description
本発明は、セキュアエレメント等の電子情報記憶媒体によるデータの暗号化または復号処理方法等の技術分野に関する。 The present invention relates to a technical field such as a data encryption or decryption processing method using an electronic information storage medium such as a secure element.
従来、例えば特許文献1に開示されるように、通信ネットワークを介してサーバ装置と通信可能に接続される端末装置に備えられるセキュアエレメントが端末装置により受信されたデータの正当性を検証し、データが正当か否かを示す検証結果を出力する技術が知られている。特許文献1の技術によれば、データの検証は、当該データとともに受信された認証コードと、当該データとセキュアエレメント内に格納された共通鍵に基づいて導出された認証コードとが一致するか否かに基づいて行われるようになっている。また、従来から知られるAES(Advanced Encryption Standard)-GCM(Galois Counter Mode)においては、受信されたデータ(暗号化されたデータ)の復号に加えて、当該暗号化データとともに受信された認証コードと当該暗号化データに基づいて生成された認証コードとが一致するか否かの検証が行われるようになっている。
Conventionally, as disclosed in, for example,
ところで、国際規格ISO7816-8において、セキュアエレメントに様々なセキュリティオペレーションを実行させることが可能なPSO(PERFORM SECURITY OPERATION)コマンドが定義されている。このようなセキュリティオペレーションとして、認証コード(電子署名)の生成、認証コードの検証、データの暗号化、及びデータの復号等をPSOコマンドのヘッダ部のコマンドパラメータ(P1及びP2)により指定可能になっている。しかしながら、1つのPSOコマンドに複数種類のセキュリティオペレーション(例えば、データの復号と認証コードの検証、またはデータの暗号化と認証コードの生成)を指定することができないため、セキュアエレメントは複数のセキュリティオペレーションを同時に実行することはできない。そのため、PSOコマンドにおいて、AES-GCMを利用した場合は相性が悪い。 By the way, the international standard ISO7816-8 defines a PSO (PERFORM SECURITY OPERATION) command that allows a secure element to perform various security operations. As such a security operation, it is possible to specify the generation of an authentication code (electronic signature), the verification of the authentication code, the encryption of data, the decryption of data, etc. by the command parameters (P1 and P2) in the header part of the PSO command. ing. However, a secure element can have multiple security operations because one PSO command cannot specify multiple types of security operations (eg, data decryption and authorization code verification, or data encryption and authorization code generation). Cannot be executed at the same time. Therefore, when AES-GCM is used in the PSO command, the compatibility is poor.
そこで、本発明は、このような点等に鑑みてなされたものであり、複数種類のセキュリティオペレーションを同タイミングで実行可能な電子情報記憶媒体、認証コード生成方法、認証コード検証方法、及びプログラムを提供することを課題とする。 Therefore, the present invention has been made in view of such points and the like, and provides an electronic information storage medium, an authentication code generation method, an authentication code verification method, and a program capable of executing a plurality of types of security operations at the same timing. The challenge is to provide.
上記課題を解決するために、請求項1に記載の発明は、平文を含み、当該平文の暗号化及び認証コードの生成を指定するコマンドを外部装置から受信する受信手段と、前記コマンドに応じて前記平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成する処理手段と、前記暗号文及び前記認証コードを含むレスポンスを前記外部装置へ送信する送信手段と、を備えることを特徴とする。
In order to solve the above problem, the invention according to
請求項2に記載の発明は、請求項1に記載の電子情報記憶媒体において、前記受信手段は、複数に分割された平文のうちの1つの平文を含み、当該平文の暗号化及び前記認証コードの生成を指定するコマンドを複数回受信し、前記処理手段は、前記コマンドを受信するごとに、当該受信された平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成し、前記送信手段は、複数に分割された平文のうちの最後の平文以外の平文の暗号化においては前記生成された暗号文を含み且つ前記生成された認証コードを含まない前記レスポンスを送信し、最後の平文の暗号化においては前記生成された暗号文及び前記生成された認証コードを含む前記レスポンスを送信することを特徴とする。
The invention according to
請求項3に記載の発明は、請求項1または2に記載の電子情報記憶媒体において、前回生成されてメモリに記憶された認証コードを、今回生成された認証コードにより更新する更新手段を更に備えることを特徴とする。
The invention according to claim 3 further includes an updating means for updating the authentication code previously generated and stored in the memory in the electronic information storage medium according to
請求項4に記載の発明は、暗号文を含み、当該暗号文の復号及び認証コードの検証を指定するコマンドを外部装置から受信する受信手段と、前記コマンドに応じて前記暗号文を復号して平文を抽出し、且つ前記暗号文に基づいて認証コードを生成し当該認証コードを検証する処理手段と、前記平文及び前記認証コードの検証結果を含むレスポンスを前記外部装置へ送信する送信手段と、を備えることを特徴とする。
The invention according to
請求項5に記載の発明は、請求項4に記載の電子情報記憶媒体において、前記受信手段は、複数に分割された暗号文のうちの1つの暗号文を含み、当該暗号文の復号及び前記認証コードの検証を指定するコマンドを複数回受信し、前記処理手段は、前記コマンドを受信するごとに、当該受信された暗号文を復号して平文を抽出し、且つ当該受信された暗号文に基づいて認証コードを生成し当該認証コードを検証し、前記送信手段は、複数に分割された暗号文のうちの最後の暗号文以外の暗号文の復号においては前記抽出された平文を含む前記レスポンスを送信する一方、最後の暗号文の復号においては抽出された平文及び前記認証コードの検証結果を含む前記レスポンスを送信することを特徴とする。
The invention according to
請求項6に記載の発明は、請求項4または5に記載の電子情報記憶媒体において、前回生成されてメモリに記憶された認証コードを、今回生成された認証コードにより更新する更新手段を更に備えることを特徴とする。
The invention according to claim 6 further includes an updating means for updating the authentication code previously generated and stored in the memory in the electronic information storage medium according to
請求項7に記載の発明は、請求項4乃至6の何れか一項に記載の電子情報記憶媒体において、前記処理手段は、前記外部装置から受信されてメモリに保存された検証用認証コードと、前記n番目の暗号文を含む前記コマンドの受信において生成された前記認証コードとを比較することで検証することを特徴とする。
The invention according to claim 7 is the electronic information storage medium according to any one of
請求項8に記載の発明は、平文を含み、当該平文の暗号化及び認証コードの生成を指定するコマンドを外部装置から受信するステップと、前記コマンドに応じて前記平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成するステップと、前記暗号文及び前記認証コードを含むレスポンスを前記外部装置へ送信するステップと、を含むことを特徴とする。 The invention according to claim 8 includes a plaintext, a step of receiving a command for specifying encryption of the plaintext and generation of an authentication code from an external device, and encrypting the plaintext in response to the command to obtain a ciphertext. It is characterized by including a step of generating and generating an authentication code based on the generated ciphertext, and a step of transmitting the ciphertext and a response including the authentication code to the external device.
請求項9に記載の発明は、暗号文を含み、当該暗号文の復号及び認証コードの検証を指定するコマンドを外部装置から受信するステップと、前記コマンドに応じて前記暗号文を復号して平文を抽出し、且つ前記暗号文に基づいて認証コードを生成し当該認証コードを検証するステップと、前記平文及び前記認証コードの検証結果を含むレスポンスを前記外部装置へ送信するステップと、を含むことを特徴とする。
The invention according to
請求項10に記載の発明は、平文を含み、当該平文の暗号化及び認証コードの生成を指定するコマンドを外部装置から受信する受信手段と、前記コマンドに応じて前記平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成する処理手段と、前記暗号文及び前記認証コードを含むレスポンスを前記外部装置へ送信する送信手段として機能させることを特徴とする。
The invention according to
請求項11に記載の発明は、暗号文を含み、当該暗号文の復号及び認証コードの検証を指定するコマンドを外部装置から受信する受信手段と、前記コマンドに応じて前記暗号文を復号して平文を抽出し、且つ前記暗号文に基づいて認証コードを生成し当該認証コードを検証する処理手段と、前記平文及び前記認証コードの検証結果を含むレスポンスを前記外部装置へ送信する送信手段として機能させることを特徴とする。 The invention according to claim 11 includes a ciphertext, a receiving means for receiving a command specifying decryption of the ciphertext and verification of an authentication code from an external device, and decrypting the ciphertext in response to the command. It functions as a processing means for extracting plaintext and generating an authentication code based on the ciphertext to verify the authentication code, and a transmitting means for transmitting a response including the verification result of the plaintext and the authentication code to the external device. It is characterized by letting it.
本発明によれば、複数種類のセキュリティオペレーションを同タイミングで実行することができる。 According to the present invention, a plurality of types of security operations can be executed at the same timing.
以下、図面を参照して本発明の実施形態について詳細に説明する。以下に説明する実施形態は、セキュアエレメント(以下、「SE」という)に対して本発明を適用した場合の実施の形態である。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiments described below are embodiments when the present invention is applied to a secure element (hereinafter referred to as “SE”).
[1.SE1の構成及び機能]
先ず、図1を参照して、本実施形態に係るSE1の構成及び機能について説明する。図1は、SE1の概要構成例を示す図である。SE1は、本発明の電子情報記憶媒体の一例である。図1に示すように、SE1は、CPU(Central Processing Unit)10、RAM(Random Access Memory)11、ROM(Read Only Memory)12、NVM(Nonvolatile Memory)13(不揮発性メモリ)、及びI/O回路14などを備えて構成される(ROM12は備えられない場合もある)。SE1は、例えばIoT製品やスマートフォン等の端末に搭載されて使用される。なお、SE1は、着脱可能なICカードとして端末に搭載されてもよいし、eUICC(Embedded Universal Integrated Circuit Card)として端末から容易に取り外しや取り換えができないように組み込み基盤上に搭載(つまり、端末と一体的に形成)されてもよい。
[1. SE1 configuration and function]
First, the configuration and function of SE1 according to the present embodiment will be described with reference to FIG. FIG. 1 is a diagram showing a schematic configuration example of SE1. SE1 is an example of the electronic information storage medium of the present invention. As shown in FIG. 1, the SE1 includes a CPU (Central Processing Unit) 10, a RAM (Random Access Memory) 11, a ROM (Read Only Memory) 12, an NVM (Nonvolatile Memory) 13 (nonvolatile memory), and an I / O. It is configured to include a circuit 14 and the like (the ROM 12 may not be provided). SE1 is mounted and used in terminals such as IoT products and smartphones, for example. The SE1 may be mounted on the terminal as a detachable IC card, or mounted on the embedded board as an eUICC (Embedded Universal Integrated Circuit Card) so that it cannot be easily removed or replaced from the terminal (that is, with the terminal). It may be integrally formed).
CPU10は、ROM12またはNVM13に記憶された各種プログラムを実行するプロセッサ(コンピュータ)である。CPU10は、本発明における受信手段、処理手段、更新手段、及び送信手段として機能する。RAM11は、作業用メモリとして利用される。NVM13には、例えばフラッシュメモリが適用される。NVM13は、「Electrically Erasable Programmable Read-Only Memory」であってもよい。NVM13には、各種プログラム(本発明のプログラムを含む)及びデータ(例えば、鍵データ)が記憶される。各種プログラムには、オペレーティングシステム(OS)及びアプリケーションなどが含まれる。なお、NVM13に記憶される各種プログラム及びデータの一部は、ROM12に記憶されてもよい。
The
I/O回路14は、外部装置2との間のインターフェースを担う。外部装置2は、例えば、SE1が搭載される端末のコントローラである。ただし、外部装置2は、ネットワークに接続されたサーバや、接触(または非接触)で通信可能なリーダライタであってもよい。インターフェースの例として、SPI(Serial Peripheral Interface) 、I2C(Inter-Integrated Circuit)、及びISO7816のインターフェースなどが挙げられる。外部装置2からのコマンドは、I/O回路14を通じて受信される。また、外部装置2へのレスポンスは、I/O回路14を通じて外部装置2へ送信される。なお、本実施形態では、ISO7816-3で定義されるコマンドAPDU(Application Protocol Data Unit)及びレスポンスAPDUがSE1と外部装置2との間で送受信されるものとする。
The I / O circuit 14 serves as an interface with the
コマンドAPDUは、例えば、CLA、INS、P1及びP2とから構成されるヘッダと、Lc、Data及びLeとから構成されるボディとからなる。ここで、CLAはコマンドクラスを示し、INSはコマンドコードを示し、P1及びP2はコマンドパラメータを示し、例えばセキュリティオペレーションが指定される。LcはDataの長さ(データ長)を示し、LeはレスポンスAPDU内のDATAに期待される最大長を示す。Data及びDATAは、TLV(Tag-Length-Value)構造で表されるとよい。一方、レスポンスAPDUは、例えば、DATA、SW(SW1,SW2)から構成される。ここで、SWは、ステータスワードであり、コマンドAPDUに基づいて実行されたコマンド処理(換言すると、コマンドAPDUに応じた処理)の結果を示す。例えば、SWが“9000(h)”である場合、正常終了を示し、SWが例えば“6281(h)”である場合、エラー(データに異常がある)を示す。 The command APDU consists of, for example, a header composed of CLA, INS, P1 and P2, and a body composed of Lc, Data and Le. Here, CLA indicates a command class, INS indicates a command code, P1 and P2 indicate command parameters, and security operations are specified, for example. Lc indicates the length of Data (data length), and Le indicates the maximum length expected for DATA in the response APDU. Data and DATA may be represented by a TLV (Tag-Length-Value) structure. On the other hand, the response APDU is composed of, for example, DATA and SW (SW1, SW2). Here, SW is a status word and indicates the result of command processing executed based on the command APDU (in other words, processing according to the command APDU). For example, when SW is "9000 (h)", it indicates normal termination, and when SW is "6281 (h)", for example, it indicates an error (there is an abnormality in the data).
本実施形態では、ISO7816-8に規定されたPSOコマンドの機能を拡張することで、平文の暗号化と認証コードの生成(複数種類のセキュリティオペレーション)とを同タイミングで実行させることを可能とし、また、暗号文の復号と認証コードの検証(複数種類のセキュリティオペレーション)とを同タイミングで実行させることを可能とした。ここで、同タイミングで実行させるとは、1つのコマンドAPDUの受信から当該コマンドAPDUに対するレスポンスAPDUの送信までの時間内に実行させることを意味する。なお、1つの平文から分割された各平文、或いは、1つの暗号文から分割された各暗号文がそれぞれのコマンドAPDUにより処理される場合、同タイミングで実行させるとは、複数のコマンドAPDUの中の少なくとも1つのコマンドAPDUの受信から当該コマンドAPDUに対するレスポンスAPDUの送信までの時間内に実行させるものとすればよい。 In this embodiment, by extending the function of the PSO command specified in ISO7816-8, it is possible to execute plaintext encryption and authentication code generation (multiple types of security operations) at the same timing. In addition, it is possible to execute the decryption of the ciphertext and the verification of the authentication code (multiple types of security operations) at the same timing. Here, to execute at the same timing means to execute within the time from the reception of one command APDU to the transmission of the response APDU for the command APDU. When each plaintext divided from one plaintext or each ciphertext divided from one ciphertext is processed by each command APDU, it is said that the execution is performed at the same timing among a plurality of command APDUs. It may be executed within the time from the reception of at least one command APDU of the above to the transmission of the response APDU in response to the command APDU.
ところで、従来技術では、ICカードが外部からのコマンドAPDUに応じて、暗号文と、当該暗号文の改竄等をチェックするための認証コードとを外部装置2へ提供するためには、先ずはP1及びP2により暗号化(ENCIPHER)が指定されたPSOコマンドに応じて平文を暗号化して暗号文を生成し当該暗号文を含むレスポンスを送信し、その後、当該暗号文を含みP1及びP2により認証コード生成(COMPUTE DIGITAL SIGNATURE)が指定されたPSOコマンドに応じて当該暗号文から認証コードを生成し当該認証コードを含むレスポンスを送信するようになっていた。この場合、特に、暗号化対象となる平文が長いと、SE1と外部装置2との間の暗号文のやり取りに無駄な時間を費やしてしまい効率が悪い。このことは、暗号文の復号(DECIPHER)と認証コードの検証(VERIFY DIGITAL SIGNATURE)においても同様のことが言える。本実施形態によれば、このように無駄な時間を費やすことを低減して時間の効率化を図ることができる。
By the way, in the prior art, in order for the IC card to provide the
図2(A)は、PSOコマンドの機能を拡張した拡張PSOコマンドαのデータ構造の一例を示す図であり、図2(B)は、拡張PSOレスポンスαのデータ構造の一例を示す図である。拡張PSOコマンドαは、図2(A)に示すように、INSによりPSOコマンドが示され、P1及びP2によりセキュリティオペレーションとしての平文の暗号化及び認証コードの生成が指定され、Dataに平文が含まれて構成される。また、拡張PSOレスポンスαは、図2(B)に示すように、DATAに暗号文及び認証コードが含まれて構成される。なお、拡張PSOコマンドαに応じた処理が正常に行われた場合、拡張PSOレスポンスαにおけるSWにより正常終了(9000(h))が示される。 FIG. 2A is a diagram showing an example of the data structure of the extended PSO command α in which the function of the PSO command is extended, and FIG. 2B is a diagram showing an example of the data structure of the extended PSO response α. .. As shown in Fig. 2 (A), the extended PSO command α indicates the PSO command by INS, and P1 and P2 specify plaintext encryption and authentication code generation as security operations, and the data contains plaintext. Is composed of. Further, as shown in FIG. 2B, the extended PSO response α is configured by including a ciphertext and an authentication code in DATA. If the processing according to the extended PSO command α is performed normally, the SW in the extended PSO response α indicates a normal end (9000 (h)).
CPU10は、外部装置2からI/O回路14を通じて拡張PSOコマンドαを受信すると、拡張PSOコマンドαに応じて、拡張PSOコマンドαに含まれる平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成し、生成された暗号文及び認証コードを含む拡張PSOレスポンスαをI/O回路14を通じて外部装置2へ送信する。ここで、平文の暗号化及び認証コードの生成は、例えば、AES-GCMやAES-CBC(Cipher Block Chaining)等のアルゴリズムにより行われるとよい。なお、平文の暗号化にはIV(Initialization Vector)が用いられ、認証コードの生成にはAAD(Additional Authenticated Data)が用いられるとよい。IVにより同一の平文及び同一の鍵データから異なる暗号文が生成可能となる。同様に、AADにより同一の平文及び同一の鍵データから異なる暗号文が生成可能となる。ここで、AES-GCMのアルゴリズムが用いられる場合、平文の暗号化と認証コードの生成とは、同一の鍵データ(1本の鍵)が使用される。一方、AES-CBCのアルゴリズムが用いられる場合、平文の暗号化では鍵データには暗号化用の暗号鍵が使用され、認証コードの生成では鍵データには認証コード生成用の認証鍵が使用される(つまり、平文の暗号化と認証コードの生成とで鍵データが分けられる)。
When the
また、平文の長さが1回分の拡張PSOコマンドαのDataに含めることが可能な長さ(つまり、Lcにより指定可能なデータ長)を超える場合、または平文から生成される暗号文の長さが1回分の拡張PSOレスポンスαのDATAに含めることが可能の長さ(つまり、Leにより指定可能なデータ長)を超える場合、当該平文は外部装置2により複数に分割されることになる。この場合、CPU10は、n(例えば、n>3)個に分割された平文1〜nのうちの1つの平文を含み、当該平文の暗号化及び認証コードの生成を指定する拡張PSOコマンドαを外部装置2から複数回受信(各拡張PSOコマンドα間には拡張PSOレスポンスαの送信が介在)する。そして、CPU10は、拡張PSOコマンドαを受信するごとに、当該受信された平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コード(例えば、MAC(Message Authentication Code))を生成することになる。
Also, if the plaintext length exceeds the length that can be included in the Data of one extended PSO command α (that is, the data length that can be specified by Lc), or the length of the ciphertext generated from the plaintext. If exceeds the length that can be included in the DATA of the extended PSO response α for one time (that is, the data length that can be specified by Le), the plaintext is divided into a plurality of parts by the
例えば、CPU10は、2番目の平文2を含む拡張PSOコマンドαから最後の平文nを含む拡張PSOコマンドαのそれぞれの受信においては今回受信された平文と前回生成された暗号文と鍵データとを用いて新たな暗号文を生成すれば、セキュリティを高めることができる。例えば、AES-GCMのアルゴリズムの場合、暗号文1を鍵データ(鍵データとIVとから生成された鍵データでもよい)で暗号化した値と平文2とのXORがとられることで暗号文2が生成される。また、AES-CBCのアルゴリズムの場合、平文2と暗号文1とのXORの値が暗号鍵で暗号化されることで暗号文2が生成される。ただし、平文2が鍵データで暗号化されることで暗号文2が生成されてもよいし、或いは、暗号化には公知の演算処理が追加されてもよい。一方、最初(1番目)の平文1を含む拡張PSOコマンドαの受信においては前回生成された暗号文がないため、CPU10は、今回受信された平文1とIVと鍵データとを用いて暗号文1を生成すれば、セキュリティを高めることができる。例えば、AES-GCMのアルゴリズムの場合、IVを鍵データで暗号化した値と平文1とのXORがとられることで暗号文1が生成される。また、AES-CBCのアルゴリズムの場合、平文1とIVとのXORの値が暗号鍵で暗号化されることで暗号文1が生成される。ただし、IVを用いずに暗号文1が生成されてもよく、この場合、平文1が鍵データで暗号化されることで暗号文1が生成されるとよいし、或いは、暗号化には公知の演算処理が追加されてもよい。なお、平文が分割されない場合であっても、IVを鍵データで暗号化した値と平文とのXORから暗号文が生成されてもよいし、受信された平文とIVとのXORの値が鍵データで暗号化されることで暗号文が生成されてもよいし、或いは、平文が鍵データで暗号化されることで暗号文が生成されてもよい。
For example, in each reception of the extended PSO command α including the
また、CPU10は、2番目の平文2を含む拡張PSOコマンドαから最後の平文nを含む拡張PSOコマンドαのそれぞれの受信においては今回(つまり、当該受信の際に)生成された暗号文と前回生成された認証コードとを用いて新たな認証コードを生成すれば、セキュリティを高めることができる。例えば、AES-GCMのアルゴリズムの場合、今回生成された暗号文2を鍵データで暗号化した値と前回生成された認証コードとのXORがとられることで新たな認証コードが生成される。また、AES-CBCのアルゴリズムの場合、例えば、今回生成された暗号文2を認証鍵で暗号した値と前回生成された認証コードとのXORがとられることで新たな認証コードが生成される。一方、最初の平文1を含む拡張PSOコマンドαの受信においては前回生成された認証コードがないため、CPU10は、今回生成された暗号文1とAADとを用いて認証コードを生成すれば、セキュリティを高めることができる。例えば、今回生成された暗号文1にADDが連結されることで認証コードが生成される。ただし、AADを用いずに認証コードが生成されてもよく、この場合、暗号文1が認証コードとして生成されるとよい。なお、平文が分割されない場合であっても、暗号文にADDが連結されることで認証コードが生成されてもよいし、暗号文1が認証コードとして生成されてもよい。
Further, the
以上のように生成された認証コードは例えばRAM11の一時保持領域に記憶され、その後、順次生成される認証コードにより更新(例えば、上書き更新)される。つまり、前回生成されてRAM11に記憶された認証コードは、今回生成された認証コードにより更新(時系列で順次更新)される。図3は、平文がn個に分割され、且つAADが用いられる場合における平文、暗号文、及び認証コードとの関係の一例を示す概念図である。図3に示すように、結果的には、平文1〜nを結合した平文Nから、暗号文1〜nを結合した暗号文Nが生成され、当該暗号文NとAADとから認証コードが生成されることになる。
The authentication code generated as described above is stored in, for example, a temporary holding area of the RAM 11, and is subsequently updated (for example, overwritten and updated) by the sequentially generated authentication code. That is, the authentication code generated last time and stored in the RAM 11 is updated (sequentially updated in chronological order) by the authentication code generated this time. FIG. 3 is a conceptual diagram showing an example of the relationship between the plaintext, the ciphertext, and the authentication code when the plaintext is divided into n pieces and AAD is used. As shown in FIG. 3, as a result, the ciphertext N in which the
そして、CPU10は、複数に分割された平文のうちの最後の平文以外の平文の暗号化においては生成された暗号文を含み且つ生成された認証コードを含まない拡張PSOレスポンスαを外部装置2を送信する。一方、CPU10は、最後の平文の暗号化においては生成された暗号文及び生成された認証コードを含む拡張PSOレスポンスαを外部装置2を送信する。つまり、最後の拡張PSOコマンドαが受信された場合に限り、拡張PSOコマンドαに応じて生成された暗号文に加えて、生成された認証コードが含まれる拡張PSOレスポンスαが外部装置2へ送信されることになるので、時間の効率化を図ることができる。
Then, the
一方、図4(A)は、PSOコマンドの機能を拡張した拡張PSOコマンドβのデータ構造の一例を示す図であり、図4(B)は、拡張PSOレスポンスβのデータ構造の一例を示す図である。拡張PSOコマンドβは、図4(A)に示すように、INSによりPSOコマンドが示され、P1及びP2によりセキュリティオペレーションとしての暗号文の復号及び認証コードの検証が指定され、Dataに暗号文が含まれて構成される。また、拡張PSOレスポンスβは、拡張PSOコマンドβに応じた処理が正常に行われた場合、図4(B)に示すように、DATAに平文が含まれて構成される。なお、拡張PSOコマンドβに応じた処理が正常に行われ、認証コードの検証結果が検証成功である場合、拡張PSOレスポンスβにおけるSWにより正常終了(9000(h))が示される。一方、拡張PSOコマンドβに応じた処理が正常に行われ、認証コードの検証結果が検証失敗である場合、拡張PSOレスポンスβにおけるSWによりエラー(6281(h))が示されることになる。 On the other hand, FIG. 4 (A) is a diagram showing an example of the data structure of the extended PSO command β in which the function of the PSO command is extended, and FIG. 4 (B) is a diagram showing an example of the data structure of the extended PSO response β. Is. In the extended PSO command β, as shown in FIG. 4 (A), the PSO command is indicated by INS, the decryption of the ciphertext and the verification of the authentication code as security operations are specified by P1 and P2, and the ciphertext is stored in Data. Included and composed. Further, the extended PSO response β is configured by including plaintext in DATA as shown in FIG. 4B when the processing according to the extended PSO command β is normally performed. If the processing according to the extended PSO command β is performed normally and the verification result of the authentication code is verified successfully, the SW in the extended PSO response β indicates a normal end (9000 (h)). On the other hand, if the processing according to the extended PSO command β is performed normally and the verification result of the authentication code fails, the SW in the extended PSO response β will indicate an error (6281 (h)).
CPU10は、外部装置2からI/O回路14を通じて拡張PSOコマンドβを受信すると、拡張PSOコマンドβに応じて、拡張PSOコマンドβに含まれる暗号文を復号して平文を抽出し、且つ当該暗号文に基づいて認証コードを生成し当該認証コードを検証し、抽出された平文及び認証コードの検証結果を含む拡張PSOレスポンスβをI/O回路14を通じて外部装置2へ送信する。ここで、暗号文の復号は、例えば、AES-GCMやAES-CBC等のアルゴリズムにより行われるとよい。なお、暗号文の復号にはIVが用いられるとよい。
When the
また、暗号文の長さが1回分の拡張PSOコマンドβのDataに含めることが可能の長さ(つまり、Lcにより指定可能なデータ長)を超える場合、当該暗号文は外部装置2により複数に分割されることになる。この場合、CPU10は、n(例えば、n>3)個に分割された暗号文1〜nのうちの1つの暗号文を含み、当該暗号文の復号及び認証コードの検証を指定する拡張PSOコマンドβを複数回受信(各拡張PSOコマンドβ間には拡張PSOレスポンスβの送信が介在)する。そして、CPU10は、拡張PSOコマンドβを受信するごとに、受信された暗号文を復号して平文を抽出し、且つ当該受信された暗号文に基づいて認証コードを生成することになる。
If the length of the ciphertext exceeds the length that can be included in the Data of the extended PSO command β for one time (that is, the data length that can be specified by Lc), the ciphertext is divided into a plurality by the
例えば、CPU10は、2番目の暗号文2を含む拡張PSOコマンドβから最後の暗号文nを含む拡張PSOコマンドβのそれぞれの受信においては今回受信された暗号文と前回生成された暗号文と鍵データを用いて平文を抽出する。例えば、AES-GCMのアルゴリズムの場合、暗号文1を鍵データで復号した値と暗号文2とのXORがとられることで平文2が抽出される。また、AES-CBCのアルゴリズムの場合、暗号文2を暗号鍵で復号した値と暗号文1とのXORがとられることで平文2が抽出される。ただし、暗号文2を鍵データで復号することにより平文2が抽出されてもよいし、或いは、復号には公知の演算処理が追加されてもよい。一方、最初の暗号文1を含む拡張PSOコマンドβの受信においては前回受信された暗号文がないため、CPU10は、今回受信された暗号文とIVと鍵データとを用いて平文を抽出する。例えば、AES-GCMのアルゴリズムの場合、IV(暗号化されたIV)を暗号データで復号した値と暗号文1とのXORがとられることで平文1が抽出される。また、AES-CBCのアルゴリズムの場合、暗号文1を暗号鍵で復号した値とIVとのXORがとられることで平文1が抽出される。ただし、暗号文1を鍵データで復号することにより平文1が抽出されてもよいし、或いは、復号には公知の演算処理が追加されてもよい。なお、暗号文が分割されない場合であってもIV(暗号化されたIV)を暗号データで復号した値と暗号文とのXORから平文が抽出されてもよいし、暗号文を鍵データで復号した値とIVとのXORから平文が抽出されてもよいし、或いは、受信された暗号文が鍵データで復号されることにより平文が抽出されてもよい。
For example, in each reception of the extended PSO command β including the
また、CPU10は、上記と同様、2番目の暗号文2を含む拡張PSOコマンドβから最後の暗号文nを含む拡張PSOコマンドβの受信においては今回受信された暗号文と前回生成された認証コードとを用いて新たな認証コードを生成するとよい。例えば、AES-GCMのアルゴリズムの場合、今回受信された暗号文2を鍵データで復号した値と前回生成された認証コードとのXORがとられることで新たな認証コードが生成される。また、AES-CBCのアルゴリズムの場合、今回受信された暗号文2を認証鍵で復号した値と前回生成された認証コードとのXORがとられることで新たな認証コードが生成される。一方、最初の暗号文1を含む拡張PSOコマンドβの受信においては前回生成された認証コードがないため、上記と同様、CPU10は、今回受信された暗号文1とAADと用いて認証コードを生成するとよい。例えば、今回生成された暗号文1にADDが連結されることで認証コードが生成される。なお、暗号文が分割されない場合であっても、暗号文にADDが連結されることで認証コードが生成されてもよい。以上のように生成された認証コードは例えばRAM11の一時保持領域に記憶され、その後、順次生成される認証コードにより更新される。
Further, similarly to the above, the
さらに、CPU10は、最後の暗号文を含む拡張PSOコマンドβの受信においては、このとき生成された認証コードを検証する。例えば、外部装置2から受信されて例えばRAM11に保存された検証用認証コードと、最後の暗号文を含む拡張PSOコマンドβの受信において生成された認証コードとが比較されることで検証(例えば、検証用認証コードと認証コードとが一致するか否かが判定)される。図5は、暗号文がn個に分割され、且つAADが用いられる場合における平文、暗号文、及び認証コードとの関係を示す図である。図5に示すように、結果的には、暗号文1〜nを結合した暗号文Nから、平文1〜nを結合した平文Nが生成され、当該暗号文NとAADとから認証コードが生成され、当該生成された認証コードと検証用認証コードとが比較されることになる。
Further, the
そして、CPU10は、複数に分割された暗号文のうちの最後の暗号文以外の暗号文の復号においては抽出された平文を含む拡張PSOレスポンスβを外部装置2へ送信する。一方、CPU10は、最後の暗号文の復号においては抽出された平文及び認証コードの検証結果(例えば、検証成功、または検証失敗)を含む拡張PSOレスポンスβを外部装置2へ送信する。つまり、最後の拡張PSOコマンドβが受信された場合に限り、拡張PSOコマンドβに応じて最後の平文の抽出及び認証コードの検証が行われ、当該抽出された平文に加えて、認証コードの検証結果が含まれる拡張PSOレスポンスβが外部装置2へ送信されることになるので、時間の効率化を図ることができる。
Then, the
[2.SE1と外部装置2との間で実施される動作]
次に、SE1と外部装置2との間で実施される動作について説明する。
[2. Operation performed between SE1 and external device 2]
Next, the operation performed between the
(2.1.平文の暗号化と認証コードの生成)
先ず、図6〜図8を参照して、外部装置2が平文の暗号化及び認証コードの生成をSE1に実行させる際の動作について説明する。なお、以下の動作においては、平文の暗号化、暗号文の復号、及び認証コードの生成には、IV及びAADが用いられる場合を例にとるものとする。図6は、暗号化対象となる平文がn個に分割される場合において外部装置2とSE1との間における拡張PSOコマンドα及び拡張PSOレスポンスαのやり取りの一例を示すシーケンス図である。図7は、暗号化対象となる平文がn個に分割される場合において外部装置2とSE1との間でやり取りされる拡張PSOコマンドα及び拡張PSOレスポンスαのデータ構造の一例を示す図である。
(2.1. Plaintext encryption and authentication code generation)
First, with reference to FIGS. 6 to 8, the operation when the
外部装置2は、暗号化対象となる平文の長さとして平文長を取得し、当該平文をn(n>3)個に分割する。そして、外部装置2は、拡張PSOコマンドα-0をSE1へ送信する(ステップS1)。図7(A)に示すように、拡張PSOコマンドα-0におけるCLA“10(h)”は後に拡張PSOコマンドαが連鎖する(つまり、チェイニング中である)ことを示しており、また、拡張PSOコマンドα-0におけるDataにはAAD及び平文長がTLV構造で含まれている。
The
SE1は、外部装置2からの拡張PSOコマンドα-0を受信すると、当該拡張PSOコマンドα-0からAAD及び平文長を取得して例えばRAM11の一時保持領域に記憶し、拡張PSOレスポンスα-0を外部装置2へ送信する(ステップS2)。図7(B)に示すように、拡張PSOレスポンスα-0におけるDATAには暗号文長がTLV構造で含まれており、拡張PSOレスポンスα-0におけるSWは正常終了(9000(h))を示している。
When the SE1 receives the extended PSO command α-0 from the
外部装置2は、SE1からの拡張PSOレスポンスα-0を受信すると、拡張PSOレスポンスα-0から暗号文長を取得し、拡張PSOコマンドα-1をSE1へ送信する(ステップS3)。図7(C)に示すように、拡張PSOコマンドα-1におけるDataにはn個に分割された平文1〜nのうち最初の平文1が含まれている。
When the
SE1は、外部装置2からの拡張PSOコマンドα-1を受信すると、当該拡張PSOコマンドα-1から平文1を取得し、当該取得された平文1とIVと鍵データとを用いた暗号化により暗号文1を生成する(ステップS4)。ここで、IVはSE1内で生成されてもよいし、拡張PSOコマンドα-0におけるDataに含まれて(つまり、PSOコマンドα-0から取得されて)もよい。次いで、SE1は、RAM11の一時保持領域に記憶されたAADとステップS4で生成された暗号文1とを用いて認証コードを生成する(ステップS5)。こうして生成された認証コードは、例えばRAM11の一時保持領域に記憶される。
When the SE1 receives the extended PSO command α-1 from the
次いで、SE1は、拡張PSOレスポンスα-1を外部装置2へ送信する(ステップS6)。図7(D)に示すように、拡張PSOレスポンスα-1におけるDATAにはステップS4で生成された暗号文1が含まれており、拡張PSOレスポンスα-1におけるSWは正常終了(9000(h))を示している。
Next, SE1 transmits the extended PSO response α-1 to the external device 2 (step S6). As shown in FIG. 7 (D), the DATA in the extended PSO response α-1 includes the
こうして拡張PSOレスポンスα-1が外部装置2により受信された後、外部装置2から拡張PSOコマンドα-2から拡張PSOコマンドα-(n-1)がSE1へ順次送信され、上記と同様に処理が行われる。そして、外部装置2は、SE1からの拡張PSOレスポンスα-(n-1)を受信すると、拡張PSOレスポンスα-(n-1)から暗号文n-1を取得し、最後の拡張PSOコマンドα-nをSE1へ送信する(ステップS7)。図7(E)に示すように、拡張PSOコマンドα-nにおけるCLA“00(h)”は後に拡張PSOコマンドαが連鎖しないことを示しており、また、拡張PSOコマンドα-nにおけるDataには最後の平文nが含まれている。なお、最後の拡張PSOコマンドα-nに対する拡張PSOレスポンスα-nには暗号文nに加えてIV及び認証コードが含まれることになるため、このことを考慮して、平文nの上限長が設けられるとよい。
After the extended PSO response α-1 is received by the
SE1は、外部装置2からの拡張PSOコマンドα-nを受信すると、当該拡張PSOコマンドα-nから平文nを取得し、当該取得された平文nと前回生成された暗号文n-1と鍵データとを用いた暗号化により暗号文nを生成する(ステップS8)。次いで、SE1は、ステップS8で生成された暗号文nと前回生成された認証コードとを用いて新たな認証コードを生成する(ステップS9)。こうして生成された認証コードは、例えばRAM11の一時保持領域に前回記憶された認証コードに対して上書き記憶される。
When the SE1 receives the extended PSO command α-n from the
次いで、SE1は、拡張PSOレスポンスα-nを外部装置2へ送信する(ステップS10)。図7(F)に示すように、拡張PSOレスポンスα-nにおけるDATAにはステップS8で生成された暗号文n、ステップS4で暗号化に用いられたIV、及びステップS9で生成された認証コードがTLV構造で含まれており、拡張PSOレスポンスα-nにおけるSWは正常終了(9000(h))を示している。なお、IVが拡張PSOコマンドα-0から取得された場合、当該IVは拡張PSOレスポンスα-nに含まれる必要はない。また、IVは拡張PSOレスポンスα-nではなく初回の拡張PSOレスポンスα-0に含まれてもよい。 Next, SE1 transmits the extended PSO response α-n to the external device 2 (step S10). As shown in FIG. 7 (F), the DATA in the extended PSO response α-n includes the ciphertext n generated in step S8, the IV used for encryption in step S4, and the authentication code generated in step S9. Is included in the TLV structure, and SW in the extended PSO response α-n indicates normal termination (9000 (h)). When the IV is acquired from the extended PSO command α-0, the IV does not need to be included in the extended PSO response α-n. Also, IV may be included in the initial extended PSO response α-0 instead of the extended PSO response α-n.
外部装置2は、SE1からの拡張PSOレスポンスα-nを受信すると、拡張PSOレスポンスα-nから暗号文n、IV及び認証コードを取得し、暗号文1〜nを結合した暗号文Nと当該暗号文Nの改竄等をチェックするための認証コードとIVのセット(組)を不揮発性メモリに記憶する。暗号文Nと認証コードとIVのセットは、例えば外部装置2から所定のサーバへアップロードされる。ここで、IVは、外部装置2側で暗号文Nを復号するために必要となる。なお、図7において、拡張PSOコマンドα-0には先頭の平文1が含まれてもよい。この場合、平文2〜nは順次繰り上がり、拡張PSOコマンドα-(n-1)が最後に送信される拡張PSOコマンドとなる。
When the
一方、図8は、暗号化対象となる平文が分割されない場合において外部装置2とSE1との間でやり取りされる拡張PSOコマンドα及び拡張PSOレスポンスαのデータ構造の一例を示す図である。平文が分割されない場合、図8(A)に示すように、拡張PSOコマンドαにおけるCLA“00(h)”は後に拡張PSOコマンドαが連鎖しないことを示し、また、拡張PSOコマンドαにおけるDataにはAAD及び平文がTLV構造で含まれることになる。そして、拡張PSOコマンドαに含まれる平文とIVと鍵データとを用いた暗号化により暗号文が生成され、当該生成された暗号文とAADとから認証コードが生成されて拡張PSOレスポンスαが外部装置2へ送信される。この場合、図8(B)に示すように、拡張PSOレスポンスαにおけるDATAには暗号文と認証コードとIVとがTLV構造で含まれ、拡張PSOレスポンスαにおけるSWは正常終了(9000(h))を示すことになる。
On the other hand, FIG. 8 is a diagram showing an example of the data structure of the extended PSO command α and the extended PSO response α exchanged between the
(2.2.暗号文の復号と認証コードの検証)
次に、図9〜図11を参照して、外部装置2が暗号文の復号及び認証コードの検証をSE1に実行させる際の動作について説明する。図9は、復号対象となる暗号文がn個に分割される場合において外部装置2とSE1との間における拡張PSOコマンドβ及び拡張PSOレスポンスβのやり取りの一例を示すシーケンス図である。図10は、復号対象となる暗号文がn個に分割される場合において外部装置2とSE1との間でやり取りされる拡張PSOコマンドβ及び拡張PSOレスポンスβのデータ構造の一例を示す図である。
(2.2. Ciphertext decryption and authentication code verification)
Next, with reference to FIGS. 9 to 11, the operation when the
外部装置2は、復号対象となる暗号文の長さとして暗号文長を取得し、当該暗号文をn(n>3)個に分割する。そして、外部装置2は、拡張PSOコマンドβをSE1へ送信する(ステップS21)。図10(A)に示すように、拡張PSOコマンドβ-0におけるCLA“10(h)”は後に拡張PSOコマンドβが連鎖する(つまり、チェイニング中である)ことを示しており、また、拡張PSOコマンドβ-0におけるDataには検証用認証コード、AAD及び暗号文長がTLV構造で含まれている。
The
SE1は、外部装置2からの拡張PSOコマンドβ-0を受信すると、当該拡張PSOコマンドβ-0から検証用認証コード、AAD及び暗号文長を取得して例えばRAM11の一時保持領域に記憶し、拡張PSOレスポンスβ-0を外部装置2へ送信する(ステップS22)。図10(B)に示すように、拡張PSOレスポンスβ-0におけるDATAには平文長がTLV構造で含まれており、拡張PSOレスポンスβ-0におけるSWは正常終了(9000(h))を示している。
When the SE1 receives the extended PSO command β-0 from the
外部装置2は、SE1からの拡張PSOレスポンスβ-0を受信すると、拡張PSOレスポンスβ-0から平文長を取得し、拡張PSOコマンドβ-1をSE1へ送信する(ステップS23)。図10(C)に示すように、拡張PSOコマンドβ-1におけるDataにはn個に分割された暗号文1〜nのうち最初の暗号文1が含まれている。
When the
SE1は、外部装置2からの拡張PSOコマンドβ-1を受信すると、当該拡張PSOコマンドβ-1から暗号文1を取得し、当該取得された暗号文1とIVと鍵データとを用いた復号により平文1を抽出する(ステップS24)。ここで、IVはSE1内で生成されてもよいし、拡張PSOコマンドβ-0におけるDataに含まれて(つまり、拡張PSOコマンドβ-0から取得されて)もよい。次いで、SE1は、RAM11の一時保持領域に記憶されたAADとステップS24で取得された暗号文1とを用いて認証コードを生成する(ステップS25)。こうして生成された認証コードは、例えばRAM11の一時保持領域に記憶される。
When the SE1 receives the extended PSO command β-1 from the
次いで、SE1は、拡張PSOレスポンスβ-1を外部装置2へ送信する(ステップS26)。図10(D)に示すように、拡張PSOレスポンスβ-1におけるDATAにはステップS24で抽出された平文1が含まれており、拡張PSOレスポンスβ-1におけるSWは正常終了(9000(h))を示している。
Next, SE1 transmits the extended PSO response β-1 to the external device 2 (step S26). As shown in FIG. 10 (D), the DATA in the extended PSO response β-1 includes the
こうして拡張PSOレスポンスβ-1が外部装置2により受信された後、外部装置2から拡張PSOコマンドβ-2から拡張PSOコマンドβ-(n-1)がSE1へ順次送信され、上記と同様に処理が行われる。そして、外部装置2は、SE1からの拡張PSOレスポンスβ-(n-1)を受信すると、拡張PSOレスポンスβ-(n-1)から平文n-1を取得し、最後の拡張PSOコマンドβ-nをSE1へ送信する(ステップS27)。図10(E)に示すように、拡張PSOコマンドβ-nにおけるCLA“00(h)”は後に拡張PSOコマンドβが連鎖しないことを示しており、また、拡張PSOコマンドβ-nにおけるDataには最後の暗号文nが含まれている。なお、拡張PSOコマンドβ-nにおけるDataには最後の暗号文n及び検証用認証コードがTLV構造で含まれてもよい(この場合、拡張PSOコマンドβ-0に検証用認証コードが含まれなくてよい)。
After the extended PSO response β-1 is received by the
SE1は、外部装置2からの拡張PSOコマンドβ-nを受信すると、当該拡張PSOコマンドβ-nから暗号文nを取得し、当該取得された暗号文nと前回生成された暗号文n-1と鍵データとを用いた復号により平文nを抽出する(ステップS28)。次いで、SE1は、ステップS28で取得された暗号文nと前回生成された認証コードとを用いて新たな認証コードを生成する(ステップS29)。こうして生成された認証コードは、例えばRAM11の一時保持領域に前回記憶された認証コードに対して上書き記憶される。
When the SE1 receives the extended PSO command β-n from the
次いで、SE1は、検証用認証コードと認証コード(つまり、最新の認証コード)とを比較することで検証する(ステップS30)。次いで、SE1は、拡張PSOレスポンスβ-nを外部装置2へ送信する(ステップS31)。図10(F)に示すように、拡張PSOレスポンスβ-nにおけるDATAにはステップS28で抽出された平文nが含まれており、拡張PSOレスポンスβ-nにおけるSWは、検証成功(認証コードが一致)の場合には正常終了(9000(h))を示し、検証失敗(認証コードが不一致)の場合にはエラー(6281(h))を示すことになる。 Next, SE1 verifies by comparing the verification authentication code with the authentication code (that is, the latest authentication code) (step S30). Next, SE1 transmits the extended PSO response β-n to the external device 2 (step S31). As shown in FIG. 10 (F), the DATA in the extended PSO response β-n includes the plaintext n extracted in step S28, and the SW in the extended PSO response β-n is verified successfully (authentication code is In the case of (match), normal termination (9000 (h)) is indicated, and in the case of verification failure (authentication code mismatch), an error (6281 (h)) is indicated.
外部装置2は、SE1からの拡張PSOレスポンスβ-nを受信すると、拡張PSOレスポンスβ-nが正常終了(9000(h))を示す(つまり、認証コードの検証結果が検証成功である)場合、平文1〜nを結合して平文Nを生成して不揮発性メモリに記憶する。なお、図10において、拡張PSOコマンドβ-0には先頭の暗号文1が含まれてもよい。この場合、暗号文2〜nは順次繰り上がり、拡張PSOコマンドβ-(n-1)が最後に送信される拡張PSOコマンドとなる。
When the
一方、図11は、復号対象となる暗号文が分割されない場合において外部装置2とSE1との間でやり取りされる拡張PSOコマンドβ及び拡張PSOレスポンスβのデータ構造の一例を示す図である。暗号文が分割されない場合、図11(A)に示すように、拡張PSOコマンドβにおけるCLA“00(h)”は後に拡張PSOコマンドβが連鎖しないことを示し、また、拡張PSOコマンドβにおけるDataには検証用認証コード、AAD及び暗号文がTLV構造で含まれている。そして、拡張PSOコマンドβに含まれる暗号文とIVと鍵データとを用いた復号により平文が抽出され、当該暗号文とAADから認証コードが生成され当該認証コードが検証されて拡張PSOレスポンスβが外部装置2へ送信される。この場合、図11(B)に示すように、拡張PSOレスポンスβにおけるDATAには平文が含まれ、拡張PSOレスポンスβにおけるSWは、検証成功の場合には正常終了(9000(h))を示し、検証失敗の場合にはエラー(6281(h))を示すことになる。
On the other hand, FIG. 11 is a diagram showing an example of the data structure of the extended PSO command β and the extended PSO response β exchanged between the
以上説明したように、上記実施形態によれば、SE1は、平文を含み、当該平文の暗号化及び認証コードの生成を指定する拡張PSOコマンドαを外部装置2から受信すると、当該拡張PSOコマンドαに応じて平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成し、当該暗号文及び当該認証コードを含む拡張PSOレスポンスβを外部装置2へ送信するように構成したので、複数種類のセキュリティオペレーションを同タイミングで実行することができる。
As described above, according to the above embodiment, when the SE1 receives the extended PSO command α including the plaintext and specifies the encryption of the plaintext and the generation of the authentication code from the
また、上記実施形態によれば、SE1は、暗号文を含み、当該暗号文の復号及び認証コードの検証を指定する拡張PSOコマンドβを外部装置2から受信すると、当該拡張PSOコマンドβに応じて暗号文を復号して平文を抽出し、且つ暗号文に基づいて認証コードを生成し当該認証コードを検証し、平文及び認証コードの検証結果を含む拡張PSOレスポンスβを外部装置2へ送信するように構成したので、複数種類のセキュリティオペレーションを同タイミングで実行することができる。
Further, according to the above embodiment, when the SE1 receives the extended PSO command β including the ciphertext and specifies the decryption of the ciphertext and the verification of the authentication code from the
1 SE
10 CPU
11 RAM
12 ROM
13 NVM
14 I/O回路
1 SE
10 CPU
11 RAM
12 ROM
13 NVM
14 I / O circuit
Claims (11)
前記コマンドに応じて前記平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成する処理手段と、
前記暗号文及び前記認証コードを含むレスポンスを前記外部装置へ送信する送信手段と、
を備えることを特徴とする電子情報記憶媒体。 A receiving means that receives a command from an external device that includes plaintext and specifies the encryption of the plaintext and the generation of the authentication code.
A processing means that encrypts the plaintext in response to the command to generate a ciphertext and generates an authentication code based on the generated ciphertext.
A transmission means for transmitting a response including the ciphertext and the authentication code to the external device, and
An electronic information storage medium comprising.
前記処理手段は、前記コマンドを受信するごとに、当該受信された平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成し、
前記送信手段は、複数に分割された平文のうちの最後の平文以外の平文の暗号化においては前記生成された暗号文を含み且つ前記生成された認証コードを含まない前記レスポンスを送信し、最後の平文の暗号化においては前記生成された暗号文及び前記生成された認証コードを含む前記レスポンスを送信することを特徴とする請求項1に記載の電子情報記憶媒体。 The receiving means includes one of the plaintexts divided into a plurality of plaintexts, and receives a command specifying the encryption of the plaintexts and the generation of the authentication code a plurality of times.
Each time the processing means receives the command, the received plaintext is encrypted to generate a ciphertext, and an authentication code is generated based on the generated ciphertext.
The transmitting means transmits the response including the generated ciphertext and not including the generated authentication code in the encryption of the plaintext other than the last plaintext among the plaintext divided into a plurality of parts, and finally. The electronic information storage medium according to claim 1, wherein in the plaintext encryption of the above, the response including the generated ciphertext and the generated authentication code is transmitted.
前記コマンドに応じて前記暗号文を復号して平文を抽出し、且つ前記暗号文に基づいて認証コードを生成し当該認証コードを検証する処理手段と、
前記平文及び前記認証コードの検証結果を含むレスポンスを前記外部装置へ送信する送信手段と、
を備えることを特徴とする電子情報記憶媒体。 A receiving means that receives a command from an external device that includes a ciphertext and specifies the decryption of the ciphertext and the verification of the authentication code.
A processing means for decrypting the ciphertext in response to the command, extracting the plaintext, generating an authentication code based on the ciphertext, and verifying the authentication code.
A transmission means for transmitting a response including the plaintext and the verification result of the authentication code to the external device, and
An electronic information storage medium comprising.
前記処理手段は、前記コマンドを受信するごとに、当該受信された暗号文を復号して平文を抽出し、且つ当該受信された暗号文に基づいて認証コードを生成し当該認証コードを検証し、
前記送信手段は、複数に分割された暗号文のうちの最後の暗号文以外の暗号文の復号においては前記抽出された平文を含む前記レスポンスを送信する一方、最後の暗号文の復号においては抽出された平文及び前記認証コードの検証結果を含む前記レスポンスを送信することを特徴とする請求項4に記載の電子情報記憶媒体。 The receiving means includes one of the ciphertexts divided into a plurality of ciphertexts, and receives a command specifying the decryption of the ciphertext and the verification of the authentication code a plurality of times.
Each time the processing means receives the command, the received ciphertext is decrypted to extract the plaintext, and an authentication code is generated based on the received ciphertext to verify the authentication code.
The transmitting means transmits the response including the extracted plaintext in decrypting a ciphertext other than the last ciphertext among the ciphertexts divided into a plurality of parts, while extracting in decrypting the last ciphertext. The electronic information storage medium according to claim 4, wherein the response including the plaintext and the verification result of the authentication code is transmitted.
前記コマンドに応じて前記平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成するステップと、
前記暗号文及び前記認証コードを含むレスポンスを前記外部装置へ送信するステップと、
を含むことを特徴とする認証コード生成方法。 A step of receiving a command from an external device that includes plaintext and specifies the encryption of the plaintext and the generation of an authentication code, and
A step of encrypting the plaintext in response to the command to generate a ciphertext and generating an authentication code based on the generated ciphertext.
A step of transmitting a response including the ciphertext and the authentication code to the external device, and
An authentication code generation method characterized by including.
前記コマンドに応じて前記暗号文を復号して平文を抽出し、且つ前記暗号文に基づいて認証コードを生成し当該認証コードを検証するステップと、
前記平文及び前記認証コードの検証結果を含むレスポンスを前記外部装置へ送信するステップと、
を含むことを特徴とする認証コード検証方法。 A step of receiving a command from an external device that includes a ciphertext and specifies decryption of the ciphertext and verification of the authentication code, and
A step of decrypting the ciphertext in response to the command, extracting the plaintext, generating an authentication code based on the ciphertext, and verifying the authentication code.
A step of transmitting a response including the plaintext and the verification result of the authentication code to the external device, and
An authentication code verification method characterized by including.
前記コマンドに応じて前記平文を暗号化して暗号文を生成し、且つ当該生成された暗号文に基づいて認証コードを生成する処理手段と、
前記暗号文及び前記認証コードを含むレスポンスを前記外部装置へ送信する送信手段として機能させることを特徴とするプログラム。 A receiving means that receives a command from an external device that includes plaintext and specifies the encryption of the plaintext and the generation of the authentication code.
A processing means that encrypts the plaintext in response to the command to generate a ciphertext and generates an authentication code based on the generated ciphertext.
A program characterized by functioning as a transmission means for transmitting a response including the ciphertext and the authentication code to the external device.
前記コマンドに応じて前記暗号文を復号して平文を抽出し、且つ前記暗号文に基づいて認証コードを生成し当該認証コードを検証する処理手段と、
前記平文及び前記認証コードの検証結果を含むレスポンスを前記外部装置へ送信する送信手段として機能させることを特徴とするプログラム。 A receiving means that receives a command from an external device that includes a ciphertext and specifies the decryption of the ciphertext and the verification of the authentication code.
A processing means for decrypting the ciphertext in response to the command, extracting the plaintext, generating an authentication code based on the ciphertext, and verifying the authentication code.
A program characterized in that it functions as a transmission means for transmitting a response including the verification result of the plain text and the authentication code to the external device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020006741A JP7397403B2 (en) | 2020-01-20 | 2020-01-20 | Electronic information storage medium, authentication code generation method, authentication code verification method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020006741A JP7397403B2 (en) | 2020-01-20 | 2020-01-20 | Electronic information storage medium, authentication code generation method, authentication code verification method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2021114157A true JP2021114157A (en) | 2021-08-05 |
JP7397403B2 JP7397403B2 (en) | 2023-12-13 |
Family
ID=77077622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020006741A Active JP7397403B2 (en) | 2020-01-20 | 2020-01-20 | Electronic information storage medium, authentication code generation method, authentication code verification method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7397403B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4736729B2 (en) | 2005-11-14 | 2011-07-27 | 株式会社日立製作所 | Secure terminal system using IC card and method thereof |
JP5103803B2 (en) | 2006-06-26 | 2012-12-19 | 大日本印刷株式会社 | IC card with mode change function and IC card program |
US9705674B2 (en) | 2013-02-12 | 2017-07-11 | Amazon Technologies, Inc. | Federated key management |
-
2020
- 2020-01-20 JP JP2020006741A patent/JP7397403B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP7397403B2 (en) | 2023-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106464498B (en) | Method for authenticating a first electronic entity by a second electronic entity and electronic entity | |
JP2901767B2 (en) | Cryptographic communication system and portable electronic device | |
CN108377190B (en) | Authentication equipment and working method thereof | |
WO2022060471A2 (en) | Secure communication with two post-quantum cryptography key encapsulations and authentication | |
EP1977552B1 (en) | Method and system for personalizing smart cards using asymmetric key cryptography | |
JP4763368B2 (en) | COMMUNICATION CARD, CONFIDENTIAL INFORMATION PROCESSING SYSTEM, CONFIDENTIAL INFORMATION TRANSFER METHOD, AND PROGRAM | |
EP2506488B1 (en) | Secure dynamic on-chip key programming | |
US9787663B2 (en) | Replaying a batch of secure commands in a secure channel | |
CN111639348B (en) | Management method and device of database keys | |
JP4763447B2 (en) | Authentication system and authentication target device | |
US20210351942A1 (en) | Embedding protected memory access into a rfid authentication process based on a challenge-response mechanism | |
US20230171100A1 (en) | Personalization of a secure element | |
CN112016103A (en) | Method and apparatus for cryptographic alignment and binding of a secure element with a host device | |
CN112400294B (en) | Secure communications from within a non-volatile memory device | |
JP6888122B2 (en) | Semiconductor device, update data provision method, update data reception method and program | |
CN112703500A (en) | Protecting data stored in memory of IoT devices during low power mode | |
JP7397403B2 (en) | Electronic information storage medium, authentication code generation method, authentication code verification method, and program | |
JP2008124987A (en) | Cipher communication apparatus and cipher communication system and cipher communication method and program | |
JP7052616B2 (en) | Communication devices, data transmission methods, and programs | |
CN113158218A (en) | Data encryption method and device and data decryption method and device | |
JP6965790B2 (en) | Electronic information storage media, command processing methods, and programs | |
JP6436794B2 (en) | Information processing apparatus, control method thereof, and program | |
JP3310989B2 (en) | Data communication method | |
JP7105894B2 (en) | Mutual authentication method and communication system | |
KR101663852B1 (en) | Device of conducting electric transaction using sam card directly performing electric transaction process and method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20221129 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20230712 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230718 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230911 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20231101 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20231114 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7397403 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |