JP7322923B2 - Secure element, transaction control method and device - Google Patents
Secure element, transaction control method and device Download PDFInfo
- Publication number
- JP7322923B2 JP7322923B2 JP2021085894A JP2021085894A JP7322923B2 JP 7322923 B2 JP7322923 B2 JP 7322923B2 JP 2021085894 A JP2021085894 A JP 2021085894A JP 2021085894 A JP2021085894 A JP 2021085894A JP 7322923 B2 JP7322923 B2 JP 7322923B2
- Authority
- JP
- Japan
- Prior art keywords
- write
- data
- area
- page
- transaction control
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 63
- 238000013500 data storage Methods 0.000 claims description 15
- 238000010586 diagram Methods 0.000 description 13
- 230000015654 memory Effects 0.000 description 12
- 238000007726 management method Methods 0.000 description 8
- 239000004065 semiconductor Substances 0.000 description 2
- 238000013523 data management Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
Images
Landscapes
- Memory System (AREA)
- Stored Programmes (AREA)
Description
本発明は,外部からの解析攻撃に対する強固な耐タンパー性を持つ半導体製品であるセキュアエレメントに関する。更に詳しくは,本発明は,データの一貫性を保つためのトランザクション制御に関する。 The present invention relates to a secure element, which is a semiconductor product having strong tamper resistance against analysis attacks from the outside. More particularly, the present invention relates to transaction control for maintaining data consistency.
外部からの解析攻撃に対する強固な耐タンパー性を持つ半導体製品であるセキュアエレメントは,様々なデバイス(例えば,ICカード)に搭載されている。セキュアエレメントを搭載したデバイスの主用途はセキュリティ用途(例えば,金融決済用途)になる。 A secure element, which is a semiconductor product with strong tamper resistance against analysis attacks from the outside, is installed in various devices (for example, IC cards). The main use of devices equipped with secure elements is security use (for example, financial settlement use).
セキュリティ用途で用いられるデバイスに実装するセキュアエレメントは,データを記憶するメモリとして,電気的に書き換え可能な不揮発性メモリで構成される不揮発性ストレージを備える。セキュアエレメントの不揮発性ストレージは,一定サイズのページと呼ばれる単位で管理される。 A secure element installed in a device used for security purposes has a non-volatile storage consisting of an electrically rewritable non-volatile memory as a memory for storing data. The secure element's non-volatile storage is managed in units called pages of a fixed size.
セキュリティ用途で利用されるセキュアエレメントには,不揮発性ストレージに記憶されたデータを書き換える際,書き換え対象にならないデータの一貫性が要求される。データの一貫性とは,データを書き換えている途中でセキュアエレメントの電源が失われても,少なくとも書き換え対象にならないデータを書き換える前の状態に復旧できることを意味する。なお,データの一貫性はデータの完全性またはデータの原子性(Atomicity)と称されることもある。 Secure elements used for security require consistency of data that is not subject to rewriting when data stored in non-volatile storage is rewritten. Data consistency means that even if the power to the secure element is lost while data is being rewritten, at least the data that is not subject to rewriting can be restored to the state before rewriting. Data consistency is also called data completeness or data atomicity.
Javaカード(登録商標)などには,データの一貫性を保証するトランザクション機能が予め備えられている。また,データの一貫性をセキュアエレメントに持たせる発明として,特許文献1,2では,データを退避させるバックアップ領域を不揮発性ストレージに設ける発明が開示されている。
A Java card (registered trademark) or the like is provided in advance with a transaction function that guarantees data consistency. Further, as inventions for providing data consistency to a secure element,
データの一貫性がセキュアエレメントに求められる一方で,セキュアエレメントでは,不揮発性ストレージの耐久性が問題になる。これは,不揮発性ストレージを構成する電気的に書き換え可能な不揮発性メモリには,書き込み耐久回数が設けられることによる。電気的に書き換え可能な不揮発性メモリで構成される不揮発性ストレージの耐久性を向上させる手法もすでに開示されている。例えば,不揮発性ストレージの耐久性を向上させる発明として,特許文献3では,データの書き換えが発生する不揮発性ストレージの領域を多重化する発明が開示されている。 While data consistency is required for secure elements, non-volatile storage durability is an issue for secure elements. This is because the electrically rewritable nonvolatile memory that constitutes the nonvolatile storage is provided with a write endurance count. Techniques for improving the durability of nonvolatile storage composed of electrically rewritable nonvolatile memory have already been disclosed. For example, as an invention for improving the durability of non-volatile storage, Patent Document 3 discloses an invention for multiplexing non-volatile storage areas in which data is rewritten.
近年,セキュアエレメントが使用するデータのサイズが増加したことにより,セキュアエレメントが備える不揮発性ストレージのデータ容量が増加し,不揮発性ストレージの管理単位となるページのサイズも増加傾向にある。 In recent years, as the size of data used by secure elements has increased, the data capacity of non-volatile storage provided in secure elements has increased, and the size of pages, which are the management unit of non-volatile storage, has also tended to increase.
ページのサイズが大きくなると,サイズが大きいデータを扱う場合,データを書き込むページの数量が少なくて済むなどの利点が生じる。しかし,サイズが小さいデータを取り扱う場合,1つのページに含まれるデータの数が多くなるため,サイズが小さいデータの書き換え頻度が多いと,1つのページに対する書込み回数が増え,不揮発性ストレージの耐久性に問題が生じる。 If the page size is large, there are advantages such as the number of pages to write data to can be reduced when handling large-sized data. However, when handling small-sized data, the number of data contained in one page increases, so if small-sized data is rewritten frequently, the number of writes to one page increases, and the durability of non-volatile storage increases. problems arise.
そこで,本発明は,サイズが小さく書き換え頻度の高い複数のデータが1つのページに含まれる場合であっても,データの一貫性を保証しつつ,1ページへの書き込み回数を軽減できることを目的とする。 Therefore, the present invention aims to reduce the number of writes to one page while guaranteeing data consistency even when multiple pieces of data that are small in size and frequently rewritten are included in one page. do.
上記課題を解決する第1発明は,ページの単位でデータの書き込みが可能な不揮発性ストレージを有するセキュアエレメントであって,先行書込み方式のトランザクション制御の開始指示を受けると,データ格納領域とは別に前記不揮発性ストレージに設けた先行書き込み領域に,書き込みデータを書き込む先行書込み処理と,先行書込み方式のトランザクション制御の終了指示を受けると,前記先行書き込み領域に書き込まれた書き込みデータごとに書き込みデータの書き込み先ページを確認し,書き込み先ページが同一の書き込みデータを一括して同一の書き込み先ページに書き込むページ更新処理を実行するトランザクション制御手段を備えていることを特徴とする。 A first invention for solving the above-mentioned problems is a secure element having a non-volatile storage in which data can be written in units of pages. Write-ahead processing for writing write data in a write-ahead area provided in the non-volatile storage, and write data for each write data written to the write-ahead area when an instruction to end transaction control of the write-ahead method is received. It is characterized by comprising transaction control means for confirming the destination page and executing page update processing for collectively writing write data having the same destination page to the same destination page.
更に,第2発明は,第1発明に記載したセキュアエレメントにおいて,前記トランザクション制御手段は,前記ページ更新処理において,書き込み先ページと書き込み先アドレスが同じ書き込みデータが先行書き込み領域に複数存在する場合,最後に前記先行書き込み領域に書き込んだ書き込みデータを前記ページ更新処理に用いることを特徴とする。 Furthermore, a second invention is the secure element described in the first invention, wherein in the page update process, when a plurality of write data having the same write destination page and write destination address exist in the preceding write area, The write data written in the preceding write area last is used for the page update process.
更に,第3発明は,第1発明または第2発明に記載したセキュアエレメントにおいて,前記トランザクション制御手段は,前記ページ更新処理において,書き込み先ページに書き込んだ書き込みデータを前記先行書き込み領域から削除し,電源が投入された直後の前記先行書き込み領域に書き込みデータが存在する場合,前記先行書き込み領域に存在する書き込みデータを用いて前記ページ更新処理を実行することを特徴とする。 Furthermore, a third invention is the secure element according to the first invention or the second invention, wherein the transaction control means deletes the write data written to the write destination page from the preceding write area in the page update process, When write data exists in the preceding write area immediately after the power is turned on, the page updating process is performed using the write data existing in the preceding writing area.
更に,第4発明は,第1発明から第3発明のいずれか一つに記載したセキュアエレメントを実装したデバイスである。 Furthermore, a fourth invention is a device implementing the secure element described in any one of the first to third inventions.
更に,第5発明は,ページの単位でデータの書き込みが可能な不揮発性ストレージを有するセキュアエレメントで実行されるトランザクション制御方法であって,前記セキュアエレメントが,先行書込み方式のトランザクション制御の開始指示を受けると,データ格納領域とは別に不揮発性ストレージに設けた先行書き込み領域に,書き込みデータを書き込む先行書込み処理を実行する手順と,前記セキュアエレメントが,先行書込み方式のトランザクション制御の終了指示を受けると,前記先行書き込み領域に書き込まれた書き込みデータごとに書き込みデータの書き込み先ページを確認し,書き込み先ページが同一の書き込みデータを一括して同一の書き込み先ページに書き込むページ更新処理を実行する手順を含むことを特徴とする。 Furthermore, a fifth invention is a transaction control method executed by a secure element having a non-volatile storage capable of writing data in units of pages, wherein the secure element issues an instruction to start write-ahead transaction control. Upon reception, a procedure for executing a write-in-advance process of writing write data in a write-in-advance area provided in a non-volatile storage separate from the data storage area; , confirming the write destination page of the write data for each write data written in the preceding write area, and executing the page update process of collectively writing the write data having the same write destination page to the same write destination page; characterized by comprising
更に,第6発明は,第5発明に記載したトランザクション制御方法において,前記セキュアエレメントは,前記ページ更新処理において,書き込み先ページと書き込み先アドレスが同じ書き込みデータが前記先行書き込み領域に複数存在する場合,最後に前記先行書き込み領域に書き込んだ書き込みデータを前記ページ更新処理に用いることを特徴とする。 Furthermore, a sixth invention is the transaction control method according to the fifth invention, wherein in the page update process, if a plurality of write data having the same write destination page and write destination address exist in the preceding write area , the last write data written in the preceding write area is used for the page update process.
更に,第7発明は,第5発明または第6発明に記載したトランザクション制御方法において,前記セキュアエレメントは,前記ページ更新処理において,書き込み先ページに書き込んだ書き込みデータを前記先行書き込み領域から削除し,電源が投入された直後の前記先行書き込み領域に書き込みデータが存在する場合,前記先行書き込み領域に存在する書き込みデータを用いて前記ページ更新処理を実行することを特徴とする。 Further, according to a seventh invention, in the transaction control method according to the fifth invention or the sixth invention, the secure element deletes the write data written to the write destination page from the pre-write area in the page update process, When write data exists in the preceding write area immediately after the power is turned on, the page updating process is performed using the write data existing in the preceding writing area.
先行書き込み方式のトランザクション制御にセキュアエレメントを対応させることで,サイズが小さく書き換え頻度の高い複数のデータが一つのページに存在する場合であっても,サイズが小さく書き換え頻度の高い複数のデータを一括してページに書き込めるので,ページへの書き込み回数を減らすことができる。また,先行書込み領域に書き込んだ書き込みデータは,セキュアエレメントの電源が落ちても消えないため,データの一貫性を保障できる。 By making the secure element compatible with write-ahead transaction control, even if multiple pieces of small-sized, frequently-written data exist on a single page, multiple pieces of small-sized, frequently-written data can be batched together. Since the page can be written to as much as possible, the number of writes to the page can be reduced. In addition, since the write data written in the pre-write area does not disappear even if the power supply of the secure element is turned off, the consistency of the data can be guaranteed.
ここから,本発明に係る実施形態について記載する。本実施形態は,本発明の理解を容易にするためのものであり,本発明は,本実施形態に限定されるものではない。また,特に断りのない限り,図面は,本発明の理解を容易にするために描かれた模式的な図である。 Embodiments according to the present invention will now be described. This embodiment is intended to facilitate understanding of the present invention, and the present invention is not limited to this embodiment. In addition, unless otherwise specified, the drawings are schematic diagrams drawn to facilitate understanding of the present invention.
図1は,セキュアエレメント1を搭載したデバイス2の一例を説明する図である。図1では,セキュアエレメント1を搭載したデバイス2を,ISO7816に準拠した接触通信により外部端末と通信する接触型ICカードとして図示している。
FIG. 1 is a diagram illustrating an example of a
図1において,デバイス2はクレジットカードの形状にしているが,セキュアエレメント1を搭載したデバイス2の形状は,クレジットカードの形状に限定されない。セキュアエレメント1を搭載したデバイス2は,スマートフォンなどに装着するSIM(Subscriber Identity Module)でもよく,または,スマートフォンなどの基板に実装するeSIM(embedded Subscriber Identity Module)でもよい。
In FIG. 1, the
図1で図示したデバイス2において,セキュアエレメント1は外部端子の裏側に樹脂モールドされている。セキュアエレメント1は,外部端子20を介して図外の外部装置(例えば,リーダライタ)と接触通信する。なお,セキュアエレメント1が対応する通信方式は,ISO7816に準拠した接触通信に限定されない。セキュアエレメント1が対応する通信方式は,ISO14443に準拠した非接触通信でもよく,コンピュータ内部で用いられる通信方式(例えば,SPI,Serial Peripheral Interface)でもよい。
In the
図2は,セキュアエレメント1のハードウェアを説明する図である。本実施形態に係るセキュアエレメント1は,回路として,接触通信インタフェース101,CPU100(Central Processing Unit),RAM102(Random Access Memory),ROM103(Read Only Memory),不揮発性ストレージ104,コプロセッサ105(Coprocessor),乱数生成器106(RNG: Random Number Generator)および,電力供給回路107を備えている。当然のことながら,セキュアエレメント1に集積する回路は,これらの回路に限定されない。
FIG. 2 is a diagram explaining the hardware of the
本実施形態において,セキュアエレメント1のCPU100は,メモリに格納されたプログラムコードを解釈して,所定の処理を実行する回路である。電力供給回路107は,デバイス2の表面にある外部端子20(VCC端子)と接続し,外部端末から供給された電力を他の回路(例えば,CPU100)に供給する回路である。接触通信インタフェース101は,デバイス2の表面にある外部端子20(I/O端子)と接続し,外部端末と接触通信を行う回路である。コプロセッサ105は,暗号鍵を用いた暗号演算を高速に処理できるように構成された回路である。乱数生成器106は,乱数を生成する回路である。
In this embodiment, the
RAM102,ROM103および不揮発性ストレージ104は,セキュアエレメント1が備えるメモリになる。RAM102は,電気的な書き換え可能な揮発性メモリである。ROM103は,電気的に書き換えできない読取り専用の不揮発性メモリである。不揮発性ストレージ104は,電気的に書き換え可能な不揮発性メモリで構成されるストレージである。例えば,不揮発性ストレージ104は,EEPROM(登録商標)やフラッシュメモリ(登録商標)などにより構成される。
The
図3は,データ書き込みに係るセキュアエレメント1の構成を説明する図である。セキュアエレメント1が備える不揮発性ストレージ104は,データ書き込みに係るハードウェア層になる。セキュアエレメント1に実装されたオペレーティングシステム10(以下,「OS10」と記す。OSは,Operating Systemの略)は,データ書き込みに係るオペレーティングシステム層になる。不揮発性ストレージ104にデータを書き込む処理を実行するアプリケーション12は,データの書き込みに係るアプリケーション層になる。
FIG. 3 is a diagram for explaining the configuration of the
アプリケーション12は,不揮発性ストレージ104にデータを書き込む処理を必要とする複数のコマンドに対応する。このコマンドには,書き込み系コマンドのみならず認証系コマンドなども含まれる。認証系コマンドでは,認証の中断または失敗した回数をカウントするリトライカウンタ104dが少なくとも必要となる。リトライカウンタ104dは不揮発性ストレージ104に格納されるデータになり,認証系コマンドに係る処理において,リトライカウンタ104dの書き換えが行われる。
セキュアエレメント1に実装されたOS10は,不揮発性ストレージ104にデータを書き込む際,データの一貫性に係る処理を実行するトランザクション制御手段11を有する。本実施形態に係るトランザクション制御手段11は,書き込みデータの書き込み先の内容をバックアップするバックアップ方式のトランザクション制御に対応する。更に,本実施形態に係るトランザクション制御手段11は,バックアップ方式のトランザクション制御に加え,書き込みデータを本来の書き込み先に書き込む前に他の領域に書き込んでおき,トランザクション制御の終了が指示されると,他の領域に書き込んだ書き込みデータを本来の書き込み先に書き込む先行書き込み方式のトランザクション制御に対応する。
The
図3で図示したごとく,セキュアエレメント1が備える不揮発性ストレージ104は,セキュアエレメント1に実装されたOS10により,ページと呼ばれる単位に分割されて管理され,本実施形態に係る不揮発性ストレージ104は,ページの単位でデータの書き込みが可能になっている。それぞれのページにはページ番号が付与され,ページ番号によりページは識別される。容量が比較的小さい不揮発性ストレージ104の場合,ページのサイズは数十バイト程度であるが,容量が比較的大きい不揮発性ストレージ104の場合,ページのサイズは,128バイト,256バイトまたは512バイトなどになる。
As illustrated in FIG. 3, the
セキュアエレメント1が備える不揮発性ストレージ104は,データ格納領域104a,バックアップ領域104bおよび先行書き込み領域104cを含んでいる。
The
データ格納領域104aに割り当てられたページには,OS10が使用するプログラムコードとデータと,アプリケーション12が使用するプログラムコードおよびデータが格納される。図3において,データ格納領域104aに割り当てられたページの一つで,ページ番号が「a」のページには,認証系コマンドに係るコマンド処理で用いるデータであるリトライカウンタ104dと,認証系コマンドに係るコマンド処理で用いるデータとなるパスワード用カウンタ104eが格納されている。なお,パスワード用カウンタ104eとは,ワンタイムパスワードの生成に用いるカウンタである。
Program codes and data used by the
本実施形態に係るセキュアエレメント1において,バックアップ領域104bおよび先行書き込み領域104cは,データの一貫性に係る処理を実行するトランザクション制御手段11が少なくとも利用する領域になる。トランザクション制御手段11がバックアップ方式で使用する領域になるバックアップ領域104bには,書き込みデータを書き込む書き込み先のページである書き込み先ページの内容がバックアップされる。また,トランザクション制御手段11が先行書き込み方式で使用する領域になる先行書き込み領域104cには,書き込み先ページに書き込む書き込みデータとこれの管理情報が書き込まれる。
In the
図3では,データ格納領域104aには含まれないページ番号が「b」のページがバックアップ領域104bに割り当てられている。また,データ格納領域104aには含まれないページ番号が「c」のページが先行書き込み領域104cに割り当てられている。先行書き込み領域104cに割り当てるページ数は1ページでなくともよい。複数のページを先行書き込み領域104cに割り当て,先行書き込み領域104cとして使用するページをローテート(循環)させることで,不揮発性メモリの耐久性の劣化を防止できる。なお,バックアップ領域104bについても同じである。
In FIG. 3, a page with a page number of "b" that is not included in the
これまで説明した通り,トランザクション制御手段11は,バックアップ方式のトランザクション制御と先行書き込み方式のトランザクション制御の2つの方式に対応するが,バックアップ方式のトランザクション制御は以前より用いられている方式であるため,ここでは,先行書き込み方式のトランザクション制御についてのみ詳細に説明する。 As explained above, the transaction control means 11 supports two types of transaction control: the backup type transaction control and the pre-write type transaction control. Only the write-ahead transaction control will be described in detail here.
バックアップ方式のトランザクション制御について説明する。トランザクション制御手段11は,バックアップ方式のトランザクション制御において,書き込みデータを書き込み先ページに書き込む前に,不揮発性ストレージ104に設けられたバックアップ領域104bに書き込み先ページの内容を複製しておき,電源が投入された後に,トランザクション制御の終了指示を受けていないと判定すると,バックアップ領域104bの内容を複製元になったページに反映させる処理を実行する。
The transaction control of the backup method is explained. In the transaction control of the backup method, the transaction control means 11 duplicates the contents of the write destination page in the
図4は,先行書き込み方式のトランザクション制御方法に係る処理を説明する図である。先行書き込み方式のトランザクション制御方法に係る処理は,トランザクション制御手段11が実行する処理で,この処理は,以下の手順で実行される。 FIG. 4 is a diagram for explaining processing related to a write-preceding transaction control method. Processing related to the write-in-precedence transaction control method is processing executed by the transaction control means 11, and this processing is executed in the following procedure.
アプリケーション12は,不揮発性ストレージ104にデータを書き込む一連の処理を開始する際,トランザクション制御の方式を含むトランザクション制御の開始指示をOS10に与える(手順S1)。本実施形態に係るトランザクション制御手段11は,バックアップ方式のトランザクション制御と先行書込み方式のトランザクション制御の2方式に対応しているが,ここでは,アプリケーション12が指定するトランザクション制御の方式を先行書込み方式として説明する。先行書込み方式のトランザクション制御の対象になるデータは,サイズが小さく,かつ,書き換え頻度の高いデータになる。
When the
次に,アプリケーション12は,不揮発性ストレージ104に書き込む書き込みデータとこれの書き込み先を含むデータ書き込み指示をOS10に与える(手順S2)。なお,書き込みデータの書き込み先は,書き込みデータを書き込むページである書き込み先ページとこの書き込み先ページにおけるアドレスである書き込み先アドレスで構成される。
Next, the
トランザクション制御手段11は,先行書込み方式のトランザクション制御の開始が指示された後に,データ書き込み指示をアプリケーション12から受けると,アプリケーション12から指定された書込みデータを不揮発性ストレージ104のデータ格納領域104aに書き込まずに,不揮発性ストレージ104に設けられた先行書き込み領域104cに書き込みデータを書き込む先行書込み処理を実行する(手順S3)。
When the transaction control means 11 receives a data write instruction from the
トランザクション制御手段11は,先行書込み方式のトランザクション制御の開始が指示された後,データ書き込み指示をアプリケーション12から受けるごとに手順S3を繰り返し実行する。よって,先行書き込み領域104cに書き込まれる書き込みデータは一つに限定されない。また,先行書き込み領域104cに書き込む書き込みデータには,書き込みデータの書き込み先(書き込みページと書き込みアドレス)と書き込みデータのデータ長などを含む管理情報が付加される。
The transaction control means 11 repeats the procedure S3 every time it receives a data write instruction from the
アプリケーション12は,不揮発性ストレージ104にデータを書き込む一連の処理が終了すると,トランザクション制御の終了指示をOS10に与える(手順S4)。トランザクション制御手段11は,トランザクション制御の終了がアプリケーション12から指示されると,先行書き込み領域104cに書き込まれた書き込みデータごとに,書き込みデータの書き込み先ページを確認し,書き込み先ページが同一の書き込みデータを一括してこの書き込み先ページに書き込むページ更新処理を実行する(手順S5)。
When the series of processes for writing data to the
ページ更新処理において,書き込みデータを書き込む書き込み先ページは,先行書き込み領域104cに存在する書き込みデータの管理情報から判定できる。書き込み先ページが同一の書き込みデータを一括してこの書き込み先ページに書き込むことで,ページの書き換え回数を減らすことができる。また,ページ更新処理において,書き込み先が同じ書き込みデータが先行書き込み領域104cに複数存在する場合,最後に先行書き込み領域104cに書き込んだ書き込みデータをページ更新処理に用いることが,ページの書き換え回数を減らす観点からして好適である。
In the page update process, the write destination page to which the write data is written can be determined from the write data management information existing in the
次に,トランザクション制御手段11は,書き込み先ページに書き込んだ書き込みデータを先行書き込み領域104cから削除して(手順S6),図4の手順は終了する。
Next, the transaction control means 11 deletes the write data written to the write destination page from the preceding
先行書き込み領域104cは不揮発性ストレージ104に設けられる領域になる。このため,先行書き込み領域104cに存在する書き込みデータを消去するまで,セキュアエレメント1に電源断が発生しても,先行書き込み領域104cに書き込んだ書き込みデータは消えない。このことを利用して,セキュアエレメント1に電源断が発生した場合,不揮発性ストレージ104のデータ格納領域104aにおける状態をセキュアエレメント1に電源断が発生した直前の状態にすることができる。
The
図5は,リセット後におけるトランザクション制御手段11の動作を説明する図である。セキュアエレメント1がリセットされると,トランザクション制御手段11は,先行書き込み領域104cに書き込みデータが存在するか否かを判定する(手順S10)。先行書き込み領域104cに書き込みデータが存在しない場合,図5の手順は終了する。先行書き込み領域104cに書き込みデータが存在する場合,トランザクション制御手段11は,先行書き込み領域104cに存在する書き込みデータを用いてページ更新処理を実行した後(手順S11),トランザクション制御手段11が,先行書き込み領域104cに存在する書き込みデータを削除して(手順S12)を実行して,図5の手順は終了する。
FIG. 5 is a diagram for explaining the operation of the transaction control means 11 after reset. When the
先行書き込み方式のトランザクション制御についてより詳細に説明する。図6は,先行書き込み方式のトランザクション制御を説明する補足図である。なお,この説明では,書き込みデータをリトライカウンタ104dの値とパスワード用カウンタ104eの値とし,これらのデータはいずれも先行書込み対象のデータである。
The write-ahead transaction control will be described in more detail. FIG. 6 is a supplementary diagram for explaining transaction control of the pre-write method. In this description, the write data are the value of the retry
不揮発性ストレージ104のデータ格納領域104aに格納されたリトライカウンタ104dは,認証系コマンドが実行されると,一つ減算した値に書き換えられ,認証に係る処理に成功すると,リトライ回数の最大値に書き換えられる。また,不揮発性ストレージ104のデータ格納領域104aに格納されたパスワード用カウンタ104eは,認証系コマンドが実行されるごとに,一つ加算した値に書き換えられる。図6の1行目で図示したように,認証系コマンドが実行されるときのリトライカウンタ104dの値を「C0」とする。また,認証系コマンドが実行されるときのパスワード用カウンタ104eの値を「TC0」とする。また,この時点において,先行書き込み領域104cの内容は空である。
The retry
先行書込み方式のトランザクション制御の開始が指示された後,「C0」を一つ減算した値である「C1」をリトライカウンタ104dに書き込む指示をアプリケーション12から受けると,図6の2行目で図示したように,トランザクション制御手段11は,リトライカウンタ104dの管理情報とリトライカウンタ104dの値である「C1」を先行書き込み領域104cに書き込む。更に,トランザクション制御手段11は,「TC0」を一つ加算した値である「TC1」をパスワード用カウンタ104eに書き込む指示をアプリケーション12から受けると,図6の3行目で図示したように,トランザクション制御手段11は,パスワード用カウンタ104eの管理情報とこれの値である「TC1」を先行書き込み領域104cに書き込む。なお,トランザクション制御手段11が先行書込み領域にデータを書き込んでも,「C1」などの書き込み先ページ(ここでは,ページ番号が「a」のページ)は更新されない。
After receiving an instruction from the
認証に係る照合処理に成功し,リトライカウンタ104dにリトライ回数の最大値である「Cmax」をリトライカウンタ104dに書き込む書き込み指示をアプリケーション12から受けると,図6の4行目で図示したように,トランザクション制御手段11は,リトライカウンタ104dの管理情報とこれの値である「Cmax」を先行書き込み領域104cに書き込む。なお,リトライカウンタ104dの書き込みデータとなる「Cmax」を先行書き込み領域104cに書き込んでも,「Cmax」などの書き込み先ページ(ここでは,ページ番号が「a」のページ)は更新されない。
When the
アプリケーション12からトランザクション制御の終了が指示されると,トランザクション制御手段11は,先行書き込み領域104cに書き込まれていた書き込みデータを書き込み先に書き込むページ更新処理を実行する。先行書き込み領域104cに書き込まれていた書き込みデータとなるリトライカウンタ104dの値とパスワード用カウンタ104eの値それぞれの書き込み先ページは同じになるため,トランザクション制御手段11は,リトライカウンタ104dの値とパスワード用カウンタ104eの値を一括して同一の書き込み先ページ(ページ番号が「a」のページ)に書き込む。
When the
先行書き込み領域104cには,リトライカウンタ104dの値として,「C1」と「Cmax」の2つが書き込まれている。これらのうち先行書き込み領域104cに最後に書き込まれた値は「Cmax」になる。このため,トランザクション制御手段11は,書き込み先ページに書き込むリトライカウンタ104dの値として「Cmax」を書き込むことになる。すなわち,図6の5行目で図示したように,トランザクション制御手段11は,リトライカウンタ104dに「Cmax」を書き込み,パスワード用カウンタ104eに「TC1」を書き込んだ内容に書き込み先ページ(ページ番号が「a」のページ)を更新する。なお,書き込み先ページを更新すると,トランザクション制御手段11は,先行書き込み領域104cに格納されていた書き込みデータすべてを削除し,先行書き込み領域104cは空の状態になる。
Two values of "C1" and "Cmax" are written in the
この例では,リトライカウンタ104dの値とパスワード用カウンタ104eの値それぞれを不揮発性ストレージ104に設けられたデータ格納領域104aのページに書き込まなければならないが,先行書込み方式のトランザクション制御を行うことで,リトライカウンタ104dの値とパスワード用カウンタ104eの値それぞれを一度に書き込むことができる。また,リトライカウンタ104dに関しては,本来なら2回の書き込みが行われるリトライカウンタ104dの書き込み回数を1回に減らせる。すなわち,このケースでは,3回の書き込みが必要なところを1回に減らすことができる。
In this example, the value of the retry
なお,「C0」を一つ減算した値である「C1」とリトライカウンタ104dの管理情報を先行書き込み領域104cに書き込んだ後に,セキュアエレメント1に電源断が発生すると,その後にリセットされた際,トランザクション制御手段11は,先行書き込み領域104cに書き込まれていた「C1」を書き込み先ページにあるリトライカウンタ104dに反映させる。このため,リセットカウンタの値を,セキュアエレメント1に電源断が発生する直前の値できる。
After writing "C1", which is a value obtained by subtracting one from "C0", and the management information of the retry
これまで説明したように,先行書き込み方式のトランザクション制御にセキュアエレメント1を対応させることで,サイズが小さく書き換え頻度の高い複数のデータが一つのページに存在する場合であっても,サイズが小さく書き換え頻度の高い複数のデータを一括してページに書き込めるので,ページへの書き込み回数を減らすことができる。また,先行書込み領域に書き込んだ書き込みデータは,セキュアエレメント1の電源が落ちても消えないため,データの一貫性を保障できる。
As explained above, by making the
1 セキュアエレメント
10 オペレーティングシステム
11 トランザクション制御手段
12 アプリケーション
104 不揮発性ストレージ
104a データ格納領域
104b バックアップ領域
104c 先行書き込み領域
2 デバイス
1 Secure
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021085894A JP7322923B2 (en) | 2021-05-21 | 2021-05-21 | Secure element, transaction control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021085894A JP7322923B2 (en) | 2021-05-21 | 2021-05-21 | Secure element, transaction control method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2022178821A JP2022178821A (en) | 2022-12-02 |
JP7322923B2 true JP7322923B2 (en) | 2023-08-08 |
Family
ID=84238669
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021085894A Active JP7322923B2 (en) | 2021-05-21 | 2021-05-21 | Secure element, transaction control method and device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7322923B2 (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4768237B2 (en) * | 2004-06-25 | 2011-09-07 | 株式会社東芝 | Portable electronic device and method for controlling portable electronic device |
JP2007034434A (en) * | 2005-07-22 | 2007-02-08 | Dainippon Printing Co Ltd | Ic card, method for writing data to ic card, and ic card program |
-
2021
- 2021-05-21 JP JP2021085894A patent/JP7322923B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2022178821A (en) | 2022-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4806639B2 (en) | Secure device and IC card issuing system | |
KR101783526B1 (en) | Ic card, electronic device and portable electronic device | |
JP4896842B2 (en) | Portable electronic device | |
JP7322923B2 (en) | Secure element, transaction control method and device | |
JP6233134B2 (en) | Electronic information storage medium, information processing method, and information processing program | |
JP2007087120A (en) | Ic card mounted with multiple os (operating system) and issue consignment method | |
JP2019049876A (en) | Electronic information storage medium, ic card, table management method with electronic information storage medium, and table management program | |
JP2006293706A (en) | Multi-application ic card with application updating function | |
US7346730B2 (en) | Mobile electronic device | |
JP4784138B2 (en) | IC card and IC card program | |
JP5050508B2 (en) | Storage device, storage device program, and storage processing method | |
JP7468757B1 (en) | ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RESPONSE TRANSMISSION METHOD, AND PROGRAM | |
JP2022184327A (en) | Secure element, device and nonvolatile memory managing method | |
JP2008305263A (en) | Nonvolatile semiconductor storage device and memory management method | |
JP2007034434A (en) | Ic card, method for writing data to ic card, and ic card program | |
JP7040053B2 (en) | Information processing method and OS using electronic information storage medium, IC card, electronic information storage medium | |
JP2022187935A (en) | Secure element, electronic information storage medium, and method for updating data | |
EP1301929B1 (en) | Secure writing of data | |
JP6984328B2 (en) | Electronic information storage medium, IC card, external device, data writing method and data writing program | |
JP2007206765A (en) | Method of issuing ic card, ic card issuing system, and ic card | |
JP6758910B2 (en) | IC card | |
JP2016153945A (en) | Electronic information storage medium, counter rewriting method and counter rewriting program | |
JP6252341B2 (en) | Electronic information storage medium, information processing method, and information processing program | |
KR101149539B1 (en) | Smart card and method for processing transaction of smart card | |
JP5853559B2 (en) | IC chip, processing method in IC chip, IC chip processing program, and IC card |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230530 |
|
A871 | Explanation of circumstances concerning accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A871 Effective date: 20230530 |
|
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: 20230627 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230710 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7322923 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |