JP2013167740A - Encryption device, encryption method, and encryption program - Google Patents

Encryption device, encryption method, and encryption program Download PDF

Info

Publication number
JP2013167740A
JP2013167740A JP2012030604A JP2012030604A JP2013167740A JP 2013167740 A JP2013167740 A JP 2013167740A JP 2012030604 A JP2012030604 A JP 2012030604A JP 2012030604 A JP2012030604 A JP 2012030604A JP 2013167740 A JP2013167740 A JP 2013167740A
Authority
JP
Japan
Prior art keywords
counter value
data
data length
counter
length
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.)
Pending
Application number
JP2012030604A
Other languages
Japanese (ja)
Inventor
Tomoyasu Suzaki
智保 洲崎
Yukiyasu Tsunoo
幸保 角尾
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2012030604A priority Critical patent/JP2013167740A/en
Publication of JP2013167740A publication Critical patent/JP2013167740A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To shorten a processing time of an encryption process by a counter mode.SOLUTION: The encryption device includes: expanded key generation means for generating an expanded key from an encryption key; information output means for retaining a first counter value, when data length of encryption data is a predetermined data length or more, outputting a first counter value and retaining a counter value formed by updating the first counter value as a second counter value, when the data length of the encryption data is less than the predetermined data length, retaining the second counter value having the same value as that of the first counter value, and outputting a counter difference between the first counter value and the second counter value that is the updated counter value or is the same value as that of the first counter value; intermediate data generation means for determining a range of intermediate data generated from the expanded key and the first counter value on the basis of the counter difference, and outputting the intermediate data; and data randomizing means for encrypting the output intermediate data using the expanded key.

Description

本発明は、データの通信や蓄積の際にデータを秘匿するための暗号化装置、暗号化方法および暗号化プログラムに関する。   The present invention relates to an encryption device, an encryption method, and an encryption program for concealing data during data communication and storage.

通信データや蓄積データを秘匿する技術として共通鍵ブロック暗号がある。現在、提案されているブロック暗号のブロックサイズは64ビットや128ビットである。   A common key block cipher is a technique for concealing communication data and stored data. Currently, the block size of the proposed block cipher is 64 bits or 128 bits.

ブロック長よりも長いメッセージを暗号化する場合、メッセージをブロックサイズに分割して暗号化処理を行う。このとき、暗号利用モードと呼ばれる技術が利用される。その一つとしてカウンター(CTR)モードがある。
CTRモードによる暗号化は、

=E(ctr)+M
=E(ctr+1)+M
=E(ctr+2)+M


で行われる。ここで、Eは鍵Kによる暗号化処理、ctrはカウンター初期値、M(iは0又は正の整数)はブロックサイズに分割したメッセージ、C(iは0又は正の整数)は暗号化されたデータを示す。+は排他的論理和(XOR)を示す。
When a message longer than the block length is encrypted, the message is divided into block sizes and encryption processing is performed. At this time, a technique called an encryption usage mode is used. One of them is a counter (CTR) mode.
Encryption in CTR mode is

C 0 = E K (ctr) + M 0
C 1 = E K (ctr + 1) + M 1
C 2 = E K (ctr + 2) + M 2
:

Done in Here, E K is an encryption process using a key K, ctr is a counter initial value, M i (i is 0 or a positive integer) is a message divided into block sizes, and C i (i is 0 or a positive integer) is Indicates encrypted data. + Indicates exclusive OR (XOR).

カウンター値は鍵Kが変更されるまで同じ値を利用してはならない。ソフトウェア実装によって、CTRモードを実装する場合、カウンター値の更新は算術加算命令で行う場合が多い。ここで、算術加算によるデータの変化に注目する。   The counter value should not be used until the key K is changed. When the CTR mode is implemented by software implementation, the counter value is often updated by an arithmetic addition instruction. Here, attention is paid to changes in data due to arithmetic addition.

図1は4ビットの2進数データに1ずつ加算したときの状態変化を示したものである。4桁の数値の右から順にビット番号を0、1、2、3とする。+1ずつ加算したときの各ビットの状態変化を見ると、第nビットは2回ごとに0から1へ、または1から0へと変化している。 FIG. 1 shows a change in state when one is added to 4-bit binary data. The bit numbers are 0, 1, 2, and 3 in order from the right of the 4-digit numerical value. Looking at the state change of each bit when +1 is added, the nth bit changes from 0 to 1 or from 1 to 0 every 2 n times.

このように、算術加算における桁上がりの性質として多くの場合桁上がりの影響は局所的であり、変化があった一番下位ビットから離れるほど桁上がりの影響を受けにくい。   As described above, in many cases, the effect of the carry in the arithmetic addition is local, and the influence of the carry is less likely to occur as the distance from the least significant bit is changed.

近年のブロック暗号のブロック長は64ビット以上であることが多く、そのようなブロック暗号をCTRモードで実装した場合、入力値(ctr)の変化は局所的なものとなる。   In recent years, the block length of block ciphers is often 64 bits or more, and when such a block cipher is implemented in the CTR mode, the change of the input value (ctr) becomes local.

本願に関連する技術については、特許文献1−3に開示された暗号化装置がある。特許文献1は、乱数生成装置から出力される乱数に依存して、暗号化処理実行中に必要な中間データを変化させる変更操作を行う中間データ制御手段を備えた暗号化装置の開示がある。特許文献2には、耐タンパ対策回路を付加した暗号デバイスの開示がある(段落0017,0018等)。特許文献3には、ブロックを単位として暗号化を行うブロック暗号技術を用いた暗号化装置の開示がある。   As for the technology related to the present application, there is an encryption device disclosed in Patent Documents 1-3. Japanese Patent Application Laid-Open No. 2004-133620 discloses an encryption device including intermediate data control means for performing a change operation for changing necessary intermediate data during execution of encryption processing depending on a random number output from a random number generation device. Patent Document 2 discloses a cryptographic device to which a tamper resistant circuit is added (paragraphs 0017, 0018, etc.). Patent Document 3 discloses an encryption apparatus using a block encryption technique that performs encryption in units of blocks.

特開2000−305453号公報JP 2000-305453 A 特開2006−025288号公報JP 2006-025288 A 国際公開第2009/034929号International Publication No. 2009/034929

ブロック暗号によるデータ拡販処理は、ラウンド処理を仕様で決められた回数繰り返すことでメッセージと鍵データとを攪拌する。一般に、ラウンド処理1回でメッセージの各ビットがブロック幅全体に拡散することはなく、複数回繰り返すことでブロック幅全体に拡散する。   In the data expansion process using the block cipher, the message and the key data are agitated by repeating the round process a number of times determined by the specification. In general, each bit of a message does not spread over the entire block width in a single round process, but spreads over the entire block width by repeating multiple times.

CTRモードにおけるカウンター値のように、連続したメッセージの変化が局所的である場合、ラウンド処理による中間データの変化も局所的になる場合があり、変化しないことが明らかな中間データの計算は無駄である。このようなケースは、CTRモードに限らず、入力データの変化が一部に限られるような場合にも当てはまる。   If the continuous message change is local like the counter value in the CTR mode, the change of the intermediate data by the round process may be local, and the calculation of the intermediate data that is clearly not changed is useless. is there. Such a case is applicable not only to the CTR mode but also to a case where the change of input data is limited to a part.

[発明の目的]
本発明の目的はこの問題を鑑みたものであり、入力データの変化が局所的である場合の暗号化装置、暗号化方法および暗号化プログラムを提供することである。
[Object of invention]
An object of the present invention is to provide an encryption device, an encryption method, and an encryption program in the case where the change of input data is local.

本発明の暗号化装置は、暗号化鍵から拡大鍵を生成する拡大鍵生成手段と、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する情報出力手段と、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力する中間データ生成手段と、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力するデータ攪拌手段と、
を備えた暗号化装置である。
An encryption apparatus according to the present invention includes an extended key generation unit that generates an extended key from an encryption key;
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; Information output means for outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
Intermediate data generating means for determining a range of intermediate data generated from the extended key and the first counter value based on the counter difference, and outputting the generated intermediate data;
Data agitation means for encrypting and outputting the output intermediate data using the expanded key;
Is an encryption device.

本発明の暗号化方法は、暗号化鍵から拡大鍵を生成し、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力し、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力し、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力する、暗号化方法である。
The encryption method of the present invention generates an extended key from an encryption key,
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; Outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
Based on the counter difference, determine a range of intermediate data to be generated from the extended key and the first counter value, and output the generated intermediate data,
In the encryption method, the output intermediate data is encrypted using the extended key and output.

本発明の暗号化プログラムは、暗号化装置としてのコンピュータに、
暗号化鍵から拡大鍵を生成する機能と、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する機能と、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力する機能と、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力する機能とを、実行させるための暗号化プログラムである。
The encryption program of the present invention is stored in a computer as an encryption device.
A function to generate an extended key from an encryption key;
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; A function of outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
A function of determining a range of intermediate data to be generated from the extended key and the first counter value based on the counter difference, and outputting the generated intermediate data;
It is an encryption program for executing the function of encrypting and outputting the output intermediate data using the extended key.

本発明によれば、カウンター値に変化ない部分の中間データを計算する必要がなくなるため、暗号化処理の計算時間を短縮することができる。   According to the present invention, since it is not necessary to calculate the intermediate data of the part that does not change to the counter value, the calculation time of the encryption process can be shortened.

2進数データの加算における桁上りの例を示す図である。It is a figure which shows the example of the carry in the addition of binary number data. 本発明に係る一実施形態の暗号化装置を示す図である。It is a figure which shows the encryption apparatus of one Embodiment which concerns on this invention. カウンター更新手段を示す図である。It is a figure which shows a counter update means. 暗号アルゴリズムのデータ攪拌手段の一例を示す図である。It is a figure which shows an example of the data stirring means of an encryption algorithm. 本発明の実施の処理フローを示す図である。It is a figure which shows the processing flow of implementation of this invention. 中間データの位置を示す図である。It is a figure which shows the position of intermediate data. x1が変化した場合に更新する中間データを示す図である。It is a figure which shows the intermediate data updated when x1 changes.

次に、本発明を実施するための最良の形態について図面を参照して詳細に説明する。   Next, the best mode for carrying out the present invention will be described in detail with reference to the drawings.

図2を参照すると、本実施形態の暗号化装置2は、拡大鍵生成部20、データ攪拌部21、情報出力部22、中間データ生成部23、及び演算部24を備える。演算部24は暗号化装置の外部に設けてもよい。   Referring to FIG. 2, the encryption device 2 of this embodiment includes an extended key generation unit 20, a data agitation unit 21, an information output unit 22, an intermediate data generation unit 23, and a calculation unit 24. The calculation unit 24 may be provided outside the encryption device.

データ攪拌部21と拡大鍵生成部20は、どのような暗号アルゴリズムを利用してもよい。ブロック暗号アルゴリズムの代表的なものとして、AES(Advanced Encryption Standard)やDES(Data Encryption Standard)がある。   The data agitation unit 21 and the expanded key generation unit 20 may use any encryption algorithm. Typical block cipher algorithms include AES (Advanced Encryption Standard) and DES (Data Encryption Standard).

情報出力部22には暗号化データのデータ長(ビット)とカウンター初期値とが入力される。情報出力部22は、ループ制御部220、カウンター更新部221、そして差分計算部222、第1のカウンター223、第2のカウンター224、残データ長保存部225を備える。   The information output unit 22 receives the data length (bits) of encrypted data and the counter initial value. The information output unit 22 includes a loop control unit 220, a counter update unit 221, a difference calculation unit 222, a first counter 223, a second counter 224, and a remaining data length storage unit 225.

データ長は残データ長保存部225へ保存される。   The data length is stored in the remaining data length storage unit 225.

ループ制御部220は、残データ長保存部225に保存された残データ長が1ビット以上であれば、カウンター更新部221へ更新指示を出す。そして、残データ長がブロック長(Nビットとする)以上あれば、暗号化データ長としてNを出力し、残データ長保存部225に保存された残データ長からNを減算する。   If the remaining data length stored in the remaining data length storage unit 225 is 1 bit or more, the loop control unit 220 issues an update instruction to the counter update unit 221. If the remaining data length is equal to or greater than the block length (N bits), N is output as the encrypted data length, and N is subtracted from the remaining data length stored in the remaining data length storage unit 225.

残データ長保存部225に保存された残データ長がN未満(Mビットとする)であれば、暗号化データ長としてMを出力し、残データ長を0にする。   If the remaining data length stored in the remaining data length storage unit 225 is less than N (M bits), M is output as the encrypted data length, and the remaining data length is set to zero.

カウンター初期値はカウンター223に保存される。カウンター更新部221は、ループ制御部220からの更新指示を受けると、カウンター223のカウント値を出力するとともに、カウンター値をインクリメントし、カウンター224へ保存する。   The initial counter value is stored in the counter 223. Upon receiving an update instruction from the loop control unit 220, the counter update unit 221 outputs the count value of the counter 223, increments the counter value, and stores it in the counter 224.

差分計算部222はカウンター223のカウント値とカウンター224のカウント値との差分を計算する。ここで、差分とはカウンター223とカウンター224の排他的論理和した結果をいう。カウンター223とカウンター224の第iビット(0≦i≦N−1)が等しければ差分値は0となり、異なっていれば差分値は1となる。差分を計算した後、カウンター223はカウンター224の値で更新される。   The difference calculation unit 222 calculates the difference between the count value of the counter 223 and the count value of the counter 224. Here, the difference means a result of exclusive OR of the counter 223 and the counter 224. If the i-th bit (0 ≦ i ≦ N−1) of the counter 223 and the counter 224 is equal, the difference value is 0, and if they are different, the difference value is 1. After calculating the difference, the counter 223 is updated with the value of the counter 224.

データ攪拌部21の一構成例を図4を用いて説明する。8n(n≧3)ビットの入力データ(中間データ)は8つのnビットデータに分割され処理が行われる。F関数3は、nビットのデータとnビットの拡大鍵ekij(1≦i≦r、0≦j≦3)を入力とし、それらを攪拌してnビットのデータを出力する。F関数の出力データは排他的論理和回路4により、他のnビットデータと排他的論理和(○の中に+の記号。以降、XORと記述する)される。F関数処理後の8つのnビットデータは巡回シフトして次のラウンドへ渡される。rラウンド後のデータを結合した8nビットが出力データとなる。 A configuration example of the data agitation unit 21 will be described with reference to FIG. Input data (intermediate data) of 8n (n ≧ 3) bits is divided into eight n-bit data and processed. The F function 3 receives n-bit data and an n-bit extended key ek ij (1 ≦ i ≦ r, 0 ≦ j ≦ 3), and stirs them to output n-bit data. The output data of the F function is exclusive-ORed with other n-bit data by the exclusive-OR circuit 4 (the symbol “+” in ◯, hereinafter referred to as XOR). The eight n-bit data after the F function processing is cyclically shifted and passed to the next round. The output data is 8n bits obtained by combining the data after r rounds.

次に、図2、図3、図4および図5のフローチャートを参照して、本実施の形態の動作について説明する。   Next, the operation of the present embodiment will be described with reference to the flowcharts of FIGS. 2, 3, 4, and 5.

まず、拡大鍵生成部20で暗号化鍵から拡大鍵を生成する(ステップS1)。図4のアルゴリズムの場合、4n×rビットの拡大鍵を生成し、内部メモリなどの記憶装置に保持する。拡大鍵の生成方法は採用する暗号アルゴリズムで規定された方法とし、例えば、AESであれば、FIPS-197で規定されているKey Expansionに従った方法を採用することができる。   First, the extended key generation unit 20 generates an extended key from the encryption key (step S1). In the case of the algorithm shown in FIG. 4, a 4n × r-bit extended key is generated and held in a storage device such as an internal memory. The expanded key generation method is a method defined by the employed encryption algorithm. For example, in the case of AES, a method according to Key Expansion defined by FIPS-197 can be employed.

次に、中間データ生成部23は、記憶装置に保持された拡大鍵を読出し、この拡大鍵と、情報出力部22から出力されるカウンター値とから中間データを生成する(ステップS2)。   Next, the intermediate data generation unit 23 reads the extended key held in the storage device, and generates intermediate data from the extended key and the counter value output from the information output unit 22 (step S2).

中間データ生成部23により具体的に生成する中間データを図6を参照して説明する。   The intermediate data specifically generated by the intermediate data generation unit 23 will be described with reference to FIG.

8nビットのカウンター値は8つのnビットデータに分割される。x0が下位、x7が上位とする。   The 8n-bit counter value is divided into 8 n-bit data. Assume that x0 is lower and x7 is higher.

x0はカウンターの最下位に位置するため、必ずカウンター値が変化するデータである。   Since x0 is positioned at the lowest position of the counter, it is data in which the counter value always changes.

太線のデータパスはx0が影響するパスを表しており、太線のパス上のF関数50〜65は毎ブロック計算をする。8ラウンド出力の8つの中間データ全てにx0が影響しているので、9ラウンド以降は全てのF関数を計算しなければならない。中間データとして保持するのは、x0が影響しない細線のデータパス上にあるF関数の出力データ500〜522の(23×n)ビットである。   The bold line data path represents the path affected by x0, and the F functions 50 to 65 on the bold line path calculate each block. Since x0 affects all the 8 intermediate data of 8 round outputs, all F functions must be calculated after 9 rounds. What is held as intermediate data is (23 × n) bits of output data 500 to 522 of the F function on the thin line data path that is not affected by x0.

中間データ生成部23は情報出力部22から出力されるカウンター差分を用いて更新する中間データを決定する。図6の中間データ生成部23の例では、カウンター差分の1が立っている最上位ビット(第kビットとする)の位置を見ることで判定できる。k≦n−1であれば中間データは変化しないため、更新処理は行わない。もし、n≦k≦2n−1であれば、x1が変化していることを意味している。この場合、中間データ500、502、505、508、510を更新する。このとき、中間データ511、512、513を利用することにより、再計算するF関数は66〜69のみにすることができる。また、2n≦k≦3n−1であれば、x2、x1が変化することを意味する。この場合、上記中間データに加え、中間データ509、511、512、513を更新する。ただし,中間データ509、511、512、513を更新してから中間データ500、502、505、508、510を更新する。なお、暗号化処理開始時は、カウンター差分として例えばオール1をという値を設定することにより、全中間データを計算する。   The intermediate data generation unit 23 determines the intermediate data to be updated using the counter difference output from the information output unit 22. In the example of the intermediate data generation unit 23 in FIG. 6, the determination can be made by looking at the position of the most significant bit (referred to as the kth bit) where the counter difference of 1 is set. If k ≦ n−1, the intermediate data does not change, so the update process is not performed. If n ≦ k ≦ 2n−1, it means that x1 is changing. In this case, the intermediate data 500, 502, 505, 508, 510 is updated. At this time, by using the intermediate data 511, 512, and 513, the F function to be recalculated can be only 66 to 69. Further, if 2n ≦ k ≦ 3n−1, it means that x2 and x1 change. In this case, in addition to the intermediate data, the intermediate data 509, 511, 512, and 513 are updated. However, the intermediate data 509, 511, 512, and 513 are updated, and then the intermediate data 500, 502, 505, 508, and 510 are updated. At the start of the encryption process, all intermediate data is calculated by setting, for example, a value of all 1 as the counter difference.

次に、暗号化するデータ長を残データ長へ設定する(ステップS3)。   Next, the data length to be encrypted is set to the remaining data length (step S3).

暗号化処理はステップS4〜S7を繰り返す。   The encryption process repeats steps S4 to S7.

残データ長が0ならば暗号化処理が完了したと判断して終了し、残データ長が0でなければカウンター値を暗号化する(ステップS4)。   If the remaining data length is 0, it is determined that the encryption process has been completed, and the process ends. If the remaining data length is not 0, the counter value is encrypted (step S4).

カウンター値の暗号化処理における8ラウンドまでの計算は、x0を入力として図6の太線のデータパスを計算する。以下に手順を示す。

1.x0に中間データ500をXORする(XORした結果をt0とする)。
2.t0をF関数50で拡大鍵ek20と攪拌し、F関数50の出力データと中間データ501をXORする(XORした結果をt1とする)。
3.t0に中間データ502をXORする(XORした結果をt01とする)。
4.t1をF関数51で拡大鍵ek30と攪拌し、F関数51の出力データと中間データ503をXORする(XORした結果をt2とする)。
5.t01をF関数52で拡大鍵ek41と攪拌し、F関数52の出力データをt1にXORする(XORした結果をt11とする)。
6.t2をF関数53で拡大鍵ek40と攪拌し、F関数53の出力データと中間データ504をXORする(XORした結果をt3とする)。
7.t01に中間データ505をXORする(XORした結果をt02とする)。
8.t11をF関数54で拡大鍵ek51と攪拌し、F関数54の出力データをt2にXORする(XORした結果をt21とする)。
9.t3をF関数55で拡大鍵ek50と攪拌し、F関数55の出力データと中間データ506をXORする(XORした結果をt4とする)。
10.t02をF関数56で拡大鍵ek62と攪拌し、F関数56の出力データをt11にXORする(XORした結果をt12とする)。
11.t21をF関数57で拡大鍵ek61と攪拌し、F関数57の出力データをt3にXORする(XORした結果をt31とする)。
12.t4をF関数58で拡大鍵ek60と攪拌し、F関数58の出力データと中間データ507をXORする(XORした結果をt5とする)。
13.t02に中間データ508をXORする(XORした結果をt03とする)。
14.t12をF関数59で拡大鍵ek72と攪拌し、F関数59の出力データをt21にXORする(XORした結果をt22とする)。
15.t31をF関数60で拡大鍵ek71と攪拌し、F関数60の出力データをt4にXORする(XORした結果をt41とする)。
16.t5をF関数61で拡大鍵ek70と攪拌し、F関数61の出力データと中間データ509をXORする(XORした結果をt6とする)。
17.t03をF関数62で拡大鍵ek83と攪拌し、F関数62の出力データをt12にXORする(XORした結果をt13とする)。
18.t22をF関数63で拡大鍵ek82と攪拌し、F関数63の出力データをt31にXORする(XORした結果をt32とする)。
19.t41をF関数64で拡大鍵ek81と攪拌し、F関数64の出力データをt5にXORする(XORした結果をt51とする)。
20.t6をF関数65で拡大鍵ek80と攪拌し、F関数65の出力データと中間データ510をXORする(XORした結果をt7とする)。
In the counter value encryption process up to eight rounds, x0 is input and the thick data path in FIG. 6 is calculated. The procedure is shown below.

1. XOR the intermediate data 500 to x0 (the result of XOR is t0).
2. t0 is agitated with the expanded key ek 20 by the F function 50, and the output data of the F function 50 and the intermediate data 501 are XORed (the result of XOR is t1).
3. XOR the intermediate data 502 at t0 (the result of the XOR is t01).
4). The t1 is agitated with the expanded key ek 30 by the F function 51, and the output data of the F function 51 and the intermediate data 503 are XORed (the result of XOR is t2).
5. The t01 is agitated with the expanded key ek 41 by the F function 52, and the output data of the F function 52 is XORed to t1 (the result of XOR is assumed to be t11).
6). The t2 is agitated with the expanded key ek 40 by the F function 53, and the output data of the F function 53 and the intermediate data 504 are XORed (the result of XOR is t3).
7). XOR the intermediate data 505 at t01 (the result of XOR is t02).
8). t11 is agitated with the expanded key ek 51 by the F function 54, and the output data of the F function 54 is XORed to t2 (the result of XOR is assumed to be t21).
9. t3 is agitated with the expanded key ek 50 by the F function 55, and the output data of the F function 55 and the intermediate data 506 are XORed (the result of XOR is t4).
10. t02 is agitated with the expanded key ek 62 by the F function 56, and the output data of the F function 56 is XORed to t11 (the result of XOR is t12).
11. t21 is agitated with the expanded key ek 61 by the F function 57, and the output data of the F function 57 is XORed to t3 (the result of XOR is t31).
12 t4 is stirred with the expanded key ek 60 by the F function 58, and the output data of the F function 58 and the intermediate data 507 are XORed (the result of the XOR is t5).
13. XOR the intermediate data 508 at t02 (the result of XOR is t03).
14 t12 is agitated with the expanded key ek 72 by the F function 59, and the output data of the F function 59 is XORed to t21 (the result of XOR is assumed to be t22).
15. t31 is agitated with the expanded key ek 71 by the F function 60, and the output data of the F function 60 is XORed to t4 (the result of XOR is assumed to be t41).
16. t5 is agitated with the expanded key ek 70 by the F function 61, and the output data of the F function 61 and the intermediate data 509 are XORed (the result of XOR is t6).
17. The t03 is stirred with the expanded key ek 83 by the F function 62, and the output data of the F function 62 is XORed to t12 (the result of XOR is set to t13).
18. The t22 is stirred with the expanded key ek 82 by the F function 63, and the output data of the F function 63 is XORed to t31 (the result of XOR is set to t32).
19. t41 is agitated with the expanded key ek 81 by the F function 64, and the output data of the F function 64 is XORed to t5 (the result of XOR is assumed to be t51).
20. t6 is stirred with the expanded key ek 80 by the F function 65, and the output data of the F function 65 and the intermediate data 510 are XORed (the result of the XOR is t7).

以上の手順で計算したt03、t13、t22、t32、t41、t51、t6、t7が8ラウンドの出力データになるので、残りの(r−8)は拡大鍵を利用して全てのF関数計算を行う。   Since t03, t13, t22, t32, t41, t51, t6, and t7 calculated in the above procedure become output data of 8 rounds, the remaining (r-8) uses the expanded key to calculate all F functions. I do.

そして、残データ長がブロック長N以上であれば、データ攪拌部から出力されたNビットデータを平文にXORする。Nビット未満であれば、残っているデータ長分のみXORする。   If the remaining data length is greater than or equal to the block length N, the N-bit data output from the data agitation unit is XORed into plain text. If it is less than N bits, XOR is performed only for the remaining data length.

そして、残データを更新する(ステップS6)。残データ長がNビット以上であればNを減算し、Nビット未満であれば残データ長を0にする。   Then, the remaining data is updated (step S6). If the remaining data length is N bits or more, N is subtracted, and if it is less than N bits, the remaining data length is set to zero.

次に、カウンター値を更新する(ステップS7)。このとき、中間データに影響する桁上りは発生していなければステップS4へ戻る(ステップS8)。もし中間データに影響する桁上りが発生したならば、中間データの更新を行う(ステップS9)
本実施形態に係わる暗号化装置は図2に示した各部を専用IC等のハードウェアで構成している。ここで、2以上の構成部を集積化することもできる。しかし、図2に示す構成部をコンピュータを用いてソフトウェアで実現することもできる。
Next, the counter value is updated (step S7). At this time, if no carry affecting the intermediate data has occurred, the process returns to step S4 (step S8). If a carry affecting the intermediate data occurs, the intermediate data is updated (step S9).
In the encryption apparatus according to this embodiment, each unit shown in FIG. 2 is configured by hardware such as a dedicated IC. Here, two or more components can be integrated. However, the components shown in FIG. 2 can also be realized by software using a computer.

コンピュータをCPU、ハードディスク等のディスク装置(ROM等のメモリであってもよい)、RAM等のメモリ、液晶ディスプレイ等の表示部で構成し、情報出力部22、中間データ生成部23、拡大鍵生成部20、データ攪拌部21の動作をプログラムで記述し、このプログラムをハードディスク等のディスク装置に記憶し、演算に必要な情報(中間データ等)をRAM等のメモリに記憶し、CPUで当該プログラムを動作させることで、本実施形態の暗号化装置の機能をプログラムで実現することができる。当該プログラムは、DVD、CD−ROM、USBメモリ等のコンピュータ読み取り可能な記録媒体に記録し、ハードディスクにインストールすることで、コンピュータに読み込むことができる。   The computer comprises a CPU, a disk device such as a hard disk (may be a memory such as a ROM), a memory such as a RAM, a display unit such as a liquid crystal display, an information output unit 22, an intermediate data generation unit 23, and an expanded key generation The operations of the unit 20 and the data agitation unit 21 are described by a program, this program is stored in a disk device such as a hard disk, information (intermediate data, etc.) necessary for the operation is stored in a memory such as a RAM, and the CPU By operating the, the function of the encryption device of the present embodiment can be realized by a program. The program can be read into a computer by recording it on a computer-readable recording medium such as a DVD, CD-ROM, or USB memory and installing it on a hard disk.

上述した各実施形態は、本発明の好適な実施形態ではあるが、上記実施形態のみに本発明の範囲を限定するものではなく、本発明の要旨を逸脱しない範囲において種々の変更を施した形態での実施が可能である。そのため、前述した各実施形態は単なる例示にすぎず、限定的に解釈されるべきではない。本発明の範囲は特許請求の範囲によって示すものであって、明細書や要約書の記載には拘束されない。さらに、特許請求の範囲の均等範囲に属する変形や変更はすべて本発明の範囲内のものである。   Each of the above-described embodiments is a preferred embodiment of the present invention. However, the scope of the present invention is not limited only to the above-described embodiment, and various modifications are made without departing from the gist of the present invention. Implementation is possible. Therefore, each embodiment mentioned above is only an illustration, and should not be interpreted limitedly. The scope of the present invention is indicated by the claims, and is not restricted by the description or the abstract. Further, all modifications and changes belonging to the equivalent scope of the claims are within the scope of the present invention.

上記の実施形態の一部又は全部は、以下の付記のようにも記載されうるが、以下の構成には限られない。   A part or all of the above embodiment can be described as in the following supplementary notes, but is not limited to the following configuration.

(付記1)
暗号化鍵から拡大鍵を生成する拡大鍵生成手段と、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する情報出力手段と、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力する中間データ生成手段と、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力するデータ攪拌手段と、
を備えた暗号化装置。
(Appendix 1)
An expanded key generating means for generating an expanded key from the encryption key;
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; Information output means for outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
Intermediate data generating means for determining a range of intermediate data generated from the extended key and the first counter value based on the counter difference, and outputting the generated intermediate data;
Data agitation means for encrypting and outputting the output intermediate data using the expanded key;
An encryption device comprising:

(付記2)
付記1に記載の暗号化装置において、前記情報出力手段は、前記暗号化データのデータ長又は残データ長を保持する残データ長保持手段と、前記第1のカウンター値を保持する第1のカウンターと、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値を保持する第2のカウンターと、前記残データ長保持手段に保持された暗号化データのデータ長又は残データ長が所定のデータ長以上である場合に前記第1のカウンター値の更新を指示する制御手段と、前記制御手段の指示により前記第1のカウンター値を更新して前記第2のカウンターに前記第2のカウンター値として保持するカウンター更新手段と、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する差分計算手段とを有し、
前記残データ長保持手段は、前記暗号化データのデータ長を保持し、該データ長がブロック長以上である場合はブロック長を出力し、該データ長からブロック長を減算して、前記残データ長保持手段に前記残データ長として保持する暗号化装置。
(Appendix 2)
The encryption apparatus according to attachment 1, wherein the information output unit includes a remaining data length holding unit that holds a data length or a remaining data length of the encrypted data, and a first counter that holds the first counter value. A second counter that holds the second counter value that is the updated counter value or the same as the first counter value, and data of encrypted data held in the remaining data length holding means Control means for instructing update of the first counter value when the length or the remaining data length is equal to or greater than a predetermined data length; and updating the first counter value according to an instruction from the control means to Counter updating means for holding the counter as the second counter value, the first counter value, the updated counter value or the first counter value And a difference calculating means for outputting the counter difference between the second counter value Flip become,
The remaining data length holding means holds the data length of the encrypted data, and outputs the block length when the data length is equal to or greater than the block length, subtracts the block length from the data length, and An encryption apparatus that retains the remaining data length in a length retaining unit.

(付記3)
付記1又は2に記載の暗号化装置において、暗号化された前記中間データを平文データに排他的論理和する演算手段を、さらに有する暗号化装置。
(Appendix 3)
The encryption apparatus according to appendix 1 or 2, further comprising arithmetic means for performing an exclusive OR of the encrypted intermediate data with plaintext data.

(付記4)
暗号化鍵から拡大鍵を生成し、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力し、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力し、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力する、暗号化方法。
(Appendix 4)
Generate an extended key from the encryption key,
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; Outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
Based on the counter difference, determine a range of intermediate data to be generated from the extended key and the first counter value, and output the generated intermediate data,
An encryption method for encrypting and outputting the output intermediate data using the extended key.

(付記5)
付記4に記載の暗号化方法において、前記暗号化データのデータ長又は残データ長を残データ長保持手段に保持し、前記第1のカウンター値を第1のカウンターに保持し、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値を第2のカウンターに保持し、前記残データ長保持手段に保持された暗号化データのデータ長又は残データ長が所定のデータ長以上である場合に、前記第1のカウンター値を更新して前記第2のカウンターに前記第2のカウンター値として保持し、
前記残データ長保持手段は、前記暗号化データのデータ長を保持し、該データ長がブロック長以上である場合はブロック長を出力し、該データ長からブロック長を減算して、前記残データ長保持手段に前記残データ長として保持する暗号化方法。
(Appendix 5)
The encryption method according to appendix 4, wherein the data length or the remaining data length of the encrypted data is held in a remaining data length holding means, the first counter value is held in a first counter, and an updated counter The second counter value that is a value or the same as the first counter value is held in the second counter, and the data length or the remaining data length of the encrypted data held in the remaining data length holding means is When the data length is equal to or longer than a predetermined data length, the first counter value is updated and held in the second counter as the second counter value,
The remaining data length holding means holds the data length of the encrypted data, and outputs the block length when the data length is equal to or greater than the block length, subtracts the block length from the data length, and An encryption method for holding the remaining data length in the long holding means.

(付記6)
付記4又は5に記載の暗号化方法において、暗号化された前記中間データを平文データに排他的論理和する演算手段を、さらに有する暗号化方法。
(Appendix 6)
6. The encryption method according to appendix 4 or 5, further comprising arithmetic means for exclusive-ORing the encrypted intermediate data with plaintext data.

(付記7)
暗号化装置としてのコンピュータに、
暗号化鍵から拡大鍵を生成する機能と、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する機能と、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力する機能と、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力する機能とを、実行させるための暗号化プログラム。
(Appendix 7)
To a computer as an encryption device,
A function to generate an extended key from an encryption key;
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; A function of outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
A function of determining a range of intermediate data to be generated from the extended key and the first counter value based on the counter difference, and outputting the generated intermediate data;
An encryption program for executing the function of encrypting and outputting the output intermediate data using the extended key.

(付記8)
付記7に記載の暗号化プログラムにおいて、
前記コンピュータに、
前記暗号化データのデータ長又は残データ長を残データ長保持手段に保持し、前記第1のカウンター値を第1のカウンターに保持し、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値を第2のカウンターに保持し、前記残データ長保持手段に保持された暗号化データのデータ長又は残データ長が所定のデータ長以上である場合に、前記第1のカウンター値を更新して前記第2のカウンターに前記第2のカウンター値として保持する機能と、
前記残データ長保持手段に前記暗号化データのデータ長を保持させ、該データ長がブロック長以上である場合はブロック長を出力し、該データ長からブロック長を減算して、前記残データ長保持手段に前記残データ長として保持する機能とを、実行させるための暗号化プログラム。
(Appendix 8)
In the encryption program described in Appendix 7,
In the computer,
The data length or the remaining data length of the encrypted data is held in the remaining data length holding unit, the first counter value is held in the first counter, and is the updated counter value or the first counter value When the second counter value that is the same as the second counter value is held in the second counter, and the data length or the remaining data length of the encrypted data held in the remaining data length holding means is a predetermined data length or more, A function of updating the first counter value and holding it as the second counter value in the second counter;
The data length of the encrypted data is held in the remaining data length holding means, and when the data length is equal to or greater than the block length, the block length is output, the block length is subtracted from the data length, and the remaining data length An encryption program for causing a holding unit to execute a function of holding the remaining data length.

(付記9)
付記7又は8に記載の暗号化プログラムにおいて、暗号化された前記中間データを平文データに排他的論理和する演算機能を、前記コンピュータに実行させるための暗号化プログラム。
(Appendix 9)
The encryption program according to appendix 7 or 8, wherein the computer executes an arithmetic function for performing an exclusive OR operation on the encrypted intermediate data with plaintext data.

本発明は、音声通信端末やデータ通信装置などの通信データの秘匿や、ストレージ上の蓄積データの暗号化といった用途に適用できる。   The present invention can be applied to uses such as concealment of communication data such as a voice communication terminal and a data communication device, and encryption of data stored on a storage.

2 暗号化装置
3 F関数
4 排他的論理和
20 拡大鍵生成部
21 データ攪拌部
22 情報出力部
23 中間データ生成部
500〜522 中間データ
50〜69 F関数
DESCRIPTION OF SYMBOLS 2 Encryption apparatus 3 F function 4 Exclusive OR 20 Extended key production | generation part 21 Data stirring part 22 Information output part 23 Intermediate data generation part 500-522 Intermediate data 50-69 F function

Claims (9)

暗号化鍵から拡大鍵を生成する拡大鍵生成手段と、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する情報出力手段と、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力する中間データ生成手段と、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力するデータ攪拌手段と、
を備えた暗号化装置。
An expanded key generating means for generating an expanded key from the encryption key;
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; Information output means for outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
Intermediate data generating means for determining a range of intermediate data generated from the extended key and the first counter value based on the counter difference, and outputting the generated intermediate data;
Data agitation means for encrypting and outputting the output intermediate data using the expanded key;
An encryption device comprising:
請求項1に記載の暗号化装置において、前記情報出力手段は、前記暗号化データのデータ長又は残データ長を保持する残データ長保持手段と、前記第1のカウンター値を保持する第1のカウンターと、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値を保持する第2のカウンターと、前記残データ長保持手段に保持された暗号化データのデータ長又は残データ長が所定のデータ長以上である場合に前記第1のカウンター値の更新を指示する制御手段と、前記制御手段の指示により前記第1のカウンター値を更新して前記第2のカウンターに前記第2のカウンター値として保持するカウンター更新手段と、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する差分計算手段とを有し、
前記残データ長保持手段は、前記暗号化データのデータ長を保持し、該データ長がブロック長以上である場合はブロック長を出力し、該データ長からブロック長を減算して、前記残データ長保持手段に前記残データ長として保持する暗号化装置。
2. The encryption apparatus according to claim 1, wherein the information output unit includes a remaining data length holding unit that holds a data length or a remaining data length of the encrypted data, and a first counter value that holds the first counter value. A counter, a second counter that holds the second counter value that is the updated counter value or is the same as the first counter value, and the encrypted data held in the remaining data length holding means Control means for instructing update of the first counter value when the data length or the remaining data length is greater than or equal to a predetermined data length, and the second counter value is updated by instructing the control means to update the first counter value. Counter updating means for holding the second counter value as the second counter value, the first counter value and the updated counter value or the first counter value And a difference calculating means for outputting the counter difference between the second counter value is the same,
The remaining data length holding means holds the data length of the encrypted data, and outputs the block length when the data length is equal to or greater than the block length, subtracts the block length from the data length, and An encryption apparatus that retains the remaining data length in a length retaining unit.
請求項1又は2に記載の暗号化装置において、暗号化された前記中間データを平文データに排他的論理和する演算手段を、さらに有する暗号化装置。   3. The encryption apparatus according to claim 1 or 2, further comprising arithmetic means for exclusive ORing the encrypted intermediate data with plain text data. 暗号化鍵から拡大鍵を生成し、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力し、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力し、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力する、暗号化方法。
Generate an extended key from the encryption key,
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; Outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
Based on the counter difference, determine a range of intermediate data to be generated from the extended key and the first counter value, and output the generated intermediate data,
An encryption method for encrypting and outputting the output intermediate data using the extended key.
請求項4に記載の暗号化方法において、前記暗号化データのデータ長又は残データ長を残データ長保持手段に保持し、前記第1のカウンター値を第1のカウンターに保持し、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値を第2のカウンターに保持し、前記残データ長保持手段に保持された暗号化データのデータ長又は残データ長が所定のデータ長以上である場合に、前記第1のカウンター値を更新して前記第2のカウンターに前記第2のカウンター値として保持し、
前記残データ長保持手段は、前記暗号化データのデータ長を保持し、該データ長がブロック長以上である場合はブロック長を出力し、該データ長からブロック長を減算して、前記残データ長保持手段に前記残データ長として保持する暗号化方法。
5. The encryption method according to claim 4, wherein a data length or remaining data length of the encrypted data is held in a remaining data length holding unit, and the first counter value is held in a first counter and updated. The second counter value that is the counter value or the same as the first counter value is held in the second counter, and the data length or the remaining data length of the encrypted data held in the remaining data length holding means Is equal to or longer than a predetermined data length, the first counter value is updated and held in the second counter as the second counter value,
The remaining data length holding means holds the data length of the encrypted data, and outputs the block length when the data length is equal to or greater than the block length, subtracts the block length from the data length, and An encryption method for holding the remaining data length in the long holding means.
請求項4又は5に記載の暗号化方法において、暗号化された前記中間データを平文データに排他的論理和する演算手段を、さらに有する暗号化方法。   6. The encryption method according to claim 4 or 5, further comprising arithmetic means for exclusive ORing the encrypted intermediate data with plain text data. 暗号化装置としてのコンピュータに、
暗号化鍵から拡大鍵を生成する機能と、
暗号化データに基づく第1のカウンター値を保持し、前記暗号化データのデータ長が所定のデータ長以上である場合に前記第1のカウンター値を出力するとともに、前記第1のカウンター値の更新されたカウンター値を第2のカウンター値として保持し、前記暗号化データのデータ長が所定のデータ長未満である場合に前記第1のカウンター値と同じ値の第2のカウンター値を保持し、前記第1のカウンター値と、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値とのカウンター差分を出力する機能と、
前記カウンター差分に基づいて、前記拡大鍵と前記第1のカウンター値とから生成する中間データの範囲を決定し、生成された中間データを出力する機能と、
出力された前記中間データを、前記拡大鍵を用いて暗号化して出力する機能とを、実行させるための暗号化プログラム。
To a computer as an encryption device,
A function to generate an extended key from an encryption key;
A first counter value based on encrypted data is held, and when the data length of the encrypted data is greater than or equal to a predetermined data length, the first counter value is output and the first counter value is updated Holding the counter value as a second counter value, and holding a second counter value that is the same value as the first counter value when the data length of the encrypted data is less than a predetermined data length; A function of outputting a counter difference between the first counter value and the second counter value that is an updated counter value or the same as the first counter value;
A function of determining a range of intermediate data to be generated from the extended key and the first counter value based on the counter difference, and outputting the generated intermediate data;
An encryption program for executing the function of encrypting and outputting the output intermediate data using the extended key.
請求項7に記載の暗号化プログラムにおいて、
前記コンピュータに、
前記暗号化データのデータ長又は残データ長を残データ長保持手段に保持し、前記第1のカウンター値を第1のカウンターに保持し、更新されたカウンター値である又は前記第1のカウンター値と同じとなる前記第2のカウンター値を第2のカウンターに保持し、前記残データ長保持手段に保持された暗号化データのデータ長又は残データ長が所定のデータ長以上である場合に、前記第1のカウンター値を更新して前記第2のカウンターに前記第2のカウンター値として保持する機能と、
前記残データ長保持手段に前記暗号化データのデータ長を保持させ、該データ長がブロック長以上である場合はブロック長を出力し、該データ長からブロック長を減算して、前記残データ長保持手段に前記残データ長として保持する機能とを、実行させるための暗号化プログラム。
In the encryption program according to claim 7,
In the computer,
The data length or the remaining data length of the encrypted data is held in the remaining data length holding unit, the first counter value is held in the first counter, and is the updated counter value or the first counter value When the second counter value that is the same as the second counter value is held in the second counter, and the data length or the remaining data length of the encrypted data held in the remaining data length holding means is a predetermined data length or more, A function of updating the first counter value and holding it as the second counter value in the second counter;
The data length of the encrypted data is held in the remaining data length holding means, and when the data length is equal to or greater than the block length, the block length is output, the block length is subtracted from the data length, and the remaining data length An encryption program for causing a holding unit to execute a function of holding the remaining data length.
請求項7又は8に記載の暗号化プログラムにおいて、暗号化された前記中間データを平文データに排他的論理和する演算機能を、前記コンピュータに実行させるための暗号化プログラム。   9. The encryption program according to claim 7 or 8, wherein the computer is caused to execute a calculation function for exclusive ORing the encrypted intermediate data with plain text data.
JP2012030604A 2012-02-15 2012-02-15 Encryption device, encryption method, and encryption program Pending JP2013167740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012030604A JP2013167740A (en) 2012-02-15 2012-02-15 Encryption device, encryption method, and encryption program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012030604A JP2013167740A (en) 2012-02-15 2012-02-15 Encryption device, encryption method, and encryption program

Publications (1)

Publication Number Publication Date
JP2013167740A true JP2013167740A (en) 2013-08-29

Family

ID=49178182

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012030604A Pending JP2013167740A (en) 2012-02-15 2012-02-15 Encryption device, encryption method, and encryption program

Country Status (1)

Country Link
JP (1) JP2013167740A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11886624B2 (en) 2020-12-28 2024-01-30 Samsung Electronics Co., Ltd. Crypto device, integrated circuit and computing device having the same, and writing method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11886624B2 (en) 2020-12-28 2024-01-30 Samsung Electronics Co., Ltd. Crypto device, integrated circuit and computing device having the same, and writing method thereof

Similar Documents

Publication Publication Date Title
JP4905000B2 (en) Cryptographic processing apparatus, cryptographic processing method, and computer program
US8724804B2 (en) Encryption processing apparatus
JP4783104B2 (en) Encryption / decryption device
US9515818B2 (en) Multi-block cryptographic operation
JP5268609B2 (en) Cryptographic processing apparatus and calculation method
US9565018B2 (en) Protecting cryptographic operations using conjugacy class functions
US20160191238A1 (en) Sms4 acceleration hardware
US11349668B2 (en) Encryption device and decryption device
JPWO2008010441A1 (en) Cryptographic apparatus, program and method
JP2007316614A (en) Hash value generating device, program, and hash value generating method
US7024560B2 (en) Power-residue calculating unit using Montgomery algorithm
JP5273141B2 (en) Block cipher with adjustment value, cipher generation method and recording medium
JPWO2013065241A1 (en) Incremental MAC tag generation device, method and program, and message authentication device
US8995666B2 (en) Key scheduling device and key scheduling method
US9515830B2 (en) Universal hash function computing device, method and program
JPWO2019043921A1 (en) Encryption device, decryption device, encryption method, decryption method, encryption program, and decryption program
JP2005100085A (en) Arithmetic unit and encryption/decoding arithmetic unit
JP2011123356A (en) Prime number generating device, prime number generating method, and prime number generating program
JP2014240921A (en) Encryption device, encryption processing method and encryption processing program
JP2013167740A (en) Encryption device, encryption method, and encryption program
JP4857230B2 (en) Pseudorandom number generator and encryption processing device using the same
JP2018092010A (en) Encryption device and encryption method, encryption program, key generation device, key generation method, and key generation program
JP2010245753A (en) Encryption operation circuit device
JP4363273B2 (en) Random number generator
WO2017036251A1 (en) Advanced encryption standard encryption and decryption method, device, and storage medium