JP2014115579A - Encryption processing device and method, and encryption processing program - Google Patents

Encryption processing device and method, and encryption processing program Download PDF

Info

Publication number
JP2014115579A
JP2014115579A JP2012271543A JP2012271543A JP2014115579A JP 2014115579 A JP2014115579 A JP 2014115579A JP 2012271543 A JP2012271543 A JP 2012271543A JP 2012271543 A JP2012271543 A JP 2012271543A JP 2014115579 A JP2014115579 A JP 2014115579A
Authority
JP
Japan
Prior art keywords
random number
bit
bits
value
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012271543A
Other languages
Japanese (ja)
Other versions
JP6089664B2 (en
Inventor
Tomoyasu Suzaki
智保 洲崎
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 JP2012271543A priority Critical patent/JP6089664B2/en
Publication of JP2014115579A publication Critical patent/JP2014115579A/en
Application granted granted Critical
Publication of JP6089664B2 publication Critical patent/JP6089664B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To improve resistance to side channel attacks or the like by suppressing increase in operation time and operation costs of encryption.SOLUTION: An encryption processing device comprises: table generation means for setting a value to which a random number of a second bit number generated in random number generation means is connected, to a value of a first bit number related to encryption processing, for each element of a table which outputs a value of a reference element; random number connection means for generating a value obtained by connecting plaintext data of a first bit number to a random number of a second bit number generated in the random number generation means; pointer update means for updating a pointer indicating a reference address of the table; encryption means for performing encryption processing including processing for referring the table at an address computed by defining a connection value of data of the first bit number and the random number of the second bit number as an index, with the updated pointer as the standard; and random number deletion means for deleting a random number from output of the encryption means.

Description

本発明は、暗号処理装置と方法並びに暗号処理プログラムに関する。   The present invention relates to a cryptographic processing apparatus and method, and a cryptographic processing program.

記録媒体に蓄積されたデータや通信路上を流れるデータを盗聴などの脅威から保護するための技術として暗号化がある。暗号化されたデータは、暗号化に用いた鍵を知るもののみが正しく復号することができる。
代表的な暗号アルゴリズムとして、例えばSPN(substitution permutation network)構造のブロック暗号(block cipher)方式のAES(Advanced Encryption Standard)がある。AESは、代表的な暗号解読法(例えば、差分解読法(Differential cryptanalysis)や線形解読法(Linear cryptanalysis))に対して安全である。秘密鍵の全数探索(brute force attack)よりも効率的に鍵を求める方法は知られていない。そして、秘密鍵の全数探索には膨大な時間を要することから、AESは安全である。
Encryption is a technique for protecting data stored in a recording medium and data flowing on a communication path from threats such as eavesdropping. Only the data that knows the key used for encryption can be decrypted correctly.
As a typical encryption algorithm, for example, there is an AES (Advanced Encryption Standard) of a block cipher scheme having an SPN (substitution permutation network) structure. AES is secure against typical cryptanalysis methods (eg, differential cryptanalysis and linear cryptanalysis). There is no known method for obtaining a key more efficiently than a brute force attack of a secret key. AES is safe because it takes an enormous amount of time to search for all secret keys.

近年、暗号が実装された機器(暗号モジュール)において、暗号化機能が動作する際に暗号モジュールが消費する電力や、それに伴う電磁波を利用して暗号化鍵を搾取する攻撃法の脅威が指摘されている。これら副次的に得られる消費電力や電磁波に関する情報を「サイドチャネル情報」、それらを利用した攻撃は「サイドチャネル攻撃」と呼ばれる。   In recent years, in devices (encryption modules) that implement encryption, the threat of attack methods that exploit the power consumed by the encryption module when the encryption function operates and the accompanying electromagnetic waves using the electromagnetic waves associated therewith have been pointed out. ing. Information on power consumption and electromagnetic waves obtained as a side effect is called “side channel information”, and an attack using the information is called “side channel attack”.

サイドチャネル攻撃の原理を説明する。   Explain the principle of side-channel attacks.

nビットデータdのハミングウェイトh(d)は、
h(d)∈{0,1,2,... ,n}
である。ハミングウェイトとは、データを2進数表現したときの1の数である。例えば、n=8の場合、
h(00000000) = 0、
h(00001000) = 1、
h(00100011) = 3、
h(11111111) = 8
となる。
The Hamming weight h (d) of the n-bit data d is
h (d) ∈ {0,1,2, ..., n}
It is. The Hamming weight is a number of 1 when data is expressed in binary. For example, if n = 8,
h (00000000) = 0,
h (00001000) = 1,
h (00100011) = 3,
h (11111111) = 8
It becomes.

解析対象の暗号モジュールがハミングウェイトモデルに基づくならば、データのハミングウェイトと消費電力、漏洩電磁波は正比例すると仮定する。ハミングウェイトモデルに基づく、暗号アルゴリズムの解析手順(関連技術)について以下に説明する。図1は、ブロック長が2nビットのrラウンドFeistel型暗号(関連技術)を説明する図である。   If the cryptographic module to be analyzed is based on the Hamming weight model, it is assumed that the Hamming weight of data, power consumption, and leakage electromagnetic waves are directly proportional. An analysis procedure (related technology) of the cryptographic algorithm based on the Hamming weight model will be described below. FIG. 1 is a diagram for explaining r-round Feistel encryption (related technology) having a block length of 2n bits.

2nビットの平文Pはnビットのデータx 、x に分割される。第iラウンド(i=1,2,...,r-1)の処理は式(1)及び式(2)のとおりである。 The 2n-bit plaintext P is divided into n-bit data x 0 L and x 0 R. The processing of the i-th round (i = 1, 2,..., R−1) is as shown in equations (1) and (2).

=xi−1 ・・・(1) x i R = x i−1 L (1)

Figure 2014115579
Figure 2014115579

なお、

Figure 2014115579
はビット毎の排他的論理和(bitwise XOR)の演算子である。 In addition,
Figure 2014115579
Is a bitwise XOR operator.

最終のラウンド(第rラウンド)ではデータの左右のクロスを行わない。x 、x Rは式(3)及び式(4)のとおりである。 In the final round (r-th round), right and left crossing of data is not performed. x r L and x r R are as shown in the equations (3) and (4).

=xr−1 ・・・(3) x r L = x r-1 L ··· (3)

Figure 2014115579
Figure 2014115579

とx を連結した2nビットデータx ||x が暗号文Cとなる。なお、||は連結(concatenation)演算子である。 x r L and x r R was ligated 2n-bit data x r L || x r R is the ciphertext C. Note that || is a concatenation operator.

図2は、図1のF関数10の構成例(関連技術)を例示した図である。図2を参照すると、データx と鍵Kを排他的論理和演算した結果を、非線形処理11で演算Sを施し、出力データzが生成される。つまり、
=S(x ^K) ・・・(5)
である。なお、^はC言語等で用いられる、ビット毎の排他的論理和(bitwise XOR)の演算子である(以下、排他的論理和演算子として^を用いる)。
FIG. 2 is a diagram illustrating a configuration example (related technology) of the F function 10 of FIG. Referring to FIG. 2, the result of performing an exclusive OR operation on data x i L and key K i is subjected to operation S in nonlinear processing 11 to generate output data z i . That means
z i = S (x i L ^ K i ) (5)
It is. Note that ^ is a bitwise XOR operator used in C language or the like (hereinafter, ^ is used as an exclusive OR operator).

次に、サイドチャネル情報を用いて最終ラウンドの鍵Kr−1を求める手順を示す。解析はデータ収集フェーズと解析フェーズから成る。 Next, a procedure for obtaining the final round key K r-1 using the side channel information will be described. Analysis consists of a data collection phase and an analysis phase.

データ収集フェーズでは、m個の平文P(j=0, 1, ..., m-1)を暗号化し、m個の暗号文Cを得る。このとき、オシロスコープやスペクトラムアナライザ等などの測定器(波形解析装置)を用いて暗号化処理中の消費電力を測定する。ここで、平文Pを暗号化するときに測定した電力波形をwとする。 In the data collection phase, m plaintexts P j (j = 0, 1,..., M−1) are encrypted to obtain m ciphertexts C j . At this time, power consumption during encryption processing is measured using a measuring instrument (waveform analyzer) such as an oscilloscope or a spectrum analyzer. Here, the power waveform measured when encrypting the plaintext P j is defined as w j .

解析フェーズとして差分電力解析(Differential Power Analysis:DPA)を例に説明する。   A differential power analysis (DPA) will be described as an example of the analysis phase.

鍵Kr−1の候補は2通りあるので、nビットが全て0から順に仮定していく。 Since there are 2 n candidates for the key K r−1 , all n bits are assumed in order from 0.

r−1 (=x )は暗号文Cより既知であるから、鍵Kr−1を仮定することによりF関数の出力データzを計算することができる。 Since x r−1 L (= x r L ) is known from the ciphertext C j , the output data z i of the F function can be calculated by assuming the key K r−1 .

ここで、zの特定の1ビットに注目し、当該ビットが0になった暗号文に対応する波形データと、当該ビットが1になった暗号文に対応する波形データとに分類する。当該ビットの値が0として分類された波形の集合をW、当該ビットの値が1として分類された波形の集合をWとする。 Here, paying attention to a specific bit of z i , it is classified into waveform data corresponding to a ciphertext in which the bit is 0 and waveform data corresponding to a ciphertext in which the bit is 1. A set of waveforms in which the value of the bit is classified as 0 is defined as W 0 , and a set of waveforms in which the value of the bit is classified as 1 is defined as W 1 .

次にWとWのそれぞれについて消費電力値の平均W0avg、W1avgを計算する。 Next, the average power consumption values W 0avg and W 1avg are calculated for each of W 0 and W 1 .

ハミングウェイトモデルに基づくならば、zの計算が実行された時刻のWよりもWの消費電力が大きくなる(残りのn−1ビットはノイズ成分となるが、多数の波形の平均をとることで平準化されると考える)。このため、zの特定の1ビットが0、1となった暗号文の波形集合への分類が正しく行われていれば、W1avgからW0avgを引くと顕著に差が現れる(図9(B)参照)。 Based on the Hamming weight model, the power consumption of W 1 becomes larger than W 0 at the time when the calculation of z i is performed (the remaining n−1 bits are noise components, but the average of many waveforms is calculated). I think it will be leveled. Therefore, if the classification of the waveforms set of ciphertext particular 1 bit of the z i becomes 0 and 1 if correctly performed, is significantly different Subtracting W 0Avg from W 1Avg appears (Fig. 9 ( B)).

しかし、鍵Kr−1の仮定が誤っている場合、正しく分類されない(W(W)にはビット値が1(0)となる波形が混在する)。このため、W0avgとW1avgの間に差が見られなくなる(図9(A)参照)。 However, when the assumption of the key K r-1 is incorrect, the key K r-1 is not correctly classified (W 0 (W 1 ) includes a waveform having a bit value of 1 (0)). For this reason, there is no difference between W 0avg and W 1avg (see FIG. 9A).

よって、平均波形のピーク値を調べることにより、鍵の仮定が正しいか否かを区別することができる。   Therefore, by examining the peak value of the average waveform, it is possible to distinguish whether the key assumption is correct.

一方、サイドチャネル攻撃に対する耐タンパ(tamper resistant)技術の一つとしてマスキング手法が挙げられる。図1の暗号化処理にマスキング手法を施した場合の動作の参考例を、図3を用いて説明する。なお、この参考例では、ソフトウェアで実装された暗号化処理を前提とする。   On the other hand, a masking technique is one of tamper resistant techniques against side channel attacks. A reference example of the operation when the masking technique is applied to the encryption processing of FIG. 1 will be described with reference to FIG. This reference example is premised on encryption processing implemented by software.

図3において、α、α、αは、それぞれnビットの乱数データであり、
α=α^α ・・・(6)
である。
In FIG. 3, α 1 , α 2 , and α 3 are n-bit random number data,
α 3 = α 1 ^ α 2 (6)
It is.

そして、図2の非線形処理11の代わりに、非線形処理30を用いる。図3(B)に示すように、非線形処理30では、入力データとαとの排他的論理和演算結果に対して非線形処理11を行う。そして、非線形処理11の出力データとαとの排他的論理和演算結果を非線形処理30の出力データとする。 Then, a nonlinear process 30 is used instead of the nonlinear process 11 of FIG. As shown in FIG. 3 (B), the nonlinear processing 30 performs the nonlinear processing 11 with respect to exclusive-OR of the input data and alpha 1. Then, the exclusive OR operation result of the output data of the nonlinear process 11 and α 3 is used as the output data of the nonlinear process 30.

一般に、ソフトウェアによる実装の場合、非線形処理は例えば表(ルックアップテーブル)で実装される。非線形処理の入力データをnビットとすると、表は、2個のエントリを持つ。入力データが表のインデックスとなり、表の各エントリに、入力データに対する演算結果を保持する。非線形処理時には、1回の表参照で演算結果(非線形処理結果)を得ることができる。 In general, in the case of implementation by software, nonlinear processing is implemented by a table (lookup table), for example. If the input data for nonlinear processing is n bits, the table has 2 n entries. The input data becomes an index of the table, and the operation result for the input data is held in each entry of the table. At the time of non-linear processing, a calculation result (non-linear processing result) can be obtained by referring to the table once.

マスキング手法では、α、αを決定するごとに、表Sを基に、新たな表S’を生成する。 In the masking method, each time α 1 and α 2 are determined, a new table S ′ is generated based on the table S.

暗号化処理を行う場合、まず分割された平文x 、x に対してそれぞれα、αとの排他的論理和をとる。 When performing the encryption process, first, the divided plaintexts x 0 L and x 0 R are exclusively ORed with α 1 and α 2 , respectively.

そして、x とαとの排他的論理和(x ^α)に対して鍵Kとの排他的論理和をとり、非線形処理30に入力する。非線形処理30の入力データは、
((x ^α)^K)=(x ^α^K) ・・・(7)
である。
Then, an exclusive OR with the key K 0 is taken with respect to the exclusive OR (x 0 L ^ α 1 ) between x 0 L and α 1 and input to the nonlinear processing 30. The input data of the nonlinear process 30 is
((X 0 L ^ α 1 ) ^ K 0 ) = (x 0 L ^ α 1 ^ K 0 ) (7)
It is.

図3(A)において、非線形処理30では、入力データとαとの排他的論理和をとるため、αがキャンセルされ、非線形処理11に入力されるデータは、等価的に、
(x ^K) ・・・(8)
となる。
In FIG. 3A, in the non-linear process 30, since the exclusive OR of the input data and α 1 is taken, α 1 is canceled and the data input to the non-linear process 11 is equivalently:
(X 0 L ^ K 0 ) (8)
It becomes.

図3(A)において、非線形処理30の出力データzは、図3(B)において、非線形処理11の出力S(x ^K)に対してαとの排他的論理和をとったものである。
=(S(x ^K)^α) ・・・(9)
3A, the output data z 0 of the non-linear process 30 is obtained by performing an exclusive OR with α 3 on the output S (x 0 L ^ K 0 ) of the non-linear process 11 in FIG. 3B. It is what I took.
z 0 = (S (x 0 L ^ K 0 ) ^ α 3 ) (9)

図3(A)において、排他的論理和31では、
^(x ^α) ・・・(10)
が行われる。このため、αとαの排他的論理和によりαが生成される。すなわち、
(S(x ^K)^α)^(x ^α
=S(x ^K)^(α^α)^(x ^α
=S(x ^K)^α^α^α^x
=S(x ^K)^α^x ・・・(11)
In FIG. 3A, in the exclusive OR 31,
z 0 ^ (x 0 R ^ α 2 ) (10)
Is done. Therefore, α 1 is generated by exclusive OR of α 3 and α 2 . That is,
(S (x 0 L ^ K 0 ) ^ α 3 ) ^ (x 0 R ^ α 2 )
= S (x 0 L ^ K 0 ) ^ (α 1 ^ α 2 ) ^ (x 0 R ^ α 2 )
= S (x 0 L ^ K 0 ) ^ α 1 ^ α 2 ^ α 2 ^ x 0 R
= S (x 0 L ^ K 0 ) ^ α 1 ^ x 0 R (11)

式(11)のS(x ^K)^x は、図1のx に対応するため、式(11)は、
^α
と表される。
Since S (x 0 L ^ K 0 ) ^ x 0 R in equation (11) corresponds to x 1 L in FIG.
x 1 L ^ α 1
It is expressed.

よって、第1ラウンドの出力データx は、αでマスクされた状態で生成される。 Therefore, the output data x 1 L of the first round is generated in a state masked with α 1 .

一方、
=x ^α^α=x ^α ・・・(12)
である。
on the other hand,
x 1 R = x 0 L ^ α 1 ^ α 3 = x 0 L ^ α 2 (12)
It is.

式(12)のx は、図1のx Rに対応するため、式(12)は、
R^α
と表される。
Since x 0 L in equation (12) corresponds to x 1 R in FIG. 1, equation (12) becomes
x 1 R ^ α 2
It is expressed.

このように、第(i+1)ラウンドの入力データ
はαでマスクされ、
はαでマスクされた状態となる。
Thus, the input data x i L of the (i + 1) -th round is masked with α 1 ,
x i R is masked with α 2 .

最終ラウンドでのデータx 、x は、それぞれ、
r−1 ^α ・・・(13)
S(xr−1 ^Kr−1)^α^xr−1 ・・・(14)
となり、いずれもαでマスクされる。
The data x r L and x r R in the final round are respectively
x r-1 L ^ α 1 (13)
S (x r-1 L ^ K r-1) ^ α 1 ^ x r-1 R ··· (14)
And both are masked with α 1 .

このため、(13)、(14)のそれぞれにαと排他的論理和をとることで、x 、x は、式(15)、(16)となる。 For this reason, by taking an exclusive OR with α 1 in each of (13) and (14), x r L and x r R become equations (15) and (16).

=(xr−1 ^α)^α=xr−1 ・・・(15)
=(S(xr−1 ^Kr−1)^α^xr−1 )^α
=(S(xr−1 ^Kr−1)^xr−1 ) ・・・(16)
x r L = (x r- 1 L ^ α 1) ^ α 1 = x r-1 L ··· (15)
x r R = (S (x r-1 L ^ K r-1) ^ α 1 ^ x r-1 R) ^ α 1
= (S ( xr- 1L ^ Kr-1 ) ^ xr- 1R ) (16)

、x のいずれもマスクが解除され、暗号文C(=xr−1 ||x )が得られる。 x r L, none of x r R mask is released, the ciphertext C (= x r-1 L || x r R) is obtained.

このように、マスキング手法では、常に、乱数でマスクされているため、差分電力解析を適用しても、電力波形は乱数でマスクされたものになる。よって、乱数値が不明であれば、鍵仮定を行って計算した中間値と、実際の消費電力の相関が崩れるため、差分電力解析が困難になる。しかしながら、乱数値も同時に仮定すれば、差分電力解析による解析は可能となることから、乱数値を暗号化処理毎に変化させる必要がある。   Thus, in the masking method, since it is always masked with a random number, even if the differential power analysis is applied, the power waveform is masked with a random number. Therefore, if the random value is unknown, the correlation between the intermediate value calculated using the key assumption and the actual power consumption is lost, so that the differential power analysis becomes difficult. However, if the random value is also assumed at the same time, the analysis by the differential power analysis becomes possible, and therefore it is necessary to change the random value for each encryption process.

なお、本件に関連して出願人が行った先行技術文献検索でサーチされた特許文献1には、暗号処理を実行する際の電力消費量を計測することで、暗号モジュールに埋め込まれている暗号鍵を解析する攻撃方法に対して安全な暗号化装置として前記鍵によって予め定められた処理がされた入力データに対して、乱数に依存して決まる予め定められた入力マスク値が加算されたランダム化入力データと前記入力マスク値とを受け付けて、前記入力マスク値の逆元である出力マスク値が、前記入力データの逆元に対して加算されたランダム化出力データを生成するランダム化8ビット逆元計算部を備えており、生成された当該ランダム化出力データから暗号文を生成する構成が開示されている。また差分電力解析(DPA)に対して安全な暗号化装置として特許文献2には暗号化装置は、乱数を発生する乱数発生器手段と、乱数に従ってq個の固定値の中の1つを選択する第1の選択器と、乱数に従ってq組の固定テーブルの中の1組を選択する選択器と、を備え、排他的論理和手段は、固定値と鍵の排他的論理和と入力の排他的論理和をとり、非線形変換手段は、1組の固定テーブルに従って非線形変換を行う構成が開示されている。特許文献3には、DPAまたはEMA(Electro-Magnetic Analysis)タイプの攻撃に対抗するための暗号回路として特許文献3には、暗号アルゴリズムを実行するための関数鍵kcを含む暗号回路であって、前記回路はkcとは別の前記回路のそれぞれの例に特有の、回路のサイドチャネルを利用した攻撃から回路を保護することを可能とする第2の鍵kiを含む構成が開示されている。   In Patent Document 1 searched by prior art document search performed by the applicant in connection with the present case, the power consumption at the time of executing the cryptographic process is measured, so that the encryption embedded in the cryptographic module is performed. Randomly obtained by adding a predetermined input mask value determined depending on a random number to input data subjected to predetermined processing by the key as an encryption device that is secure against an attack method for analyzing the key Randomized 8 bits for receiving randomized input data and the input mask value, and generating randomized output data in which an output mask value which is an inverse element of the input mask value is added to an inverse element of the input data A configuration that includes an inverse element calculation unit and generates ciphertext from the generated randomized output data is disclosed. Further, in Patent Document 2 as an encryption device that is safe for differential power analysis (DPA), the encryption device selects a random number generator means for generating a random number and one of q fixed values according to the random number. And a selector that selects one set in q fixed tables according to a random number, and the exclusive OR means excludes a fixed value, a key exclusive OR, and an input. A configuration is disclosed in which non-linear conversion means performs non-linear conversion according to a set of fixed tables. Patent Document 3 discloses an encryption circuit including a function key kc for executing an encryption algorithm as an encryption circuit for countering a DPA or EMA (Electro-Magnetic Analysis) type attack, A configuration is disclosed that includes a second key ki that allows the circuit to be protected from attacks using the side channel of the circuit, which is unique to each example of the circuit apart from kc.

特再公表WO2008−146482号公報Special republication WO2008-146482 特開2002−366029号公報JP 2002-366029 A 特表2002−516094号公報JP-T-2002-516094

以下に関連技術の分析を与える。   The analysis of related technology is given below.

上記したように、ソフトウェア実装された暗号モジュールをサイドチャネル攻撃の脅威から保護するためには、マスキング手法が有効である。しかしながら、マスクに用いる乱数値を暗号化処理毎に変更しなければならない。乱数値を変更すると、非線形処理結果を保持している表を乱数に応じて生成する必要がある。この表の生成時間が、暗号化処理時間の増加原因となり、パフォーマンスの低下に繋がる。   As described above, the masking technique is effective for protecting the software-implemented cryptographic module from the threat of side channel attacks. However, the random value used for the mask must be changed for each encryption process. When the random value is changed, it is necessary to generate a table holding the nonlinear processing result according to the random number. The generation time of this table causes an increase in the encryption processing time, leading to a decrease in performance.

なお、単一の表を用いる暗号アルゴリズムであっても、表参照毎に、マスク値が変わる場合、マスク値毎に、表を持つ必要がある。このため、メモリ領域が増加する。   Even in the case of an encryption algorithm using a single table, if the mask value changes for each table reference, it is necessary to have a table for each mask value. For this reason, the memory area increases.

本発明は、上記課題を解決するために創案されたものであって、その目的は、暗号化処理の演算時間、演算コストの増大を抑制し、且つサイドチャネル攻撃等に対する耐性を向上させる装置、方法、プログラムを提供することにある。   The present invention was devised to solve the above problems, and its purpose is to suppress an increase in computation time and computation cost of encryption processing and improve resistance to side channel attacks and the like, It is to provide a method and a program.

本発明によれば、参照される要素の値を出力する表の各要素に、共通鍵暗号方式の暗号化処理に関わる第1のビット数の値に、乱数生成手段で生成された第2のビット数の乱数を連結した値を設定する表生成手段と、
第2のビット数の乱数を生成する前記乱数生成手段と、
第1のビット数の平文データに、前記乱数生成手段で生成された第2のビット数の乱数を連結した値を生成する乱数連結手段と、
前記表の基準アドレスを指すポインタを更新するポインタ更新手段と、
前記更新されたポインタを基準とし、前記第1のビット数のデータと第2のビット数の乱数との連結値から計算されるアドレスにて前記表を参照する処理を含む暗号化処理を行う暗号化手段と、
前記暗号化手段の出力から乱数を除去する乱数削除手段と、
を備える暗号処理装置が提供される。
According to the present invention, in each element of the table that outputs the value of the element to be referred to, the second bit number generated by the random number generation means is set to the first bit number value related to the encryption process of the common key cryptosystem. A table generating means for setting a value obtained by concatenating random numbers of bits;
The random number generating means for generating a random number of a second number of bits;
Random number concatenating means for generating a value obtained by concatenating a first bit number of plaintext data with a second bit number random number generated by the random number generating means;
Pointer updating means for updating a pointer pointing to the reference address of the table;
A cipher that performs an encryption process including a process of referring to the table at an address calculated from a concatenated value of the data of the first bit number and the random number of the second bit number with the updated pointer as a reference And
Random number deletion means for removing random numbers from the output of the encryption means;
A cryptographic processing device is provided.

本発明によれば、参照される要素の値を出力する表を記憶する記憶装置を備えたデータ処理装置による暗号処理方法であって、
表作成処理では、前記表の各要素に、共通鍵暗号方式の暗号化処理に関わる第1のビット数の値に、乱数生成処理で生成された第2のビット数の前記乱数を連結した値を設定し、
乱数連結処理では、第1のビット数の平文データに、前記乱数生成処理で生成された第2のビット数の乱数を連結した値を生成し、
ポインタ更新処理では、前記表の基準アドレスを指すポインタを更新し、
暗号化処理では、前記更新されたポインタを基準とし、第1のビット数のデータと第2のビット数の乱数との連結値から求まるアドレスで前記表を参照する処理を含む暗号化処理を行い、
乱数削除処理では、前記暗号化処理の出力から乱数を除去する、暗号処理方法が提供される。
According to the present invention, there is provided an encryption processing method by a data processing device including a storage device that stores a table that outputs values of elements to be referenced,
In the table creation process, each element of the table is a value obtained by concatenating the first bit number value related to the encryption process of the common key cryptosystem to the random number of the second bit number generated in the random number generation process. Set
In the random number concatenation process, a value obtained by concatenating the plaintext data of the first number of bits with the random number of the second number of bits generated in the random number generation process is generated.
In the pointer update process, the pointer pointing to the reference address in the table is updated,
In the encryption process, an encryption process including a process of referring to the table with an address obtained from a concatenated value of the first bit number data and the second bit number random number is performed using the updated pointer as a reference. ,
In the random number deletion processing, a cryptographic processing method is provided that removes random numbers from the output of the encryption processing.

本発明によれば、参照される要素の値を出力する表を記憶する記憶装置を備えたコンピュータに、
前記表の各要素に、共通鍵暗号方式の暗号化処理に関わる第1のビット数の値に、乱数生成処理で生成された第2のビット数の前記乱数を連結した値を設定する表生成処理と、
前記第2のビット数の前記乱数を生成する前記乱数生成処理と、
第1のビット数の平文データに、前記乱数生成処理で生成された第2のビット数の乱数を連結した値を生成する乱数連結処理と、
前記表の基準アドレスを指すポインタを更新するポインタ更新処理と、
前記更新されたポインタを基準とし、第1のビット数のデータと第2のビット数の乱数との連結値から求まるアドレスで前記表を参照する処理を含む暗号化処理を行う暗号化処理と、
前記暗号化処理の出力から乱数を除去する乱数削除処理と、
を実行させるプログラムが提供される。本発明によれば、該プログラムを記録した記録媒体(半導体メモリ、あるいは磁気/光ディスク等)が提供される。
According to the present invention, a computer provided with a storage device that stores a table for outputting values of elements to be referenced is provided.
Table generation in which each element of the table is set to a value obtained by concatenating the random number of the second bit number generated in the random number generation process to the value of the first bit number related to the encryption process of the common key cryptosystem Processing,
The random number generation processing for generating the random number of the second number of bits;
A random number concatenation process for generating a value obtained by concatenating the random number of the second bit number generated in the random number generation process to the plain text data of the first bit number;
A pointer update process for updating a pointer to the reference address of the table;
An encryption process for performing an encryption process including a process of referring to the table with an address obtained from a concatenated value of data of a first bit number and a random number of a second bit number with reference to the updated pointer;
Random number deletion processing for removing random numbers from the output of the encryption processing;
A program for executing is provided. According to the present invention, a recording medium (semiconductor memory, magnetic / optical disk or the like) on which the program is recorded is provided.

本発明によれば、暗号化の演算時間、演算コストの増大を抑制し、サイドチャネル攻撃等に対する耐性を向上させることができる。   According to the present invention, it is possible to suppress an increase in computation time and computation cost of encryption, and to improve resistance to side channel attacks and the like.

Feistel型暗号の一例を示す図である。It is a figure which shows an example of Feistel type | mold encryption. 図1のF関数の構造を説明する図である。It is a figure explaining the structure of F function of FIG. 図1に対するマスキング手法の適用例を説明する図である。It is a figure explaining the example of application of the masking method with respect to FIG. 本発明の一実施形態の暗号処理装置の構成例を示す図である。It is a figure which shows the structural example of the encryption processing apparatus of one Embodiment of this invention. 暗号化手段の構成例を示す図である。It is a figure which shows the structural example of an encryption means. 図1に対する本発明の適用例を説明する図である。It is a figure explaining the example of application of this invention with respect to FIG. 暗号オリジナルの表と乱数を付与した表の例を示した図である。It is the figure which showed the example of the table | surface to which the encryption original table | surface and the random number were provided. 本発明の一実施形態の処理手順をフローチャートにて示す図である。It is a figure which shows the process sequence of one Embodiment of this invention with a flowchart. (A)は、差分電力解析を行った際の鍵の推定が誤っている場合、(B)は正しい場合の平均波形の例を説明する図である。(A) is a figure explaining the example of the average waveform in case (B) is correct, when the estimation of the key at the time of performing a difference power analysis is incorrect.

以下、本発明の実施形態について図面を参照して詳細に説明する。本発明によれば、乱数生成手段で生成した乱数と平文を連結したデータに暗号化処理を施し、その後乱数を削除する構成としたものである。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. According to the present invention, the data obtained by concatenating the random number generated by the random number generating means and the plaintext is encrypted, and then the random number is deleted.

本発明は、以下に説明するように、データの通信や蓄積の際にデータを秘匿するための共通鍵ブロック暗号のサイドチャネル攻撃の耐タンパに適用して好適とされる。   As described below, the present invention is preferably applied to tamper resistance against side channel attacks of a common key block cipher for concealing data during data communication and storage.

本発明の形態によれば、参照される要素の値を出力する表(S’)の各要素に、共通鍵暗号方式の暗号化処理に関わる第1のビット数(nビット)の値に、乱数生成手段で生成された第2のビット数(sビット)の前記乱数を連結した値を設定する表生成手段(図5の71)と、
第2のビット数の乱数を生成する前記乱数生成手段(図5の70)と、
第1のビット数の平文データに、前記乱数生成手段(図5の70)で生成された第2のビット数の乱数を連結した値を生成する乱数連結手段(図5の72)と、
第1のビット数の暗号データと第2のビット数の前記乱数との連結値をインデックスとして前記表(S’)の参照が行えるように、前記表(S’)の基準アドレス(例えば先頭アドレス)を指すポインタ(S'addr)を更新するポインタ更新手段(図5の74)と、
前記更新されたポインタ(S'addr)を基準とし、前記第1のビット数の暗号データと第2のビット数の乱数との連結値をインデックスとして計算されるアドレスにて前記表を参照する処理を含む暗号化処理を行う暗号化手段(図5の73)と、
前記暗号化手段の出力から乱数を除去する乱数削除手段(図5の75)と、を備える。
According to the embodiment of the present invention, each element of the table (S ′) that outputs the value of the element to be referred to has a value of the first number of bits (n bits) related to the encryption process of the common key cryptosystem. Table generation means (71 in FIG. 5) for setting a value obtained by concatenating the random numbers of the second number of bits (s bits) generated by the random number generation means;
The random number generating means (70 in FIG. 5) for generating a random number of the second number of bits;
Random number concatenating means (72 in FIG. 5) for generating a value obtained by concatenating the random number of the second bit number generated by the random number generating means (70 in FIG. 5) to the plaintext data of the first bit number;
The reference address (for example, the start address) of the table (S ′) so that the table (S ′) can be referred to using the concatenated value of the encrypted data of the first number of bits and the random number of the second number of bits as an index. Pointer updating means (74 in FIG. 5) for updating a pointer (S'addr) pointing to
A process of referring to the table with an address calculated by using a concatenated value of the encrypted data of the first bit number and the random number of the second bit number as an index with the updated pointer (S'addr) as a reference Encryption means (73 in FIG. 5) for performing encryption processing including:
Random number deletion means (75 in FIG. 5) for removing random numbers from the output of the encryption means.

前記第1のビット数をnとし、前記表(S’)は、ビット幅m(ただし、1≦n<m)の要素を2個備え、第2のビット数をs(ただし、1≦s<(m−n))とする。前記表生成手段(図5の71)は、前記表(S’)のmビットの各要素において、下位nビットに、暗号化処理に関わる値を設定し、前記下位nビットよりも上位ビットにsビットの乱数(図7(B)のα,i=0〜2−1)を設定する。前記乱数連結手段(図5の72)は、nビットの平文データの上位ビットに、sビットの乱数を連結した値を生成する。前記ポインタ更新手段(図5の74)は、例えば、下位nビットのデータと上位sビットの乱数との連結値(y)の下位nビット0とする演算結果(y∩1(m−n)||0(n))を、前記表(S’)の要素のアドレスに換算した値(y<<t;<<tはtビット左シフト演算、tは表1要素当りのバイト数)を、前記表の先頭アドレスを指すポインタから減算した値を、更新後のポインタ(S’addr)とする。前記暗号化手段(図5の73)は、前記更新後のポインタ(S’addr)に、下位nビットのデータと上位sビットの乱数との連結値(y)からなるインデックスをアドレスに換算した値(y<<t)を加算したアドレスにて、前記表(S’)の要素を参照し、前記表から出力されたmビットの要素から、暗号化処理に関わるnビットの値とsビットの乱数とを連結した値を取得する。前記暗号化処理で扱う暗号は、共通鍵方式のブロック暗号である。 The first bit number is n, and the table (S ′) includes 2 n elements having a bit width m (where 1 ≦ n <m), and the second bit number is s (where 1 ≦ n s <(mn)). The table generation means (71 in FIG. 5) sets a value related to the encryption process in the lower n bits in each of the m bits of the table (S ′), and sets the higher bits than the lower n bits. An s-bit random number (α i , i = 0 to 2 n −1 in FIG. 7B) is set. The random number concatenation unit (72 in FIG. 5) generates a value obtained by concatenating s-bit random numbers to the upper bits of n-bit plaintext data. The pointer update means (74 in FIG. 5) calculates, for example, a calculation result (y∩1 ( mn) where the lower n bits of the concatenated value (y) of the lower n bits of data and the upper s bits of random number 0. || 0 (n) ) is converted into the address of the element in the table (S ′) (y <<t;<< t is a t-bit left shift operation, and t is the number of bytes per element in the table). The value subtracted from the pointer indicating the head address of the table is the updated pointer (S'addr). The encryption means (73 in FIG. 5) converts an index composed of a concatenated value (y) of lower n-bit data and upper s-bit random number into an address in the updated pointer (S'addr). With reference to the element of the table (S ′) at the address to which the value (y << t) is added, the n-bit value and s bit related to the encryption process are determined from the m-bit element output from the table. Get the value concatenated with the random number. The encryption handled in the encryption process is a common key block cipher.

前記暗号化手段(図5の73)は、前記表を参照する処理を含むラウンド処理を予め定められた回数行い、前記乱数削除手段(図5の75)は、最終のラウンド処理の出力から乱数を削除する。前記乱数連結手段(図5の72)は、入力された平文から、nビットの第1、第2の平文データ(x 、x )の上位ビットにsビットの第1、第2の乱数(β、β)を連結したmビットの第1、第2のデータ(β||x 、β||x R)をそれぞれ生成する。特に制限されないが、暗号化手段(図5の73)においては、前記第1のデータ(β||x )を、下位nビットのラウンド鍵(K)と、上位(m−n)ビット0とを連結した値(0(m-n)||K)で排他的論理和演算を施す第1の排他的論理和演算部と、前記排他的論理和演算結果を、前記インデックスとし、前記更新ポインタ(S’addr)を用いて、前記表(S’)を参照する非線形処理部(301)と、前記非線形処理部(301)のmビットの出力(z)と、前記第2のデータ(β||x R)との排他的論理和演算をとる第2の排他的論理和演算部を備え、前記第1データと、前記第2の排他的論理和演算部の出力をクロスさせて、次のラウンドの第1、第2のデータとする構成としてもよい。前記乱数削除手段(図5の75)は、最終段のラウンドから出力されるβ||x の乱数β、βr+1||x Rの乱数βr+1を削除する。なお、前記表(S’)を参照するインデックスは、データとラウンド鍵との排他的論理和(鍵加算:Add-Round-Key)に制限されるものでないことは勿論である。例えばAESの各ラウンドのミックスカラム(Mix-Columns)等の処理において事前計算結果を表に実装する構成等にも適用可能である。 The encryption means (73 in FIG. 5) performs round processing including processing to refer to the table a predetermined number of times, and the random number deletion means (75 in FIG. 5) generates random numbers from the output of the final round processing. Is deleted. The random number concatenation means (72 in FIG. 5) converts the first and second s-bits from the input plaintext to the high-order bits of the n-bit first and second plaintext data (x 0 L , x 0 R ). M- bit first and second data (β 1 || x 0 L , β 0 || x 0 R ) are generated by connecting the random numbers (β 0 , β 1 ). Although not particularly limited, in the encryption means (73 in FIG. 5), the first data (β 1 || x 0 L ) is converted into the lower n-bit round key (K 0 ) and the upper (mn). ) A first exclusive OR operation unit that performs an exclusive OR operation with a value obtained by concatenating bits 0 (0 (mn) || K 0 ), and the exclusive OR operation result as the index, Using the update pointer (S′addr), a non-linear processing unit (301) referring to the table (S ′), an m-bit output (z 0 ) of the non-linear processing unit (301), and the second A second exclusive OR operation unit that performs an exclusive OR operation with the data (β 0 || x 0 R ), and the first data and the output of the second exclusive OR operation unit May be used as the first and second data of the next round. The random number deleting means (75 in FIG. 5) deletes β r || x r L random numbers β r and β r + 1 || x r R random numbers β r + 1 output from the final round. Of course, the index referring to the table (S ′) is not limited to exclusive OR (key addition: Add-Round-Key) of data and a round key. For example, the present invention can be applied to a configuration in which a pre-calculation result is mounted on a table in a process such as a mix column (Mix-Columns) of each round of AES.

なお、上記特許文献1−3等には、乱数生成手段で生成した乱数と平文を連結したデータに暗号化処理を施し、その後乱数を削除することで、暗号化処理の演算コストの増大を抑制する構成は開示されていない。   In addition, in Patent Documents 1-3 and the like described above, an encryption process is performed on data obtained by concatenating a random number generated by a random number generation unit and plaintext, and then the random number is deleted, thereby suppressing an increase in calculation cost of the encryption process. The structure to do is not disclosed.

図4を参照すると、一実施形態の暗号化装置1は、入出力装置2、CPU(Central Processing Unit)3、RAM(Random Access Memory)4、ROM(Read Only Memory)5がバス6で接続された構成をとる。ROM5には、暗号化処理プログラム7が格納されている。暗号化処理プログラムが実行される際には、ROM5から暗号化処理プログラムが読み出されてRAM4にロードされる。CPU3は、RAM4からプログラムを読み込み(フェッチ)し、解釈、実行することで、暗号化処理が実行される。ただし、暗号化処理プログラムは、入出力装置2を介して外部からロードされ、RAM4に展開される構成としてもよい。暗号化鍵は、ROM5に格納しておく形態としてもよいし、あるいは入出力装置2より外部から入力する構成としてもよい。ROM5は、電気的に書き換え消去可能な不揮発性メモリ(ROM)であってもよい。あるいは、暗号化処理プログラム7はHDD(Hard Disk Drive)等の不揮発性の補助記憶装置等に記憶してもよいことは勿論である。   Referring to FIG. 4, an encryption device 1 according to an embodiment includes an input / output device 2, a CPU (Central Processing Unit) 3, a RAM (Random Access Memory) 4, and a ROM (Read Only Memory) 5 connected via a bus 6. Take the configuration. The ROM 5 stores an encryption processing program 7. When the encryption processing program is executed, the encryption processing program is read from the ROM 5 and loaded into the RAM 4. The CPU 3 reads (fetches) a program from the RAM 4, interprets it, and executes it to execute encryption processing. However, the encryption processing program may be loaded from the outside via the input / output device 2 and expanded in the RAM 4. The encryption key may be stored in the ROM 5 or may be input from the input / output device 2 from the outside. The ROM 5 may be an electrically rewritable and erasable nonvolatile memory (ROM). Alternatively, the encryption processing program 7 may be stored in a non-volatile auxiliary storage device such as an HDD (Hard Disk Drive).

耐タンパ機能を施した暗号化処理プログラムの動作について以下に説明する。図5を参照すると、暗号化処理プログラム7は、乱数生成手段70、表生成手段71、乱数連結手段72、暗号化手段73、ポインタ更新手段74、乱数削除手段75にモジュール分割(あるいは機能分割)される。各手段の機能・動作について説明する。   The operation of the encryption processing program with the tamper resistant function will be described below. Referring to FIG. 5, the encryption processing program 7 is divided into modules (or function divisions) into random number generation means 70, table generation means 71, random number connection means 72, encryption means 73, pointer update means 74, and random number deletion means 75. Is done. The function / operation of each means will be described.

乱数生成手段70はsビット(1≦s<m−n)の乱数を生成する。   The random number generating means 70 generates a random number of s bits (1 ≦ s <mn).

表生成手段71は、乱数生成手段70で生成したsビット(例えばs=22)の乱数を用いて、暗号化手段73で参照する表の更新を行い、表S’を作成する。表S’は、暗号化装置1のRAM4に格納される。   The table generation means 71 updates the table referred to by the encryption means 73 using the random number of s bits (for example, s = 22) generated by the random number generation means 70 to create a table S ′. The table S ′ is stored in the RAM 4 of the encryption device 1.

具体例として、図7(A)の表Sを用いて説明する。図7(A)では、m=32、n=8として説明を行う。表Sは、256(=2)個の要素で構成され、1つの要素は、32ビットである。各要素の下位8ビットには、暗号化処理に関する値(図7は、16進数表記(1ヘキサデジット=4ビット:0〜F)が設定されており、上位24ビットはオール0である。なお、下位8ビットと上位24ビットの間の記号||は連結(concatenation)を表しており、上位24ビットと下位8ビットとを連結して32ビットとなる。 A specific example will be described with reference to Table S in FIG. In FIG. 7A, description is made assuming that m = 32 and n = 8. Table S is composed of 256 (= 2 8 ) elements, and one element is 32 bits. In the lower 8 bits of each element, a value related to the encryption processing (FIG. 7 shows hexadecimal notation (1 hexadigit = 4 bits: 0 to F), and the upper 24 bits are all 0s. The symbol || between the lower 8 bits and the upper 24 bits represents concatenation, and the upper 24 bits and the lower 8 bits are concatenated to 32 bits.

多くの暗号アルゴリズムでは、何がしかの演算処理について事前計算を行い演算結果を表形式で保持する形態(ルックアップテーブル(Look Up Table: LUT)方式)がとられる。暗号化処理時に、演算前データを、表のインデックスとして、表参照を行うことで、演算結果を得る。   Many cryptographic algorithms have a form (Look Up Table: LUT) in which a certain calculation process is pre-calculated and the calculation result is held in a tabular form. At the time of encryption processing, the calculation result is obtained by referring to the table using the pre-calculation data as a table index.

表生成手段71は、乱数生成手段70で生成したsビットの乱数を、表の各要素の0が設定されている位置(下位nビットよりも上位の(m−n)の領域)に設定する。なお、設定する乱数は、表の要素ごとに異なっていてもよいし、全て同一であってもよい。図7(B)の表S’は、図7(A)の表Sに対して、乱数生成手段70で生成された乱数α(i∈{0, 1, 2, ..., 255})を設定した後の表である。 The table generation unit 71 sets the s-bit random number generated by the random number generation unit 70 at a position where 0 of each element of the table is set (an area (m−n) higher than the lower n bits). . Note that the set random numbers may be different for each element of the table, or all may be the same. The table S ′ of FIG. 7B is different from the table S of FIG. 7A in that the random number α i (i∈ {0, 1, 2,..., 255}) generated by the random number generation means 70. ) Is a table after setting.

乱数連結手段72には、暗号化する平文データと、乱数生成手段70で生成した乱数の2つが入力される。b×nビットの平文は、b個のnビット平文データに分割され、各々が、mビット変数(m>n、m=24、n=8)に保持される。mビット変数の下位nビットに平文が設定され、上位ビット(m−n)の領域にsビットの乱数が設定される。   The random number concatenation unit 72 is input with the plaintext data to be encrypted and the random number generated by the random number generation unit 70. The b × n-bit plaintext is divided into b n-bit plaintext data, and each is held in an m-bit variable (m> n, m = 24, n = 8). Plain text is set in the lower n bits of the m-bit variable, and an s-bit random number is set in the upper bit (mn) area.

暗号化手段73とポインタ更新手段74の処理について、図6を参照して説明する。図6は、図1と図2に示した暗号化処理を耐タンパ化したものに相当する。   The processing of the encryption unit 73 and the pointer update unit 74 will be described with reference to FIG. FIG. 6 corresponds to a tamper resistant version of the encryption process shown in FIGS.

図6において、β||x 、β||x は、乱数連結手段72によって分割されたnビット平文x 、x の上位ビットに、それぞれ、sビットの乱数β、βが連結されたデータである。 In FIG. 6, β 1 || x 0 L and β 0 || x 0 R are s-bit random numbers respectively in the upper bits of the n-bit plaintexts x 0 L and x 0 R divided by the random number linking means 72. This is data in which β 0 and β 1 are connected.

β||x は、mビットの鍵0(m−n)||Kと排他的論理和演算され、演算結果が、非線形変換処理301によって変換される。なお、鍵0(m−n)||Kの上位(m−n)ビットは0、下位nビットがKとなる。 β 1 || x 0 L is subjected to an exclusive OR operation with an m-bit key 0 (mn) || K 0, and the operation result is converted by the non-linear conversion processing 301. Incidentally, the key 0 (m-n) || K higher (m-n) bits 0 of 0, the lower n bits are K 0.

非線形変換処理301は、表生成手段71で生成された表S’を参照することにより、ルックアップテーブル(LUT)方式で、非線形処理を実行する。   The non-linear conversion processing 301 executes the non-linear processing by a look-up table (LUT) method by referring to the table S ′ generated by the table generating means 71.

一般的な表参照の手順を示す。表は、メモリ上に連続的に配置されたデータであり、表の先頭アドレスのデータをポイントするポインタ(アドレスポインタ)Saddrとして保持する。表のインデックスxは、先頭アドレスからの変位となるため、ポインタにインデックスを加算し、当該データが保存されているメモリアドレスを得る。より正確には、表の要素が2バイトのとき、先頭アドレスからの変位xは(x<<t)バイトとなる。<<は左シフト演算子(bit-wise left shift operator)である。例えば図7において要素は、32ビット=4バイト=22=2バイトから、t=2となる、インデクスx=2("00000010")に対して左2ビットシフトした(2<<2)は、8(="00001000")となる。インデクスx=2に対して表の先頭アドレスから8バイト目の4バイト(1要素)がアクセスされる。したがって、インデックスxで参照される表の要素のアクセスアドレスXaddrは、式(17)で計算される。 A general table reference procedure is shown. The table is data continuously arranged on the memory, and is held as a pointer (address pointer) Saddr that points to data at the head address of the table. Since the index x in the table is a displacement from the head address, the index is added to the pointer to obtain the memory address where the data is stored. More precisely, when the table element is 2 t bytes, the displacement x from the head address is (x << t) bytes. << is a bit-wise left shift operator. For example, in FIG. 7, the element is shifted from the 32 bits = 4 bytes = 2 2 = 2 t bytes to the left 2 bits with respect to the index x = 2 (“00000010”) where t = 2 (2 << 2). Is 8 (= "00001000"). The fourth byte (one element) of the eighth byte from the head address of the table is accessed for index x = 2. Therefore, the access address X addr of the table element referred to by the index x is calculated by the equation (17).

addr=Saddr+(x<<t) ・・・(17) X addr = S addr + (x << t) (17)

ここで、表のエントリ数(要素の総数)が2個であれば、インデックスxは0≦x≦2−1である。図7のm=32、n=8、t=2の場合、XaddrはSaddr〜Saddr+1020となる。なお、表アクセスの基準となるアドレスを表の先頭アドレスでなく、表の最終要素(インデックス=2−1)をポイントするアドレス(Saddr)とした場合、インデックスx(0≦x≦2−1)に対してアドレスXaddrは、
addr=Saddr−{(2−1−x)<<t)} ・・・(17)’
で与えられる。
Here, if the number of entries (total number of elements) in the table is 2 n , the index x is 0 ≦ x ≦ 2 n −1. In the case of m = 32, n = 8, and t = 2 in FIG. 7, X addr is S addr to S addr +10 20. If the address used as the reference for table access is not the head address of the table but the address (S addr ) that points to the last element (index = 2 n −1) of the table, index x (0 ≦ x ≦ 2 n -1), the address X addr is
X addr = S addr − {(2 n −1−x) << t)} (17) ′
Given in.

しかしながら、本実施形態のように、インデックスの上位ビットに0以外の値が設定されている場合には、上記手順では、正しく要素のアドレスを計算することができない。   However, when a value other than 0 is set in the high-order bits of the index as in this embodiment, the above procedure cannot correctly calculate the element address.

図6において、β||x と鍵0(m−n)||Kとの排他的論理和演算結果β||(x ^K)の上位(m−n)ビットには、sビットの乱数β(0以外の値)が設定されている。β||(x ^K)の下位nビットは、暗号化データx ^Kである。このβ||(x ^K)が、非線形変換処理301に入力される。 In FIG. 6, the higher-order (mn) of the exclusive OR operation result β 1 || (x 0 L ^ K 0 ) of β 1 || x 0 L and the key 0 (mn) || K 0 In the bit, an s-bit random number β 1 (a value other than 0) is set. The lower n bits of β 1 || (x 0 L ^ K 0 ) are encrypted data x 0 L ^ K 0 . This β 1 || (x 0 L ^ K 0 ) is input to the nonlinear transformation processing 301.

そこで、ポインタ更新手段74は、(乱数||暗号化データ)、例えば(β||(x ^K))から、表S’の先頭アドレスのポインタを変更(更新)する。 Therefore, the pointer updating unit 74 changes (updates) the pointer of the head address of the table S ′ from (random number || encrypted data), for example, (β 1 || (x 0 L ^ K 0 )).

ポインタ更新手段74は、表参照を行う際のインデックスとなる変数y(上記β||(x ^K)のように、上位ビットに乱数、下位nビットは暗号化データ)を用いて、表参照が行えるように、上位ビットの乱数を残し下位nビットを0とした値を、tビット(ただし、tは表1要素のバイト数)左シフトしたデータを生成し、これを表の先頭アドレスを示すポインタSaddrから減算した値を新たな先頭アドレスポインタとすることで、変数y(上記β||(x ^K)を用いて、暗号化データx ^Kに対応する表の各要素(0≦インデックス≦(2−1))がアクセスされる。 The pointer update unit 74 uses a variable y (random number in the upper bits and encrypted data in the lower n bits, as in the above β 1 || (x 0 L ^ K 0 ), which is an index for table reference. In order to make it possible to refer to the table, data is generated by left-shifting t bits (where t is the number of bytes in the elements in Table 1), with the upper bit random number remaining and the lower n bits set to 0. By subtracting the value subtracted from the pointer S addr indicating the head address of the new head address pointer, using the variable y (β 1 || (x 0 L ^ K 0 ) above, the encrypted data x 0 L ^ Each element (0 ≦ index ≦ (2 n −1)) of the table corresponding to K 0 is accessed.

すなわち、式(18)によってSaddrを更新し、ポインタS’addrを生成する。 That is, S addr is updated by equation (18) to generate a pointer S ′ addr .

S’addr=Saddr−((y∩1(m−n)||0(n))<<t) ・・・(18) S ′ addr = S addr − ((y∩1 (mn) || 0 (n) ) << t) (18)

式(18)において、∩はビット毎のAND演算を行う演算子である。1(m−n)||0(n)の0(n)は下位nビットの0データ、1(m−n)は上位(m−n)ビットの1データである。インデックスとなるmビットの変数y(上位(m−n)ビットの領域に配置されたsビットの乱数と下位nビットの暗号化データの連結)と、mビット情報1(m−n)||0(n)とのビット毎のAND演算をとった結果(上位(m−n)ビットの領域にはsビットの乱数、下位nビットは0)を、tビット左シフトした値をポインタSaddrから減算することで、ポインタS’addrを求める。 In equation (18), ∩ is an operator that performs a bitwise AND operation. 1 (m-n) || 0 (n) of 0 (n) is the lower n bits 0 data, 1 (m-n) is 1 data of the upper (m-n) bits. An index m-bit variable y (concatenation of s-bit random number arranged in upper (mn) bit area and lower n-bit encrypted data) and m-bit information 1 (mn) || A bitwise AND operation result with 0 (n) (sbit random number in the upper (mn) bit area, lower n bit is 0), and a value left shifted by t bits is a pointer S addr By subtracting from, the pointer S ′ addr is obtained.

非線形変換処理301において、y=β||(x ^K)で表S’をアクセスする場合、インデックスyで、参照される表の要素のアクセスアドレスXaddrは以下で計算される。 When the table S ′ is accessed with y = β 1 || (x 0 L ^ K 0 ) in the nonlinear conversion process 301, the access address X addr of the table element to be referred to with the index y is calculated as follows. .

addr=S’addr+(y<<t) ・・・(19) X addr = S ' addr + (y << t) (19)

暗号化手段73において、表参照を行うたびに、ポインタ更新手段74を呼び出し、変数に応じたポインタS’addrを生成する。S’addrを用いて表S’(図7(B)参照)の参照を行い、当該要素(α||暗号化処理の値)がzとなる。 Each time the encryption unit 73 performs a table reference, the pointer update unit 74 is called to generate a pointer S ′ addr corresponding to the variable. The table S ′ (see FIG. 7B) is referenced using S ′ addr , and the element (α i || value of the encryption process) becomes z 0 .

よって、第1ラウンドの出力β||x は、
^(β||x ) ・・・(20)
で計算される。
Therefore, the output β 2 || x 1 L of the first round is
z 0 ^ (β 0 || x 0 R ) (20)
Calculated by

このとき、zの上位(m−n)ビットの乱数αと、(β||x )の上位(m−n)ビットの乱数βとの排他的論理和がβとなる。 In this case, the random number alpha i of the upper (m-n) bits of z 0, the exclusive OR of the upper (m-n) bits of the random number beta 0 of (β 0 || x 0 R) is beta 2 Become.

β=β^α (0≦i≦255) ・・・(21) β 2 = β 0 ^ α i (0 ≦ i ≦ 255) (21)

以上の処理を、所定ラウンド数、繰り返す。   The above processing is repeated for a predetermined number of rounds.

乱数削除手段75は、最終ラウンド(第rラウンド)の出力データ:
β||x
βr+1||x
からそれぞれ乱数βr、βr+1を除去し(下位nビット:x 、x を抽出)、暗号文C=x ||x を生成する。
The random number deletion means 75 outputs the final round (r-th round) output data:
β r || x r L ,
β r + 1 || x r R
Then, random numbers β r and β r + 1 are removed from each of them (lower n bits: x r L and x r R are extracted) to generate ciphertext C = x r L || x r R.

図8は、本実施の形態の処理手順を表したものである。   FIG. 8 shows a processing procedure of the present embodiment.

乱数生成手段70は、表に埋め込むための乱数を生成する(ステップS1)。   The random number generation means 70 generates a random number to be embedded in the table (step S1).

表生成手段71は、乱数生成手段70で生成された乱数を用いて表に乱数を埋め込む(ステップS2)。   The table generation means 71 embeds random numbers in the table using the random numbers generated by the random number generation means 70 (step S2).

乱数生成手段70は、暗号化データ用の乱数を生成する(ステップS3)。   The random number generation means 70 generates a random number for encrypted data (step S3).

乱数連結手段72は、平文を分割し、分割した各々に対して乱数を連結する(ステップS4)。   The random number connection means 72 divides the plain text and connects random numbers to each of the divided pieces (step S4).

これより、暗号化手段73によりラウンド処理が行われる。   Thus, round processing is performed by the encryption means 73.

なお、暗号化手段73は、暗号アルゴリズム固有の処理であるため、説明は省略する。   Note that the encryption unit 73 is a process specific to the encryption algorithm, and thus description thereof is omitted.

暗号固有処理1は、例えば鍵データと暗号化データの排他的論理和演算等である(ステップS5)。   The encryption unique process 1 is, for example, an exclusive OR operation of key data and encrypted data (step S5).

表参照処理(ステップS7)の前に、ポインタ更新処理(ステップS6)を行う。これは、表参照を行う回数分実施する。   Prior to the table reference process (step S7), a pointer update process (step S6) is performed. This is performed as many times as the table reference is performed.

暗号固有処理2(ステップS8)は、例えば、複数の表参照の結果どうしを混ぜ合わせる線形変換処理(具体的には、AESのMixColumns処理)等である。   The cipher unique process 2 (step S8) is, for example, a linear conversion process (specifically, AES MixColumns process) that mixes the results of a plurality of table references.

暗号アルゴリズムで決定されるラウンド数(所定回数)、ラウンド処理が繰り返されていなければ、S5へ戻り、ラウンド処理を繰り返す。所定回数の繰り返しが行われていれば、S10へ分岐する。
乱数削除手段75は、データから乱数を取り除き、データを結合したものを暗号文とする(ステップS10)。
If the number of rounds determined by the encryption algorithm (predetermined number of times) and the round process have not been repeated, the process returns to S5 and the round process is repeated. If it has been repeated a predetermined number of times, the process branches to S10.
The random number deleting means 75 removes the random number from the data and uses the combined data as ciphertext (step S10).

関連技術のマスキング手法では、表の再構成の演算コストが大きい。図3の対策済非線形処理30を生成するためには、式(22)の演算を行う必要がある。なお、for文は、C言語の書法によるfor-loopであり、i=0からi=2−1まで処理S’[i]=S[i^α]^αを繰り返す。なお、^はC言語における排他的論理和演算子、powは累乗関数であり、pow(2,n)は2nである。i++は、iを1つ増加(increment)を意味する。 In the related art masking technique, the calculation cost of table reconstruction is high. In order to generate the countermeasured non-linear processing 30 of FIG. 3, it is necessary to perform the calculation of Expression (22). Note that the for sentence is a for-loop in C language, and the process S ′ [i] = S [i ^ α 1 ] ^ α 3 is repeated from i = 0 to i = 2 n −1. Here, ^ is an exclusive OR operator in C language, pow is a power function, and pow (2, n) is 2 n . i ++ means an increment of i.

for(i=0;i<pow(2,n);i++) S’[i]=S[i^α1]^α3 ・・・(22) for (i = 0; i <pow (2, n); i ++) S ′ [i] = S [i ^ α1] ^ α3 (22)

この一連の処理では、
排他的論理和を2回、
S[]のロードを1回、
S’[]へのストアを1回実行する。
In this series of processing,
XOR twice,
Load S [] once,
Store to S ′ [] once.

一方、本実施形態による表生成処理(図7)では、
S’[]へのストアの1回で済む(乱数αをストア命令のサイズに一致させた場合)。
On the other hand, in the table generation process (FIG. 7) according to this embodiment,
Only one store to S ′ [] is required (when the random number α matches the size of the store instruction).

表生成処理は、1ブロック分の暗号化処理毎に実施する必要があるため、処理コストが少ないほど耐タンパ機能がないものからの処理性能の低下が少ない、つまり高速な処理が行えるというメリットがある。   Since table generation processing must be performed for each block of encryption processing, the lower the processing cost, the lower the processing performance from those without a tamper-resistant function, that is, high-speed processing. is there.

また、関連技術では、αが異なると、異なる表S’になってしまう。表Sが1種類であっても、複数回参照を行う暗号アルゴリズムであれば、その数分の表S’を持たねばならず、使用メモリ領域が増加するという問題もある。例えば、AESのSubBytes処理では、16回の表参照を行うため、最大16倍の表を持つことになる。 In the related art, if α 1 is different, a different table S ′ is obtained. Even if there is only one type of table S, if it is an encryption algorithm that makes reference multiple times, there must be as many tables S 'as there are, and there is a problem that the memory area used increases. For example, in the AES SubBytes process, since the table is referred to 16 times, the table has a maximum 16 times.

一方、実施形態の表S’は、連結する乱数の制限はないため、表S’の増加はない。このため、メモリコストの面でもメリットがある。   On the other hand, the table S ′ according to the embodiment has no limitation on the number of connected random numbers, and therefore the table S ′ does not increase. For this reason, there is a merit in terms of memory cost.

なお、上記の特許文献の各開示を、本書に引用をもって繰り込むものとする。本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態ないし実施例の変更・調整が可能である。また、本発明の請求の範囲の枠内において種々の開示要素(各請求項の各要素、各実施例の各要素、各図面の各要素等を含む)の多様な組み合わせないし選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。   It should be noted that the disclosures of the above patent documents are incorporated herein by reference. Within the scope of the entire disclosure (including claims) of the present invention, the embodiments and examples can be changed and adjusted based on the basic technical concept. Various disclosed elements (including each element of each claim, each element of each embodiment, each element of each drawing, etc.) can be combined or selected within the scope of the claims of the present invention. . That is, the present invention of course includes various variations and modifications that could be made by those skilled in the art according to the entire disclosure including the claims and the technical idea.

1 暗号化装置
2 入出力装置
3 CPU
4 RAM
5 ROM
6 バス
7 暗号処理プログラム
10 F関数
11 非線形処理S
30 乱数マスクをかけた非線形処理S
31 排他的論理和
70 乱数生成手段
71 表生成手段
72 乱数連結手段
73 暗号化手段
74 ポインタ更新手段
75 乱数削除手段
301 非線形変換処理
1 Encryption Device 2 Input / Output Device 3 CPU
4 RAM
5 ROM
6 Bus 7 Cryptographic processing program 10 F function 11 Non-linear processing S
30 Nonlinear processing with random number mask S
31 Exclusive OR 70 Random number generating means 71 Table generating means 72 Random number concatenating means 73 Encryption means 74 Pointer updating means 75 Random number deleting means 301 Non-linear transformation processing

Claims (9)

参照される要素の値を出力する表の各要素に、共通鍵暗号方式の暗号化処理に関わる第1のビット数の値に、乱数生成手段で生成された第2のビット数の乱数を連結した値を設定する表生成手段と、
第2のビット数の乱数を生成する前記乱数生成手段と、
第1のビット数の平文データに、前記乱数生成手段で生成された第2のビット数の乱数を連結した値を生成する乱数連結手段と、
前記表参照用の基準アドレスを指すポインタを更新するポインタ更新手段と、
前記更新されたポインタを基準とし、第1のビット数のデータと第2のビット数の乱数との連結値から計算されるアドレスにて前記表を参照する処理を含む暗号化手段と、
前記暗号化手段の出力から乱数を除去する乱数削除手段と、
を備える、ことを特徴とする暗号処理装置。
Concatenating the random number of the second number of bits generated by the random number generation means to the value of the first number of bits related to the encryption processing of the common key cryptosystem to each element of the table that outputs the value of the referenced element A table generation means for setting the values obtained;
The random number generating means for generating a random number of a second number of bits;
Random number concatenating means for generating a value obtained by concatenating a first bit number of plaintext data with a second bit number random number generated by the random number generating means;
Pointer updating means for updating a pointer pointing to the reference address for table reference;
An encryption unit including a process of referring to the table with an address calculated from a concatenated value of a first bit number data and a second bit number random number with the updated pointer as a reference;
Random number deletion means for removing random numbers from the output of the encryption means;
An encryption processing apparatus comprising:
前記第1のビット数をnとし、
前記表は、ビット幅m(ただし、1≦n<m)の要素を2個備え、
前記第2のビット数をs(ただし、1≦s<(m−n))とし、
前記表生成手段は、前記表のmビットの各要素において、下位nビットに、前記暗号化処理に関わる値を設定し、前記下位nビットよりも上位ビットに前記乱数生成手段で生成されたsビットの乱数を設定し、
前記乱数連結手段は、nビットの平文データを下位nビットとし、その上位ビットに前記乱数生成手段で生成されたsビットの乱数を連結した値を生成し、
前記ポインタ更新手段は、下位nビットのデータと上位sビットの前記乱数との連結値からなるインデックスの前記下位nビットを0とした値を、前記表の要素のアドレスに換算した値を、前記表の先頭アドレスを指すポインタから減算した値を、更新後のポインタとし、
前記暗号化手段は、前記更新後のポインタに、下位nビットのデータと上位sビットの乱数との連結値からなる前記インデックスのアドレス換算値を加算したアドレスにて、前記表の要素を参照し、前記表から出力されるmビットの要素から、暗号化処理に関わるnビットの値とsビットの前記乱数とを連結した値を取得する、ことを特徴とする請求項1記載の暗号処理装置。
The first bit number is n,
The table includes 2 n elements having a bit width m (where 1 ≦ n <m),
The second number of bits is s (where 1 ≦ s <(mn)),
The table generation means sets a value related to the encryption processing in the lower n bits in each element of m bits of the table, and the random number generation means generates s in higher bits than the lower n bits. Set a random number of bits,
The random number concatenation unit generates n-bit plaintext data as lower n bits, and generates a value obtained by concatenating the upper bits with the s-bit random number generated by the random number generation unit,
The pointer updating means converts a value obtained by converting a value in which the lower n bits of an index composed of a concatenated value of lower n bits of data and higher random number of s bits into 0 to the address of the element in the table, The value subtracted from the pointer that points to the top address of the table is the updated pointer,
The encryption means refers to the element in the table with an address obtained by adding an address conversion value of the index consisting of a concatenated value of lower n-bit data and upper s-bit random numbers to the updated pointer. 2. The cryptographic processing apparatus according to claim 1, wherein a value obtained by concatenating an n-bit value related to an encryption process and an s-bit random number is obtained from an m-bit element output from the table. .
前記暗号化手段は、前記表を参照する処理を含むラウンド処理を予め定められた回数行い、
前記乱数削除手段は、最終のラウンド処理の出力から乱数を削除する、ことを特徴とする請求項1又は2記載の暗号処理装置。
The encryption means performs a round process including a process of referring to the table a predetermined number of times,
The cryptographic processing apparatus according to claim 1, wherein the random number deleting unit deletes a random number from an output of a final round process.
参照される要素の値を出力する表を記憶する記憶装置を備えたデータ処理装置による暗号処理方法であって、
表作成処理では、前記表の各要素に、共通鍵暗号方式の暗号化処理に関わる第1のビット数の値に、乱数生成処理で生成された第2のビット数の前記乱数を連結した値を設定し、
乱数連結処理では、第1のビット数の平文データに、前記乱数生成処理で生成された第2のビット数の乱数を連結した値を生成し、
前記表参照用の基準アドレスを指すポインタを更新し、
前記暗号化処理では、前記更新されたポインタを基準とし、前記第1のビット数のデータと第2のビット数の乱数との連結値から求まるアドレスにて前記表を参照する処理を行い、
乱数削除処理では、前記暗号化処理の出力から乱数を除去する、
ことを特徴とする暗号処理方法。
An encryption processing method by a data processing device comprising a storage device for storing a table for outputting values of elements to be referenced,
In the table creation process, each element of the table is a value obtained by concatenating the first bit number value related to the encryption process of the common key cryptosystem to the random number of the second bit number generated in the random number generation process. Set
In the random number concatenation process, a value obtained by concatenating the plaintext data of the first number of bits with the random number of the second number of bits generated in the random number generation process is generated.
Updating a pointer to the reference address for reference to the table;
In the encryption process, with reference to the updated pointer, a process of referring to the table with an address obtained from a concatenated value of the first bit number data and the second bit number random number,
In the random number deletion process, the random number is removed from the output of the encryption process.
And a cryptographic processing method.
前記第1のビット数をnとし、
前記表は、ビット幅m(ただし、1≦n<m)の要素を2個備え、
前記第2のビット数をs(ただし、1≦s<(m−n))とし、
前記表生成処理では、前記表のmビットの各要素において、下位nビットに、前記暗号化処理に関わる値を設定し、前記下位nビットよりも上位ビットにsビットの乱数を設定し、
前記乱数連結処理では、nビットの平文データを下位nビットとし、その上位ビットにsビットの乱数を連結した値を生成し、
前記ポインタ更新処理では、下位nビットのデータと上位sビットの前記乱数との連結値からなるインデックスの前記下位nビット0とした値を、前記表の要素のアドレスに換算した値を、前記表の先頭アドレスを指すポインタから減算した値を、更新後のポインタとし、
前記暗号化処理では、前記更新後のポインタに、下位nビットのデータと上位sビットの乱数との連結値からなるインデックスのアドレス換算値を加算したアドレスにて、前記表の要素を参照し、前記表から出力されるmビットの要素から、暗号化処理に関わるnビットの値とsビットの前記乱数とを連結した値を取得する、ことを特徴とする請求項4記載の暗号処理方法。
The first bit number is n,
The table includes 2 n elements having a bit width m (where 1 ≦ n <m),
The second number of bits is s (where 1 ≦ s <(mn)),
In the table generation process, in each element of m bits of the table, a value related to the encryption process is set in the lower n bits, and an s-bit random number is set in the higher bits than the lower n bits,
In the random number concatenation process, n-bit plaintext data is set to lower n bits, and a value obtained by concatenating s-bit random numbers to the upper bits is generated.
In the pointer update processing, a value obtained by converting the value of the lower n bits 0 of the index composed of the concatenation value of the lower n bits of data and the upper s bits of the random number into the address of the element in the table is used. The value subtracted from the pointer that points to the start address of
In the encryption process, with reference to the elements in the table at an address obtained by adding an address conversion value of an index composed of a concatenated value of lower n-bit data and upper s-bit random numbers to the updated pointer, 5. The encryption processing method according to claim 4, wherein a value obtained by concatenating an n-bit value related to encryption processing and an s-bit random number is acquired from an m-bit element output from the table.
前記暗号化処理では、前記表を参照する処理を含むラウンド処理を予め定められた回数行い、
前記乱数削除処理では、最終のラウンドの出力から乱数を削除する、ことを特徴とする請求項5記載の暗号処理方法。
In the encryption process, a round process including a process of referring to the table is performed a predetermined number of times,
6. The cryptographic processing method according to claim 5, wherein in the random number deletion process, a random number is deleted from an output of a final round.
参照される要素の値を出力する表を記憶する記憶装置を備えたコンピュータに、
前記表の各要素に、共通鍵暗号方式の暗号化処理に関わる第1のビット数の値に、乱数生成処理で生成された第2のビット数の前記乱数を連結した値を設定する表生成処理と、
第2のビット数の前記乱数を生成する前記乱数生成処理と、
第1のビット数の平文データに、前記乱数生成処理で生成された第2のビット数の乱数を連結した値を生成する乱数連結処理と、
前記表の基準アドレスを指すポインタを更新するポインタ更新処理と、
前記更新されたポインタを基準とし、第1のビット数のデータと第2のビット数の乱数との連結値から求まるアドレスで前記表を参照する処理を含む暗号化処理と、
前記暗号化処理の出力から乱数を除去する乱数削除処理と、
を実行させるプログラム。
A computer having a storage device for storing a table for outputting values of referenced elements;
Table generation in which each element of the table is set to a value obtained by concatenating the random number of the second bit number generated in the random number generation process to the value of the first bit number related to the encryption process of the common key cryptosystem Processing,
The random number generation processing for generating the random number of a second number of bits;
A random number concatenation process for generating a value obtained by concatenating the random number of the second bit number generated in the random number generation process to the plain text data of the first bit number;
A pointer update process for updating a pointer to the reference address of the table;
An encryption process including a process of referring to the table with an address obtained from a concatenated value of a first bit number data and a second bit number random number with reference to the updated pointer;
Random number deletion processing for removing random numbers from the output of the encryption processing;
A program that executes
前記第1のビット数をnとし、
前記表は、ビット幅m(ただし、1≦n<m)の要素を2個備え、
前記第2のビット数をs(ただし、1≦s<(m−n))とし、
前記表生成処理では、前記表のmビットの各要素において、下位nビットに、前記暗号化処理に関わる値を設定し、前記下位nビットよりも上位ビットにsビットの乱数を設定し、
前記乱数連結処理では、nビットの平文データを下位nビットとし、その上位ビットにsビットの乱数を連結した値を生成し、
前記ポインタ更新処理では、下位nビットのデータと上位sビットの前記乱数との連結値からなるインデックスの前記下位nビット0とした値を、前記表の要素のアドレスに換算した値を、前記表の先頭アドレスを指すポインタから減算した値を、更新後のポインタとし、
前記暗号化処理では、前記更新後のポインタに、下位nビットのデータと上位sビットの乱数との連結値からなるインデックスのアドレス換算値を加算したアドレスにて、前記表の要素を参照し、前記表から出力されるmビットの要素から、暗号化処理に関わるnビットの値とsビットの前記乱数とを連結した値を取得する、ことを特徴とする請求項7記載のプログラム。
The first bit number is n,
The table includes 2 n elements having a bit width m (where 1 ≦ n <m),
The second number of bits is s (where 1 ≦ s <(mn)),
In the table generation process, in each element of m bits of the table, a value related to the encryption process is set in the lower n bits, and an s-bit random number is set in the higher bits than the lower n bits,
In the random number concatenation process, n-bit plaintext data is set to lower n bits, and a value obtained by concatenating s-bit random numbers to the upper bits is generated.
In the pointer update processing, a value obtained by converting the value of the lower n bits 0 of the index composed of the concatenation value of the lower n bits of data and the upper s bits of the random number into the address of the element in the table is used. The value subtracted from the pointer that points to the start address of
In the encryption process, with reference to the elements in the table at an address obtained by adding an address conversion value of an index composed of a concatenated value of lower n-bit data and upper s-bit random numbers to the updated pointer, 8. The program according to claim 7, wherein a value obtained by concatenating an n-bit value related to encryption processing and an s-bit random number is acquired from an m-bit element output from the table.
前記暗号化処理では、前記表を参照する処理を含むラウンド処理を予め定められた回数行い、
前記乱数削除処理では、最終のラウンドの出力から乱数を削除する、ことを特徴とする請求項8記載のプログラム。
In the encryption process, a round process including a process of referring to the table is performed a predetermined number of times,
9. The program according to claim 8, wherein in the random number deletion process, random numbers are deleted from the output of the last round.
JP2012271543A 2012-12-12 2012-12-12 Cryptographic processing apparatus and method, and cryptographic processing program Active JP6089664B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012271543A JP6089664B2 (en) 2012-12-12 2012-12-12 Cryptographic processing apparatus and method, and cryptographic processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012271543A JP6089664B2 (en) 2012-12-12 2012-12-12 Cryptographic processing apparatus and method, and cryptographic processing program

Publications (2)

Publication Number Publication Date
JP2014115579A true JP2014115579A (en) 2014-06-26
JP6089664B2 JP6089664B2 (en) 2017-03-08

Family

ID=51171595

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012271543A Active JP6089664B2 (en) 2012-12-12 2012-12-12 Cryptographic processing apparatus and method, and cryptographic processing program

Country Status (1)

Country Link
JP (1) JP6089664B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030044003A1 (en) * 2001-08-14 2003-03-06 International Business Machines Corporation Space-efficient, side-channel attack resistant table lookups
US20060177052A1 (en) * 2002-05-23 2006-08-10 Hubert Gerardus T S-box encryption in block cipher implementations
US20070211890A1 (en) * 2006-03-07 2007-09-13 Research In Motion Limited Table splitting for cryptographic processes
JP2012530269A (en) * 2009-06-19 2012-11-29 イルデト・ベー・フェー White box cryptosystem with configurable keys using intermediate data modification

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030044003A1 (en) * 2001-08-14 2003-03-06 International Business Machines Corporation Space-efficient, side-channel attack resistant table lookups
US20060177052A1 (en) * 2002-05-23 2006-08-10 Hubert Gerardus T S-box encryption in block cipher implementations
US20070211890A1 (en) * 2006-03-07 2007-09-13 Research In Motion Limited Table splitting for cryptographic processes
JP2012530269A (en) * 2009-06-19 2012-11-29 イルデト・ベー・フェー White box cryptosystem with configurable keys using intermediate data modification

Also Published As

Publication number Publication date
JP6089664B2 (en) 2017-03-08

Similar Documents

Publication Publication Date Title
JP5229315B2 (en) Encryption device and built-in device equipped with a common key encryption function
Benvenuto Galois field in cryptography
JP5402632B2 (en) Common key block encryption apparatus, common key block encryption method, and program
JP5242560B2 (en) ENCRYPTION DEVICE, DECRYPTION DEVICE, ENCRYPTION METHOD, AND INTEGRATED CIRCUIT
JP5141558B2 (en) Common key block encryption apparatus, method thereof, program thereof, and recording medium
US7720225B2 (en) Table splitting for cryptographic processes
JP2008145791A (en) Encryption processing device, encryption processing method and computer program
EP1833190A1 (en) Table splitting for cryptographic processes
Jaffe A first-order DPA attack against AES in counter mode with unknown initial counter
JP5612007B2 (en) Encryption key generator
Waqas et al. Generation of AES-like S-boxes by replacing affine matrix
US9391770B2 (en) Method of cryption
JP2004258667A (en) Method for generating pseudo random permutation of word comprising n pieces of digits
KR101506499B1 (en) Method for encrypting with SEED applying mask
JP5202350B2 (en) Cryptographic processing apparatus, cryptographic processing method, and cryptographic processing program
CN106656500A (en) Encryption device and method
JP2010044251A (en) Hash value generator, program and hash value generation method
JP6136325B2 (en) Cryptographic processing apparatus, cryptographic processing method, and program
CN107493164B (en) DES encryption method and system based on chaotic system
JP6089664B2 (en) Cryptographic processing apparatus and method, and cryptographic processing program
Sharma et al. On security of Hill cipher using finite fields
CN110417540B (en) Information encryption method for resisting differential power analysis
US20100128870A1 (en) Pseudo-random number generation device, program, and method for stream encoding
RU2188513C2 (en) Method for cryptographic conversion of l-bit digital-data input blocks into l-bit output blocks
JP2006054568A (en) Encryption apparatus, decryption apparatus and method, and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151106

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160926

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161004

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161205

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170123

R150 Certificate of patent or registration of utility model

Ref document number: 6089664

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150