JP7307400B2 - Electronic information storage medium, counter update method and counter update program - Google Patents

Electronic information storage medium, counter update method and counter update program Download PDF

Info

Publication number
JP7307400B2
JP7307400B2 JP2019131049A JP2019131049A JP7307400B2 JP 7307400 B2 JP7307400 B2 JP 7307400B2 JP 2019131049 A JP2019131049 A JP 2019131049A JP 2019131049 A JP2019131049 A JP 2019131049A JP 7307400 B2 JP7307400 B2 JP 7307400B2
Authority
JP
Japan
Prior art keywords
counter
value
predetermined
addition
predetermined value
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
Application number
JP2019131049A
Other languages
Japanese (ja)
Other versions
JP2021015543A (en
Inventor
遼 若宮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2019131049A priority Critical patent/JP7307400B2/en
Publication of JP2021015543A publication Critical patent/JP2021015543A/en
Application granted granted Critical
Publication of JP7307400B2 publication Critical patent/JP7307400B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System (AREA)

Description

不揮発性メモリを備えるICチップ等の電子情報記憶媒体等の技術分野に関する。 The present invention relates to the technical field of electronic information storage media such as IC chips with nonvolatile memory.

従来、不揮発性メモリを備えるICチップは、暗号処理等の実行に伴い、不揮発性メモリに記憶されるカウンタのカウントアップを行うことがある。 2. Description of the Related Art Conventionally, an IC chip having a non-volatile memory sometimes counts up a counter stored in the non-volatile memory along with the execution of cryptographic processing or the like.

不揮発性メモリは、その構造上、書き換え回数の上限が数万~数十万程度となっており、その上限を超えた書き換えが行われた記憶素子については正常にデータの記録が行えなくなる。その上限による影響を受け難いようにするために、一般に不揮発性メモリについてウェアレベリング処理が行われている。それでも、カウンタのように頻繁に書き換えが行われるデータが特定の記憶素子に記憶されている場合には、すぐに書き換え上限に達してしまうおそれがある。 Due to its structure, the nonvolatile memory has an upper limit of several tens of thousands to several hundreds of thousands of times of rewriting, and data cannot be recorded normally in a storage element that has been rewritten beyond the upper limit. In order to make it less susceptible to the upper limit, wear leveling processing is generally performed on non-volatile memory. Even so, if data that is frequently rewritten, such as a counter, is stored in a specific storage element, there is a risk that the rewrite upper limit will be reached soon.

特許文献1には、不揮発性メモリにカウンタを記憶するICチップであって、不揮発性メモリの書き換え耐久性への影響を軽減することができるICチップが開示されている。 Patent Literature 1 discloses an IC chip that stores a counter in a nonvolatile memory and that can reduce the influence on the rewriting durability of the nonvolatile memory.

特開2016-153945号公報JP 2016-153945 A

特許文献1に記載の技術によっても不揮発性メモリの書き換え耐久性への影響を軽減することができるが、本発明は、カウンタを記憶する不揮発性メモリの書き換え回数を削減する新たな手法を採用することにより不揮発性メモリの寿命を長くすることができる電子情報記憶媒体等を提供することを目的とする。 Although the technique described in Patent Document 1 can also reduce the impact on the rewrite durability of the nonvolatile memory, the present invention adopts a new technique for reducing the number of rewrites of the nonvolatile memory that stores the counter. It is an object of the present invention to provide an electronic information storage medium or the like that can extend the life of a nonvolatile memory.

上記課題を解決するために、請求項1に記載の発明は、第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体であって、所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段と、次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段と、を備え、前記第2の所定値は、前記第1の所定値を整数倍した値であり、前記第2加算手段は、前記第1カウンタの値が前記第2カウンタの値と等しい場合に、前記第2加算処理を実行することを特徴とする。 In order to solve the above problems, the invention according to claim 1 is an electronic information storage medium comprising a volatile memory that stores a first counter and a nonvolatile memory that stores a second counter, wherein is executed, the value of the first counter is changed to the second a second addition means for executing a second addition process of adding a second predetermined value, which is two times or more the first predetermined value, to the second counter when the counter value is larger than the value of the counter; The second predetermined value is a value obtained by multiplying the first predetermined value by an integer, and the second adding means, when the value of the first counter is equal to the value of the second counter, adds the It is characterized by executing a second addition process .

請求項2に記載の発明は、請求項1に記載の電子情報記憶媒体であって、前記揮発性メモリへの電源供給が断たれ、電源供給が再開した場合に、前記第1カウンタに前記第2カウンタの値を書き込む書込手段を更に備えることを特徴とする。 The invention according to claim 2 is the electronic information storage medium according to claim 1, wherein when the power supply to the volatile memory is interrupted and the power supply is restarted, the first counter stores the It is characterized by further comprising writing means for writing the value of the second counter.

請求項に記載の発明は、請求項1又は2に記載の電子情報記憶媒体であって、前記第1の所定値は「1」であることを特徴とする。 The invention according to claim 3 is the electronic information storage medium according to claim 1 or 2 , wherein the first predetermined value is "1".

請求項に記載の発明は、第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体であって、所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段と、次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段と、を備え、前記所定の処理は暗号鍵を使用する暗号処理であり、前記第1カウンタの値が所定の上限値以上になった場合に、前記暗号鍵を更新する更新手段、を更に備えることを特徴とする。 According to a fourth aspect of the present invention, there is provided an electronic information storage medium comprising a volatile memory that stores a first counter and a nonvolatile memory that stores a second counter. a first addition means for executing a first addition process for adding a first predetermined value to a counter; and second addition means for executing a second addition process of adding a second predetermined value that is two times or more of the first predetermined value to the second counter, wherein the predetermined process is encrypted. The cryptographic process uses a key, and further comprises updating means for updating the cryptographic key when the value of the first counter becomes equal to or greater than a predetermined upper limit value.

請求項に記載の発明は、第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体によるカウンタ更新方法であって、所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算工程と、次の前記第1加算工程により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算工程と、を含み、前記第2の所定値は、前記第1の所定値を整数倍した値であり、前記第2加算工程は、前記第1カウンタの値が前記第2カウンタの値と等しい場合に、実行することを特徴とする。
請求項6に記載の発明は、第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体によるカウンタ更新方法であって、所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算工程と、次の前記第1加算工程により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算工程と、を含み、前記所定の処理は暗号鍵を使用する暗号処理であり、前記第1カウンタの値が所定の上限値以上になった場合に、前記暗号鍵を更新する更新工程、を更に含むことを特徴とする。
According to a fifth aspect of the present invention, there is provided a counter update method using an electronic information storage medium having a volatile memory that stores a first counter and a nonvolatile memory that stores a second counter. , the first adding step of adding a first predetermined value to the first counter, and the subsequent first adding step, when the value of the first counter becomes larger than the value of the second counter, the and a second addition step of adding a second predetermined value that is two times or more the first predetermined value to the 2 counter , wherein the second predetermined value is an integer equal to the first predetermined value. and the second adding step is performed when the value of the first counter is equal to the value of the second counter.
According to a sixth aspect of the present invention, there is provided a counter update method using an electronic information storage medium having a volatile memory that stores a first counter and a nonvolatile memory that stores a second counter, wherein , the first adding step of adding a first predetermined value to the first counter, and the subsequent first adding step, when the value of the first counter becomes larger than the value of the second counter, the a second adding step of adding a second predetermined value that is two times or more the first predetermined value to the 2 counter, wherein the predetermined processing is cryptographic processing using a cryptographic key; The method further includes an updating step of updating the encryption key when the value of the first counter reaches or exceeds a predetermined upper limit.

請求項7に記載の発明は、第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体に含まれるコンピュータを、所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段、次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段、として機能させ、前記第2の所定値は、前記第1の所定値を整数倍した値であり、前記第2加算手段は、前記第1カウンタの値が前記第2カウンタの値と等しい場合に、前記第2加算処理を実行することを特徴とする。
請求項8に記載の発明は、第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体に含まれるコンピュータを、所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段、次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段、として機能させ、前記所定の処理は暗号鍵を使用する暗号処理であり、前記第1カウンタの値が所定の上限値以上になった場合に、前記暗号鍵を更新する更新手段として更に機能させることを特徴とする。
According to a seventh aspect of the present invention, a computer included in an electronic information storage medium having a volatile memory that stores a first counter and a non-volatile memory that stores a second counter is operated by executing a predetermined process. first addition means for executing a first addition process for adding a first predetermined value to a first counter, when the value of the first counter becomes larger than the value of the second counter by the next first addition process; second addition means for executing a second addition process of adding a second predetermined value that is two times or more the first predetermined value to the second counter; The value is a value obtained by multiplying the first predetermined value by an integer, and the second addition means executes the second addition process when the value of the first counter is equal to the value of the second counter. It is characterized by
According to an eighth aspect of the present invention, a computer included in an electronic information storage medium having a volatile memory that stores a first counter and a nonvolatile memory that stores a second counter is operated by executing a predetermined process. first addition means for executing a first addition process for adding a first predetermined value to a first counter, when the value of the first counter becomes larger than the value of the second counter by the next first addition process; and second addition means for executing a second addition process of adding a second predetermined value that is two times or more the first predetermined value to the second counter, wherein the predetermined process is The cryptographic processing uses a cryptographic key, and further functions as update means for updating the cryptographic key when the value of the first counter becomes equal to or greater than a predetermined upper limit value.

本発明によれば、揮発性メモリに第1カウンタを、不揮発性メモリに第2カウンタをそれぞれ記憶させ、所定の処理の実行に伴い第1カウンタに第1の所定値を加算し、第1カウンタの値が第2カウンタの値を超えない期間は第2のカウンタを書き換えず、次の第1の所定値の加算により第1カウンタの値が第2カウンタの値を超える場合、その前に第2のカウンタに第1の所定値の2倍以上の値であるより第2の所定値を加算する。これにより、第1カウンタの値が第2カウンタの値を超えない期間では第1カウンタのみを書き換え、第1カウンタの値が第2カウンタの値を超える場合にのみ第2カウンタを書き換えるため、第2カウンタの書き換え回数を抑制し、不揮発性メモリの寿命を長くすることができる。 According to the present invention, the first counter is stored in the volatile memory, and the second counter is stored in the nonvolatile memory. does not exceed the value of the second counter, the second counter is not rewritten. 2, a second predetermined value that is more than twice the first predetermined value is added. As a result, only the first counter is rewritten while the value of the first counter does not exceed the value of the second counter, and the second counter is rewritten only when the value of the first counter exceeds the value of the second counter. 2 counter can be rewritten, and the life of the nonvolatile memory can be lengthened.

本実施形態に係る暗号システムSを構成する通信機器1及びセキュアエレメント(SE:Secure Element)2の概要構成例を示すブロック図である。1 is a block diagram showing a schematic configuration example of a communication device 1 and a secure element (SE) 2 that constitute a cryptographic system S according to this embodiment; FIG. 本実施形態に係る暗号システムSによる暗号処理の一例を示すシーケンス図である。It is a sequence diagram showing an example of cryptographic processing by the cryptographic system S according to the present embodiment. 本実施形態に係るSE2によるカウントアップ処理の一例を示すフローチャートである。9 is a flowchart showing an example of count-up processing by SE2 according to the present embodiment; 本実施形態に係るSE2による電源断復帰処理の一例を示すフローチャートである。7 is a flow chart showing an example of power-off recovery processing by SE2 according to the present embodiment.

以下、図面を参照して本発明の実施形態について詳細に説明する。以下に説明する実施形態は、暗号システムSに対して本発明を適用した場合の実施の形態である。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiments described below are embodiments in which the present invention is applied to a cryptographic system S. FIG.

まず、図1等を参照して、本実施形態に係る暗号システムSの構成及び機能概要を説明する。 First, with reference to FIG. 1 and the like, the configuration and functional overview of the encryption system S according to the present embodiment will be described.

[1.暗号システムSの構成]
図1は、本実施形態に係る暗号システムSの概要構成例を示すブロック図である。図1に示すように、暗号システムSは、通信機器1及びSE2を含んで構成される。通信機器1は、通信ネットワークを介して図示しないサーバ装置と接続されており、サーバ装置との通信データをSE2に暗号・復号処理してもらい通信を行う。
[1. Configuration of cryptographic system S]
FIG. 1 is a block diagram showing a schematic configuration example of a cryptographic system S according to this embodiment. As shown in FIG. 1, the cryptographic system S includes communication equipment 1 and SE2. The communication device 1 is connected to a server device (not shown) via a communication network, and communicates with the server device by having the SE 2 perform encryption/decryption processing on the communication data.

[2.通信機器1の構成]
図1に示すように、通信機器1と、通信機器1と通信可能なSE2の構成について説明する。SE2は通信機器1から電源供給を受けて動作する。
[2. Configuration of communication device 1]
As shown in FIG. 1, the configuration of a communication device 1 and an SE 2 capable of communicating with the communication device 1 will be described. The SE 2 operates by receiving power supply from the communication device 1 .

通信機器1は、制御部11、通信部12、入力部13及び出力部14を有する。 The communication device 1 has a control section 11 , a communication section 12 , an input section 13 and an output section 14 .

制御部11は、CPU(Central Processing Unit)111、RAM(Random Access Memory)112、ROM(Read Only Memory)113、I/O回路114及び不揮発性メモリ115を含んで構成され、通信機器1全体を制御する。例えば、制御部11は、入力部13に入力された入力データや入力情報に基づいて処理を行い、出力部14に出力データや出力情報を出力する。通信部12は、図示しないサーバ等の外部装置と通信を行うための処理を行う。入力部13は、制御部11に入力データや入力情報を入力する。出力部14は、制御部11から出力された出力データや出力情報に基づいて出力を行う。 The control unit 11 includes a CPU (Central Processing Unit) 111, a RAM (Random Access Memory) 112, a ROM (Read Only Memory) 113, an I/O circuit 114 and a non-volatile memory 115, and controls the communication device 1 as a whole. Control. For example, the control unit 11 performs processing based on input data and input information input to the input unit 13 and outputs output data and output information to the output unit 14 . The communication unit 12 performs processing for communicating with an external device such as a server (not shown). The input unit 13 inputs input data and input information to the control unit 11 . The output unit 14 performs output based on output data and output information output from the control unit 11 .

RAM112には、例えばOS(Operating System)や各種アプリケーションが機能する上で一時的に必要となるデータが記憶される。ROM113には、OS、各種アプリケーション等が記憶される。I/O回路114は、SE2との通信インターフェイスを担う。不揮発性メモリ115には、例えばフラッシュメモリ又は「Electrically Erasable Programmable Read-Only Memory」などを適用することができる。不揮発性メモリ115は、後述する暗号システムSによる暗号処理を実行するためのプログラム等を記憶する。 The RAM 112 stores, for example, data temporarily required for the OS (Operating System) and various applications to function. The ROM 113 stores an OS, various applications, and the like. I/O circuit 114 serves as a communication interface with SE2. A flash memory or an "electrically erasable programmable read-only memory" can be applied to the nonvolatile memory 115, for example. The nonvolatile memory 115 stores programs and the like for executing cryptographic processing by the cryptographic system S, which will be described later.

SE2は、CPU21、RAM22、不揮発性メモリ23及びI/O回路24を備えて構成される。SE2は、高い耐タンパ性を有する。耐タンパ性が高いとは、暗号化、復号、署名検証のための鍵をはじめとする秘密情報や秘密情報の処理メカニズムを外部から不当に観測・改変することや秘密情報を処理するメカニズムを不当に改変することの困難さが極めて高いことを意味する。 The SE 2 comprises a CPU 21 , RAM 22 , nonvolatile memory 23 and I/O circuit 24 . SE2 has high tamper resistance. High tamper resistance means that confidential information such as keys for encryption, decryption, and signature verification, as well as the mechanism for processing confidential information, can be illegally observed or altered from the outside. It means that it is extremely difficult to modify to

RAM22は揮発性メモリであり、SE2へ電源が供給されている場合に情報を記憶することができ、通信機器1からの電源供給が断たれると(電源供給が断たれることを「電源断」という場合がある)、情報を記憶することができず、それまでに記憶していたデータは消失する。RAM22には、例えばOS、各種アプリケーションが機能する上で一時的に必要となるデータが記憶される。具体的には、後述する暗号鍵を使用する暗号処理の処理回数を計数する暗号カウンタを記憶する。 The RAM 22 is a volatile memory, and can store information when power is supplied to the SE 2, and when the power supply from the communication device 1 is cut off (cutting off the power supply is called "power cut off"). ”), the information cannot be stored, and the data stored up to that point is lost. The RAM 22 stores, for example, data temporarily required for the OS and various applications to function. Specifically, it stores an encryption counter that counts the number of times of encryption processing using an encryption key, which will be described later.

不揮発性メモリ23には、例えばフラッシュメモリ又は「Electrically Erasable Programmable Read-Only Memory」などを適用することができる。不揮発性メモリ23は、OS、各種アプリケーション、後述する暗号システムSによる暗号処理、カウントアップ処理、電源断復帰処理等を実行するためのプログラムや暗号鍵等を記憶する。不揮発性メモリ23は、暗号アプリケーションを記憶し、暗号アプリケーションは、通信機器1と図示しないサーバとの間の通信を暗号・復号するための暗号鍵を保持する。暗号鍵は、不揮発性メモリ23におけるセキュアな記憶領域における鍵ストレージで管理される。 Flash memory or "Electrically Erasable Programmable Read-Only Memory" can be applied to the nonvolatile memory 23, for example. The nonvolatile memory 23 stores an OS, various applications, programs for executing encryption processing, count-up processing, power-off recovery processing, and the like by the encryption system S described later, encryption keys, and the like. The nonvolatile memory 23 stores an encryption application, and the encryption application holds an encryption key for encrypting/decrypting communication between the communication device 1 and a server (not shown). Encryption keys are managed in key storage in a secure storage area in non-volatile memory 23 .

ここで、暗号カウンタについて説明する。暗号カウンタは、暗号処理で使用される暗号鍵の寿命(暗号鍵の使用回数には上限が設定されており、暗号カウンタの値が上限に達すると暗号鍵は更新される)を管理する役割を担う。また、暗号カウンタは、同一の平文を同一の暗号鍵を用いて暗号処理した場合に同一の暗号文を生成しないための情報としての役割を担う。具体的には、暗号処理の対象となる平文と暗号カウンタの値を一緒に暗号処理することにより、同一の平文を同一の暗号鍵を用いて複数回、暗号化した場合であっても、毎回異なる暗号文を出力する。これは、同一の平文に対して同一の暗号鍵を用いて暗号処理した場合に、同一の暗号文を生成することはセキュリティ上、好ましくないためである(同一の平文に対して同一の暗号鍵を用いて暗号処理したことが漏れてしまうおそれがある)。 Here, the encryption counter will be explained. The cryptographic counter plays a role in managing the lifetime of the cryptographic key used in cryptographic processing (the number of times the cryptographic key is used is set to an upper limit, and the cryptographic key is updated when the value of the cryptographic counter reaches the upper limit). bear. The cipher counter also serves as information for not generating the same ciphertext when the same plaintext is cipher-processed using the same encryption key. Specifically, by cryptographically processing the plaintext to be encrypted and the value of the encryption counter together, even if the same plaintext is encrypted multiple times using the same encryption key, the Output a different ciphertext. This is because it is not desirable from a security point of view to generate the same ciphertext when the same encryption key is used for the same plaintext (same encryption key for the same plaintext (There is a risk that the fact that the cryptographic processing was performed using

こうした役割を果たすため、暗号カウンタには、(1)カウンタ値は、暗号処理の回数と一致しなくてもよいが、暗号処理の実行回数より小さい値になってはいけない(カウンタ値は二度同じ値になってはいけない)という特性と、(2)暗号処理の実行回数と完全に同一でなくてもよい、という特性がある。(1)の特性により、暗号処理の度に、暗号カウンタの値が異なるため、同一の平文を同一の暗号鍵を用いて複数回、暗号化しても、毎回異なる暗号文を出力することができる。例えば、3回連続して平文「XXXXX]を暗号処理する場合、暗号処理の対象は「XXXXX1」、「XXXXX2」、「XXXXX3」(最後の文字が暗号カウンタの値)、というように暗号処理の度に変化するため同一の暗号文が出力されない。なお、暗号カウンタの値を含める位置は、平文の最後の位置以外の所定位置であってもよい。 In order to play this role, the cryptographic counter has the following characteristics: (1) The counter value does not have to match the number of times cryptographic processing has been performed, but it must not be less than the number of times cryptographic processing has been performed (the counter value is (2) it does not have to be exactly the same as the number of cryptographic processing executions. Due to the characteristic of (1), the value of the encryption counter differs each time encryption processing is performed, so even if the same plaintext is encrypted multiple times using the same encryption key, a different ciphertext can be output each time. . For example, if the plaintext "XXXXXX" is to be encrypted three times in a row, the objects to be encrypted are "XXXXXX1", "XXXXXX2", and "XXXXXX3" (the last character is the value of the encryption counter). The same ciphertext is not output because it changes every time. Note that the position where the value of the encryption counter is included may be a predetermined position other than the last position of the plaintext.

暗号カウンタは揮発性メモリであるRAM22に記憶されるため、通信機器1からの電源供給が断たれるとカウンタ値が消失する。そこで、本実施形態のSE2では、RAM22が記憶する暗号カウンタとは別に、電源供給断により情報を消失することのない不揮発性メモリ23が補助カウンタを記憶する。そして、通信機器1からの電源供給が断たれ、その後電源供給が再開された場合に、暗号カウンタの値に補助カウンタの値をコピーすることにより暗号カウンタを復旧する(「電源断復帰処理」という場合がある)。 Since the cryptographic counter is stored in the RAM 22 which is a volatile memory, the counter value disappears when the power supply from the communication device 1 is cut off. Therefore, in the SE2 of the present embodiment, the non-volatile memory 23, which does not lose information due to interruption of the power supply, stores an auxiliary counter in addition to the cryptographic counter stored in the RAM 22. FIG. When the power supply from the communication device 1 is interrupted and then restarted, the encryption counter is restored by copying the value of the auxiliary counter to the value of the encryption counter (referred to as "power-off restoration processing"). sometimes).

暗号カウンタは、暗号処理の実行(暗号鍵の使用)に伴い「1」ずつカウントアップされる(暗号カウンタに加算される所定値(本実施形態では「1」)を「カウントアップ値」という場合がある)。一方、補助カウンタは、暗号処理の実行の度にカウントアップされるのではなく、暗号カウンタの値が次のカウントアップで補助カウンタの値を上回る場合に、その前にマージン値(本実施形態では「200」とするが、「2」以上の整数であればよい)が加算される。これにより、補助カウンタは暗号カウンタの値よりも常に大きな値を保持することができる。また、電源断により暗号カウンタの値が消失した場合であっても電源断復帰処理により電源断時の暗号カウンタの値よりも大きな値となって復帰する。このように、暗号カウンタと補助カウンタを運用することにより、暗号カウンタの上記(1)の特性を維持することができる。 The cryptographic counter is counted up by "1" as the cryptographic processing is executed (using the cryptographic key) (a predetermined value added to the cryptographic counter ("1" in this embodiment) is referred to as a "count-up value"). there is). On the other hand, the auxiliary counter is not counted up each time cryptographic processing is executed, but when the value of the cryptographic counter exceeds the value of the auxiliary counter at the next count up, the margin value (in this embodiment, "200", but any integer of "2" or more is acceptable) is added. This allows the auxiliary counter to always hold a value greater than the value of the cryptographic counter. Also, even if the value of the encryption counter is lost due to power failure, the value of the encryption counter is recovered by the power failure restoration process to a value larger than the value of the encryption counter at the time of power failure. By operating the cryptographic counter and the auxiliary counter in this way, the characteristic (1) of the cryptographic counter can be maintained.

また、暗号カウンタは暗号処理の度にカウントアップされることによりRAM22への書き込みが発生するのに対して、補助カウンタは暗号処理の度にカウントアップされず、不揮発性メモリ23への書き込みは、マージン値分の暗号処理が行われる毎に発生する(但し、電源断復帰処理があった場合を除く)。つまり、暗号処理の度にカウントアップするカウンタ(暗号カウンタ)をRAM22に記憶させることにより、不揮発性メモリ23への書き込みを抑制でき、不揮発性メモリ23の寿命を長くすることができる。本実施形態のようにマージン値が「200」であれば、暗号処理が200回実行される度に1回、不揮発性メモリへ(補助カウンタ)の書き込みが発生する。つまり、不揮発性メモリ23(補助カウンタ)への書き込み回数は、RAM22(暗号カウンタ)への書き込み回数の200分の1となる。仮に不揮発性メモリ23の書き込み回数の耐久上限が10万回、1日の暗号処理回数が5000回であれば、不揮発性メモリ23の寿命は、本実施形態の方法を採用しなければ(不揮発性メモリ23に暗号カウンタを記憶させることとした場合)、「100,000(回)÷5,000(回/日)=20(日)」となるが、本実施形態の方法によれば、「20(日)×200=4000(日)」とすることができる。 In addition, while the encryption counter is incremented each time encryption processing is performed, writing to the RAM 22 occurs. Occurs each time cryptographic processing for the margin value is performed (except when there is power-off recovery processing). That is, by storing in the RAM 22 a counter (encryption counter) that counts up each time encryption processing is performed, writing to the nonvolatile memory 23 can be suppressed and the life of the nonvolatile memory 23 can be lengthened. If the margin value is "200" as in the present embodiment, writing to the non-volatile memory (auxiliary counter) occurs once every 200 times of cryptographic processing. That is, the number of writes to the nonvolatile memory 23 (auxiliary counter) is 1/200 of the number of writes to the RAM 22 (cipher counter). If the endurance upper limit of the number of write operations of the nonvolatile memory 23 is 100,000 times, and the number of cryptographic processing operations per day is 5,000 times, the life of the nonvolatile memory 23 is determined by adopting the method of the present embodiment (nonvolatile If the encryption counter is stored in the memory 23), "100,000 (times)/5,000 (times/day) = 20 (days)", but according to the method of the present embodiment, " 20 (days) x 200 = 4000 (days).

I/O回路24は、制御部11との通信インターフェイスを担う。 The I/O circuit 24 serves as a communication interface with the control section 11 .

[3.暗号システムSによる暗号処理]
次に、図2を用いて、暗号システムSによる暗号処理の一例について説明する。
[3. Cryptographic processing by cryptographic system S]
Next, an example of cryptographic processing by the cryptographic system S will be described with reference to FIG.

まず、通信機器1の制御部11とSE2のCPU21は、通信機器1とSE2(暗号アプリケーション)間のセキュアチャンネルを開設する(ステップS1)。具体的には、通信機器1が、SE2に対してINITIALIZE UPDATEコマンドや、EXTERNAL AUTHENTICATEコマンドを送信し、SE2がそれぞれのコマンドに対する処理を行い、処理結果を含むレスポンスを通信機器1に返信することにより行われる。なお、通信機器1とSE2(暗号アプリケーション)間の通信は、APDU(Application Protocol Data Unit)により行われる。 First, the control unit 11 of the communication device 1 and the CPU 21 of the SE2 establish a secure channel between the communication device 1 and the SE2 (encryption application) (step S1). Specifically, the communication device 1 transmits an INITIALIZE UPDATE command or an EXTERNAL AUTHENTICATE command to the SE2, the SE2 performs processing for each command, and returns a response including the processing result to the communication device 1. done. Communication between the communication device 1 and SE2 (encryption application) is performed by APDU (Application Protocol Data Unit).

通信機器1の制御部11は、セキュアチャネルが開設されると、セキュアチャネルを介して平文を含むC-APDU(コマンドAPDU)をSE2に送信する(ステップS2)。 When the secure channel is opened, the control unit 11 of the communication device 1 transmits a C-APDU (command APDU) including plaintext to the SE2 via the secure channel (step S2).

SE2のCPU21は、平文を受信すると、図3を用いて後述するカウントアップ処理(暗号カウンタ、補助カウンタに関する処理)を実行する(ステップS3)。 When the plaintext is received, the CPU 21 of SE2 executes count-up processing (processing related to the encryption counter and the auxiliary counter), which will be described later with reference to FIG. 3 (step S3).

次いで、SE2のCPU21は、暗号カウンタの値をパラメータとし、暗号鍵を用いて平文に対して暗号処理を実行する(ステップS4)。 Next, the CPU 21 of the SE2 uses the value of the encryption counter as a parameter and uses the encryption key to perform encryption processing on the plaintext (step S4).

次いで、SE2のCPU21は、ステップS4の暗号処理により生成した暗号文と、SW(Status Word)「9000h」(正常終了を示す)を含むR-APDU(レスポンスAPDU)を通信機器1に送信する(ステップS5)。なお、図示しないが、これ以降、暗号すべき平文があれば、ステップS2~ステップS5の処理が繰り返される。 Next, the CPU 21 of the SE2 transmits an R-APDU (response APDU) including the ciphertext generated by the encryption processing in step S4 and SW (Status Word) "9000h" (indicating normal termination) to the communication device 1 ( step S5). Although not shown, if there is a plaintext to be encrypted after that, the processing of steps S2 to S5 is repeated.

[5.SE2によるカウントアップ処理]
次に、図3を用いて、SE2によるカウントアップ処理の一例について説明する。
[5. Count-up processing by SE2]
Next, an example of count-up processing by SE2 will be described with reference to FIG.

まず、SE2のCPU21は、不揮発性メモリ23に記憶されている補助カウンタの値と、RAM22に記憶されている暗号カウンタの値が等しいか否かを判定する(ステップS101)。 First, the CPU 21 of the SE2 determines whether or not the value of the auxiliary counter stored in the nonvolatile memory 23 is equal to the value of the encryption counter stored in the RAM 22 (step S101).

CPU21は、補助カウンタの値と暗号カウンタの値が等しくないと判定した場合には(ステップS101:NO)、暗号カウンタにカウントアップ値「1」を加算し(ステップS103)、カウントアップ処理を終了する。 When the CPU 21 determines that the value of the auxiliary counter and the value of the encryption counter are not equal (step S101: NO), the CPU 21 adds the count-up value "1" to the encryption counter (step S103), and ends the count-up process. do.

一方、CPU21は、補助カウンタの値と暗号カウンタの値が等しいと判定した場合には(ステップS101:YES)、補助カウンタにマージン値「200」を加算し(ステップS102)、次いで、暗号カウンタにカウントアップ値「1」を加算し(ステップS103)、カウントアップ処理を終了する。 On the other hand, when the CPU 21 determines that the value of the auxiliary counter and the value of the encryption counter are equal (step S101: YES), the CPU 21 adds the margin value "200" to the auxiliary counter (step S102). The count-up value "1" is added (step S103), and the count-up process ends.

なお、カウントアップ処理において、ステップS103の処理を行ってから、ステップS101の処理及びステップS102の処理(ステップS101の判定結果が「YES」の場合のみ)を行うこととしてもよい。この場合、ステップS103の処理により暗号カウンタの値がカウントアップされたことにより、補助カウンタの値と暗号カウンタの値が等しくなった場合に直ぐに補助カウンタの値にマージン値が加算されることから、補助カウンタの値が暗号カウンタの値より大きい状態を維持することができる。 In the count-up process, after performing the process of step S103, the process of step S101 and the process of step S102 (only when the determination result of step S101 is "YES") may be performed. In this case, since the value of the encryption counter is incremented by the processing in step S103, the margin value is immediately added to the value of the auxiliary counter when the value of the auxiliary counter and the value of the encryption counter become equal. The value of the auxiliary counter can remain greater than the value of the crypto counter.

[4.SE2による電源断復帰処理]
次に、図4を用いて、SE2による電源断復帰処理の一例について説明する。なお、通信機器1がSE2への電源供給を断つ場合として、例えば、通信機器1及びSE2が定期的な再起動をする場合や、SE2にエラーの発生、設定変更があった場合に通信機器1がリセット信号送りSE2をリセット(再起動)する場合などがある。
[4. Power-off recovery process by SE2]
Next, an example of power-off restoration processing by SE2 will be described using FIG. When the communication device 1 cuts off the power supply to the SE2, for example, when the communication device 1 and the SE2 are restarted periodically, when an error occurs in the SE2, or when the setting is changed, the communication device 1 may reset (restart) the reset signal sending SE2.

SE2のCPU21は、RAM22に記憶されている暗号カウンタの値に、不揮発性メモリ23に記憶されている補助カウンタの値をコピーし(ステップS111)、電源断復帰処理を終了する。 The CPU 21 of the SE2 copies the value of the auxiliary counter stored in the nonvolatile memory 23 to the value of the encryption counter stored in the RAM 22 (step S111), and ends the power-off recovery process.

以上説明したように、本実施形態に係るSE2(「電子情報記憶媒体」の一例)は、RAM22(「揮発性メモリ」の一例)が暗号カウンタ(「第1カウンタ」の一例)を記憶し、不揮発性メモリ23(「不揮発性メモリ」の一例)が補助カウンタ(「第2カウンタ」の一例)を記憶し、CPU21(「第1加算手段」、「第2加算手段」の一例)が、暗号処理(「所定の処理」の一例)の実行に伴い、暗号カウンタにカウントアップ値「1」(「第1の所定値」の一例)を加算するステップS103の処理(「第1加算処理」の一例)を実行し、次のステップS103の処理により、暗号カウンタの値が補助カウンタの値より大きくなる場合に、補助カウンタに「1」より2倍以上大きなマージン値「200」(「第2の所定値」の一例)を加算するステップS102の処理(「第2加算処理」の一例)を実行する。 As described above, in the SE 2 (an example of an "electronic information storage medium") according to the present embodiment, the RAM 22 (an example of a "volatile memory") stores an encryption counter (an example of a "first counter"), A nonvolatile memory 23 (an example of a "nonvolatile memory") stores an auxiliary counter (an example of a "second counter"), and a CPU 21 (an example of a "first adding means" and a "second adding means") stores a cryptographic Along with the execution of the process (an example of the "predetermined process"), the process of step S103 for adding the count-up value "1" (an example of the "first predetermined value") to the encryption counter (an example of the "first addition process"). example) is executed, and when the value of the cryptographic counter becomes larger than the value of the auxiliary counter by the processing of the next step S103, the margin value "200" ("2nd An example of a "predetermined value") is added (an example of a "second addition process") in step S102.

したがって、本実施形態の暗号システムSによれば、RAM22に暗号カウンタを、不揮発性メモリ23に補助カウンタそれぞれ記憶させ、暗号処理の実行に伴い暗号カウンタにカウントアップ値「1」を加算し、暗号カウンタの値が補助カウンタの値を超えない期間は補助カウンタを書き換えず、次のステップS103の処理により暗号カウンタの値が補助カウンタの値を超える場合、その前に補助カウンタにマージン値「200」を加算する。これにより、暗号カウンタの値が補助カウンタの値を超えない期間では暗号カウンタのみを書き換え、暗号カウンタの値が補助カウンタの値を超える場合にのみ補助カウンタを書き換えるため、補助カウンタの書き換え回数を抑制し、不揮発性メモリ23の寿命を長くすることができる。 Therefore, according to the cryptographic system S of the present embodiment, the cryptographic counter is stored in the RAM 22 and the auxiliary counter is stored in the nonvolatile memory 23, and the count-up value "1" is added to the cryptographic counter as the cryptographic processing is executed. During the period when the counter value does not exceed the auxiliary counter value, the auxiliary counter is not rewritten. Add As a result, only the encryption counter is rewritten while the encryption counter value does not exceed the auxiliary counter value, and the auxiliary counter is rewritten only when the encryption counter value exceeds the auxiliary counter value, thereby suppressing the number of times the auxiliary counter is rewritten. and the life of the nonvolatile memory 23 can be lengthened.

また、本実施形態に係るSE2(「電子情報記憶媒体」の一例)のCPU21(「書込手段」の一例)は、RAM22への電源供給が断たれ、電源供給が再開した場合に、暗号カウンタの値に補助カウンタの値を書き込む電源断復帰処理を実行する。これにより、電源断により暗号カウンタの値が消失した場合であっても電源断復帰処理により電源断時の暗号カウンタの値よりも大きな値となって復帰させることができ、暗号カウンタの上記(1)の特性を維持することができる。 Further, the CPU 21 (an example of a "writing means") of the SE 2 (an example of an "electronic information storage medium") according to the present embodiment, when the power supply to the RAM 22 is cut off and restarted, the encryption counter Execute power failure recovery processing to write the value of the auxiliary counter to the value of As a result, even if the value of the encryption counter is lost due to a power failure, the value of the encryption counter at the time of power failure can be recovered by the power failure recovery processing, and the value of the encryption counter above (1 ) can be maintained.

なお、次のステップS103の処理により暗号カウンタの値が補助カウンタの値を超えるか否かの判定について、本実施形態では、マージン値を「200」とし、カウントアップ値を「1」とした上で、CPU21は、暗号カウンタの値が補助カウンタの値と等しいか否かを判定する(ステップS101)こととしている。ここで、マージン値とカウントアップ値の変形例について説明すると、マージン値は、カウントアップ値を整数倍(但し、「2」倍以上)した値であればよい。例えば、カウントアップ値を「2」(ステップアップ値は「1」以外とすることもできる)とした場合(この場合、暗号鍵の使用回数は暗号カウンタの2分の1となる(但し、電源断復帰処理が実行されていない場合))には、マージン値として「4」以上の「2」の整数倍とすることができる。これにより、CPU21は、暗号カウンタの値が補助カウンタの値と等しいか否かを判定する(ステップS101)ことにより、次のステップS103の処理により暗号カウンタの値が補助カウンタの値を超えるか否かを判定することができる。 In the present embodiment, the margin value is set to "200" and the count-up value is set to "1" for determining whether or not the value of the encryption counter exceeds the value of the auxiliary counter in the processing of the next step S103. Then, the CPU 21 determines whether or not the value of the encryption counter is equal to the value of the auxiliary counter (step S101). Here, a modified example of the margin value and the count-up value will be described. The margin value may be a value obtained by multiplying the count-up value by an integer (however, "2" or more). For example, if the count-up value is set to "2" (the step-up value can be other than "1") (in this case, the number of times the encryption key is used is 1/2 of the encryption counter (however, the power supply If the disconnection recovery process is not executed)), the margin value can be an integer multiple of "2" equal to or greater than "4". As a result, the CPU 21 determines whether or not the value of the encryption counter is equal to the value of the auxiliary counter (step S101), thereby determining whether or not the value of the encryption counter exceeds the value of the auxiliary counter in the next step S103. It is possible to determine whether

また、本実施形態の変形例として、ステップS101の処理において、次のステップS103の処理により補助カウンタの値が暗号カウンタの値より大きくなるか否かを判定することとしてもよい。この場合のマージン値は、ステップアップ値の2倍以上の値であれば、ステップアップ値の整数倍でなくてもよい。 Further, as a modification of the present embodiment, in the process of step S101, it may be determined whether or not the value of the auxiliary counter becomes larger than the value of the encryption counter by the process of the next step S103. The margin value in this case does not have to be an integer multiple of the step-up value as long as it is at least twice the step-up value.

更に、図示していないが、SE2のCPU21(「更新手段」の一例)は、暗号カウンタの値が所定の上限値以上になった場合に、暗号鍵を更新することとする。これにより、同一の暗号鍵を使用し続けることを防ぐことができる。なお、カウントアップ値を「1」以外の数値(n)とした場合には、暗号処理の回数(暗号鍵の使用回数)は、およそ、暗号カウンタの値をnで割った回数となることを考慮することとする。 Furthermore, although not shown, the CPU 21 (an example of "update means") of SE2 updates the encryption key when the value of the encryption counter reaches or exceeds a predetermined upper limit. This can prevent continued use of the same encryption key. Note that when the count-up value is set to a number (n) other than "1", the number of times of encryption processing (the number of times the encryption key is used) is approximately the number of times obtained by dividing the value of the encryption counter by n. We will consider it.

ところで、マージン値は、大きければ大きいほど、補助カウンタにマージン値を加算する回数が減り、不揮発性メモリ23への書き込み回数を抑制することができる。しかしながら、あまりに大きな値としてしまうと、電源断復帰処理があった場合に暗号カウンタに大きな値がコピーされるため、直ぐに暗号鍵の使用回数の上限に達してしまい、頻繁に暗号鍵の更新処理が必要になる。したがって、マージン値は、電源断復帰処理が実行される頻度や、暗号鍵の使用回数の上限を考慮して設定することが好ましい。 By the way, the larger the margin value, the less the number of times the margin value is added to the auxiliary counter, and the more times the data is written to the nonvolatile memory 23 . However, if the value is too large, a large value will be copied to the encryption counter when the power is restored, and the maximum number of times the encryption key will be used will be reached soon, and the encryption key will need to be updated frequently. become necessary. Therefore, it is preferable to set the margin value in consideration of the frequency with which the power failure recovery process is executed and the upper limit of the number of times the encryption key is used.

また、本実施形態では、暗号処理を計数する暗号カウンタについて説明したが、(1)カウンタ値は、所定の処理の回数と一致しなくてもよいが、所定の処理の実行回数より小さい値になってはいけない(カウンタ値は二度同じ値になってはいけない)、(2)所定の処理の実行回数と完全に同一でなくてもよい、という特性を持つカウンタについて本発明を適用することができる。 In addition, in the present embodiment, a cryptographic counter that counts cryptographic processing has been described. (the counter value must not be the same value twice); can be done.

S 暗号システム
11 制御部
111 CPU
112 RAM
113 ROM
114 I/O回路
115 不揮発性メモリ
12 通信部
13 入力部
14 出力部
2 SE
21 CPU
22 RAM
23 不揮発性メモリ
24 I/O回路
S encryption system 11 control unit 111 CPU
112 RAMs
113 ROMs
114 I/O circuit 115 nonvolatile memory 12 communication unit 13 input unit 14 output unit 2 SE
21 CPUs
22 RAMs
23 non-volatile memory 24 I/O circuit

Claims (8)

第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体であって、
所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段と、
次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段と、
を備え
前記第2の所定値は、前記第1の所定値を整数倍した値であり、
前記第2加算手段は、前記第1カウンタの値が前記第2カウンタの値と等しい場合に、前記第2加算処理を実行することを特徴とする電子情報記憶媒体。
An electronic information storage medium comprising a volatile memory that stores a first counter and a non-volatile memory that stores a second counter,
a first addition means for executing a first addition process of adding a first predetermined value to the first counter along with execution of a predetermined process;
When the value of the first counter becomes larger than the value of the second counter by the following first addition processing, a second value equal to or more than twice the first predetermined value is stored in the second counter. a second addition means for executing a second addition process for adding a predetermined value;
with
The second predetermined value is a value obtained by multiplying the first predetermined value by an integer,
The electronic information storage medium, wherein the second addition means executes the second addition process when the value of the first counter is equal to the value of the second counter.
請求項1に記載の電子情報記憶媒体であって、
前記揮発性メモリへの電源供給が断たれ、電源供給が再開した場合に、前記第1カウンタに前記第2カウンタの値を書き込む書込手段を更に備えることを特徴とする電子情報記憶媒体。
The electronic information storage medium according to claim 1,
The electronic information storage medium further comprising writing means for writing the value of the second counter to the first counter when power supply to the volatile memory is interrupted and resumed.
請求項1又は2に記載の電子情報記憶媒体であって、
前記第1の所定値は「1」であることを特徴とする電子情報記憶媒体。
3. The electronic information storage medium according to claim 1 or 2 ,
The electronic information storage medium, wherein the first predetermined value is "1".
第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体であって、
所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段と、
次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段と、
を備え、
前記所定の処理は暗号鍵を使用する暗号処理であり、
前記第1カウンタの値が所定の上限値以上になった場合に、前記暗号鍵を更新する更新手段、
を更に備えることを特徴とする電子情報記憶媒体。
An electronic information storage medium comprising a volatile memory that stores a first counter and a non-volatile memory that stores a second counter,
a first addition means for executing a first addition process of adding a first predetermined value to the first counter along with execution of a predetermined process;
When the value of the first counter becomes larger than the value of the second counter by the following first addition processing, a second value equal to or more than twice the first predetermined value is stored in the second counter. a second addition means for executing a second addition process for adding a predetermined value;
with
the predetermined processing is cryptographic processing using an encryption key;
updating means for updating the encryption key when the value of the first counter reaches or exceeds a predetermined upper limit;
An electronic information storage medium, further comprising:
第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体によるカウンタ更新方法であって、
所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算工程と、
次の前記第1加算工程により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算工程と、
含み、
前記第2の所定値は、前記第1の所定値を整数倍した値であり、
前記第2加算工程は、前記第1カウンタの値が前記第2カウンタの値と等しい場合に、実行することを特徴とするカウンタ更新方法。
A counter updating method by an electronic information storage medium comprising a volatile memory storing a first counter and a non-volatile memory storing a second counter,
a first addition step of adding a first predetermined value to the first counter as predetermined processing is executed;
When the value of the first counter becomes larger than the value of the second counter by the following first adding step, the second counter is set to a value equal to or more than two times the first predetermined value. a second addition step of adding a predetermined value;
including
The second predetermined value is a value obtained by multiplying the first predetermined value by an integer,
The counter updating method, wherein the second adding step is executed when the value of the first counter is equal to the value of the second counter .
第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体によるカウンタ更新方法であって、
所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算工程と、
次の前記第1加算工程により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算工程と、
含み、
前記所定の処理は暗号鍵を使用する暗号処理であり、
前記第1カウンタの値が所定の上限値以上になった場合に、前記暗号鍵を更新する更新工程、
を更に含むことを特徴とするカウンタ更新方法。
A counter updating method by an electronic information storage medium comprising a volatile memory storing a first counter and a non-volatile memory storing a second counter,
a first addition step of adding a first predetermined value to the first counter as predetermined processing is executed;
When the value of the first counter becomes larger than the value of the second counter by the following first adding step, the second counter is set to a value equal to or more than two times the first predetermined value. a second addition step of adding a predetermined value;
including
the predetermined processing is cryptographic processing using an encryption key;
an updating step of updating the encryption key when the value of the first counter reaches or exceeds a predetermined upper limit;
A counter update method , further comprising :
第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体に含まれるコンピュータを、
所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段、
次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段、
として機能させ
前記第2の所定値は、前記第1の所定値を整数倍した値であり、
前記第2加算手段は、前記第1カウンタの値が前記第2カウンタの値と等しい場合に、前記第2加算処理を実行することを特徴とするカウンタ更新プログラム。
a computer contained in an electronic information storage medium comprising a volatile memory storing a first counter and a non-volatile memory storing a second counter;
a first addition means for executing a first addition process for adding a first predetermined value to the first counter along with execution of a predetermined process;
When the value of the first counter becomes larger than the value of the second counter by the following first addition processing, a second value equal to or more than twice the first predetermined value is stored in the second counter. second addition means for executing a second addition process for adding a predetermined value;
function as
The second predetermined value is a value obtained by multiplying the first predetermined value by an integer,
The counter update program, wherein the second addition means executes the second addition process when the value of the first counter is equal to the value of the second counter.
第1カウンタを記憶する揮発性メモリと、第2カウンタを記憶する不揮発性メモリを備える電子情報記憶媒体に含まれるコンピュータを、
所定の処理の実行に伴い、前記第1カウンタに第1の所定値を加算する第1加算処理を実行する第1加算手段、
次の前記第1加算処理により、前記第1カウンタの値が前記第2カウンタの値より大きくなる場合に、前記第2カウンタに前記第1の所定値の2倍以上の値である第2の所定値を加算する第2加算処理を実行する第2加算手段、
として機能させ
前記所定の処理は暗号鍵を使用する暗号処理であり、
前記第1カウンタの値が所定の上限値以上になった場合に、前記暗号鍵を更新する更新手段として更に機能させることを特徴とするカウンタ更新プログラム。
a computer contained in an electronic information storage medium comprising a volatile memory storing a first counter and a non-volatile memory storing a second counter;
a first addition means for executing a first addition process for adding a first predetermined value to the first counter along with execution of a predetermined process;
When the value of the first counter becomes larger than the value of the second counter by the following first addition processing, a second value equal to or more than twice the first predetermined value is stored in the second counter. second addition means for executing a second addition process for adding a predetermined value;
function as
the predetermined processing is cryptographic processing using an encryption key;
A counter updating program further functioning as updating means for updating the encryption key when the value of the first counter reaches or exceeds a predetermined upper limit.
JP2019131049A 2019-07-16 2019-07-16 Electronic information storage medium, counter update method and counter update program Active JP7307400B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019131049A JP7307400B2 (en) 2019-07-16 2019-07-16 Electronic information storage medium, counter update method and counter update program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019131049A JP7307400B2 (en) 2019-07-16 2019-07-16 Electronic information storage medium, counter update method and counter update program

Publications (2)

Publication Number Publication Date
JP2021015543A JP2021015543A (en) 2021-02-12
JP7307400B2 true JP7307400B2 (en) 2023-07-12

Family

ID=74530755

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019131049A Active JP7307400B2 (en) 2019-07-16 2019-07-16 Electronic information storage medium, counter update method and counter update program

Country Status (1)

Country Link
JP (1) JP7307400B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184265A (en) 1999-12-24 2001-07-06 Denso Corp Electronic controller
JP2004038971A (en) 2002-06-28 2004-02-05 Microsoft Corp System and method of implementing counter
JP2014168216A (en) 2013-02-28 2014-09-11 Mitsubishi Heavy Ind Ltd Cryptographic system, encryption information authentication method and program
JP2018529292A (en) 2015-09-03 2018-10-04 フィリップス ライティング ホールディング ビー ヴィ Network node

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184265A (en) 1999-12-24 2001-07-06 Denso Corp Electronic controller
JP2004038971A (en) 2002-06-28 2004-02-05 Microsoft Corp System and method of implementing counter
JP2014168216A (en) 2013-02-28 2014-09-11 Mitsubishi Heavy Ind Ltd Cryptographic system, encryption information authentication method and program
JP2018529292A (en) 2015-09-03 2018-10-04 フィリップス ライティング ホールディング ビー ヴィ Network node

Also Published As

Publication number Publication date
JP2021015543A (en) 2021-02-12

Similar Documents

Publication Publication Date Title
CN100388245C (en) Multitask execution system
EP2294529B1 (en) Electronic device and method of software or firmware updating of an electronic device
US8195956B2 (en) Re-keying data in place
US6925523B2 (en) Managing monotonically increasing counter values to minimize impact on non-volatile storage
JP5705235B2 (en) Method and apparatus for storing data
US20080201661A1 (en) Remote flash storage management
US20090070599A1 (en) Memory card, application program holding method, and holding program
EP3007094B1 (en) Boot program, information processing apparatus, information processing system, information processing method, semiconductor apparatus, and program
JP2011129192A (en) Semiconductor memory device
US9830479B2 (en) Key storage and revocation in a secure memory system
CN110727940A (en) Electronic equipment password management method, device, equipment and storage medium
JP2007316944A (en) Data processor, data processing method and data processing program
JP7307400B2 (en) Electronic information storage medium, counter update method and counter update program
US10880082B2 (en) Rekeying keys for encrypted data in nonvolatile memories
CN102929806B (en) Be applicable to progress record method and the restoration methods of the encoding operation of memory storage
US11601270B1 (en) Methods, systems and computer program products for rotating cryptographic keys for encrypted files
JP2013062616A (en) Storage device, data storage method, and data controller
US11588634B2 (en) Storage device and controlling method
JP3730432B2 (en) Storage system, storage device, and storage data protection method
RU2580014C2 (en) System and method for changing mask of encrypted region during breakdown in computer system
JP6752247B2 (en) Information distribution device, distribution target device, information distribution system, information distribution method and program
CN114342314A (en) Password erasure via internal and/or external actions
CN110795702A (en) Software anti-cracking method, device, equipment and medium
JP2004348526A (en) Ic card, ic card program, and switching method of code section
JP7400215B2 (en) Control Units, Data Disabling Programs, and Control Systems

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220527

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230314

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230511

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: 20230531

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230613

R150 Certificate of patent or registration of utility model

Ref document number: 7307400

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150