JP6360440B2 - Decoding device, method and program - Google Patents

Decoding device, method and program Download PDF

Info

Publication number
JP6360440B2
JP6360440B2 JP2015000953A JP2015000953A JP6360440B2 JP 6360440 B2 JP6360440 B2 JP 6360440B2 JP 2015000953 A JP2015000953 A JP 2015000953A JP 2015000953 A JP2015000953 A JP 2015000953A JP 6360440 B2 JP6360440 B2 JP 6360440B2
Authority
JP
Japan
Prior art keywords
bit
secret key
unit
decryption
power residue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2015000953A
Other languages
Japanese (ja)
Other versions
JP2016126211A (en
Inventor
有登 仲野
有登 仲野
清本 晋作
晋作 清本
三宅 優
優 三宅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
KDDI Corp
Original Assignee
KDDI 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 KDDI Corp filed Critical KDDI Corp
Priority to JP2015000953A priority Critical patent/JP6360440B2/en
Publication of JP2016126211A publication Critical patent/JP2016126211A/en
Application granted granted Critical
Publication of JP6360440B2 publication Critical patent/JP6360440B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、復号装置、方法及びプログラムに関する。   The present invention relates to a decoding device, a method, and a program.

従来より、公開鍵暗号の一つであるRSA暗号(非特許文献1)の復号処理a=b(mod n)の実装では、次のような実装が用いられている。ただし、aは平文、bは暗号文、dは秘密鍵を表し、p、qをそれぞれ素数とし、n=pqが成り立つ。
(1)dp,dq,iqの計算
dp=d(mod p−1)
dq=d(mod q−1)
iq=q−1(mod p)
(2)bp,bqの計算
bp=bdp(mod p)
bq=qdq(mod q)
(3)aの計算
tmp=(bp−bq)×iq(mod p)
a=tmp×q+bq
Conventionally, in the implementation of the decryption process a = b d (mod n) of the RSA cipher (Non-Patent Document 1), which is one of public key ciphers, the following implementation is used. However, a represents plaintext, b represents ciphertext, d represents a secret key, p and q are prime numbers, and n = pq holds.
(1) Calculation of dp, dq, iq dp = d (mod p−1)
dq = d (mod q-1)
iq = q −1 (mod p)
(2) Calculation of bp and bq bp = b dp (mod p)
bq = q dq (mod q)
(3) Calculation of a tmp = (bp−bq) × iq (mod p)
a = tmp × q + bq

このような復号処理中の演算過程では、秘密鍵がメモリやCPUレジスタに展開されるため、これらを狙った攻撃によって秘密鍵が漏えいするという危険性がある。これに対して、メモリ保護・レジスタ保護技術を適用することによってメモリやレジスタから鍵を抜き取る攻撃を防止することが可能である。例えば、特許文献1には、鍵などを秘匿するためのメモリ保護技術が開示されている。   In such a calculation process during the decryption process, since the secret key is expanded in the memory and the CPU register, there is a risk that the secret key is leaked by an attack aimed at them. On the other hand, by applying a memory protection / register protection technique, it is possible to prevent an attack of extracting a key from a memory or a register. For example, Patent Document 1 discloses a memory protection technique for concealing a key or the like.

特開2013−246678号公報JP 2013-246678 A

R.L.Rivest,A.Shamir,and L.Adelman: A Method for Obtaining Digital Signature and Public−key Cryptsystems, Technical Memo LCS/TM82; April 4,1977(Revised December 12,1977)R. L. Rivest, A.M. Shamir, and L.L. Adelman: A Method for Observing Digital Signature and Public-key Cryptsystems, Technical Memo LCS / TM82; April 4, 1977 (Revised Decem 77)

しかしながら、上述の実装において、鍵に関連する値であるp、qを保護しようとした場合、復号処理中のほぼすべての演算にp、qが現れるため、保護技術の適用によるオーバーヘッドが非常に大きくなり、パフォーマンス低下が著しいという問題がある。   However, in the above implementation, when p and q that are values related to the key are to be protected, p and q appear in almost all operations during the decryption process, so the overhead due to the application of the protection technique is very large. Therefore, there is a problem that the performance degradation is remarkable.

そこで、保護技術を適用した場合でも、復号処理が高速に動作するRSA実装が、望まれている。   Therefore, even when a protection technique is applied, an RSA implementation in which the decryption process operates at high speed is desired.

本発明は、RSA暗号における復号処理が、安全、かつ、高速な復号装置、方法及びプログラムを提供することを目的とする。   An object of the present invention is to provide a decryption apparatus, method, and program that are safe and have high speed decryption processing in RSA encryption.

具体的には、以下のような解決手段を提供する。
(1) RSA暗号における暗号文を復号する復号装置であって、乱数を発生させる乱数生成部と、秘密鍵を用いて前記暗号文を復号する復号演算部と、を備え、前記復号演算部は、複数の異なる前記乱数と前記秘密鍵とを含んだ排他的論理和の演算を混在させた演算により前記秘密鍵の各ビットを導出するビット導出部と、前記ビット導出部によって前記秘密鍵の最上位ビット又は最下位ビットから順に導出された前記各ビットの値を判定し、判定結果に応じた2乗算と乗算とを繰り返すことにより復号のためのべき剰余算を代替する、べき剰余算部と、を備える、復号装置。
Specifically, the following solutions are provided.
(1) A decryption device that decrypts a ciphertext in an RSA cipher, comprising: a random number generation unit that generates a random number; and a decryption operation unit that decrypts the ciphertext using a secret key, A bit derivation unit for deriving each bit of the secret key by an operation in which an exclusive OR operation including a plurality of different random numbers and the secret key is mixed; A power residue calculation unit that determines the value of each bit derived in order from the upper bit or the least significant bit and substitutes the power residue calculation for decoding by repeating the multiplication and multiplication according to the determination result; And a decoding device.

(1)に係る復号装置の復号処理は、秘密鍵から直接的に各ビットを導出しないで間接的に導出するので、秘密鍵の各ビットを導出する過程がメモリやCPUレジスタに展開されても、秘密鍵の各ビットの値について推測されることが困難である。さらに、復号処理において、2乗算と乗算とを繰り返す、べき剰余算は高速であり、各ビットの導出についての間接的な演算は、秘密鍵だけに限られているので、オーバーヘッドが抑制されている。
したがって、(1)に係る復号装置は、RSA暗号における復号処理が、安全、かつ、高速である。
Since the decryption process of the decryption apparatus according to (1) is indirectly derived without deriving each bit directly from the secret key, even if the process of deriving each bit of the secret key is developed in a memory or a CPU register It is difficult to guess about the value of each bit of the secret key. Furthermore, in the decryption process, the power-residue calculation that repeats two multiplications and multiplications is fast, and the indirect operation for deriving each bit is limited only to the secret key, so overhead is suppressed. .
Therefore, in the decryption device according to (1), the decryption process in the RSA encryption is safe and fast.

(2) データに対するアクセスのパターンを保護するアクセスパターン保護部を有する保護記憶部をさらに備え、前記復号演算部は、前記保護記憶部に記憶された前記秘密鍵を用いる、(1)に記載の復号装置。   (2) The apparatus according to (1), further including a protection storage unit having an access pattern protection unit that protects a pattern of access to data, wherein the decryption operation unit uses the secret key stored in the protection storage unit. Decoding device.

(2)に係る復号装置は、復号処理中に保護技術を適用する対象が秘密鍵だけでよい。
したがって、(2)に係る復号装置は、RSA暗号における復号処理に、保護技術を適用した場合でもオーバーヘッドが抑制され、高速である。
In the decryption device according to (2), only the secret key may be applied to the protection technique during the decryption process.
Therefore, the decryption apparatus according to (2) is high-speed with reduced overhead even when a protection technique is applied to the decryption process in the RSA encryption.

(3) 前記べき剰余算部は、前記秘密鍵の各ビットの値の判定に、前記各ビットの値と前記乱数との排他的論理和を用いる、(1)又は(2)に記載の復号装置。   (3) The decryption according to (1) or (2), wherein the power residue calculation unit uses an exclusive OR of the value of each bit and the random number to determine the value of each bit of the secret key. apparatus.

(3)に係る復号装置は、秘密鍵の導出された各ビットの値も間接的に判定するので、秘密鍵の各ビットの値を判定する過程がメモリやCPUレジスタに展開されても、秘密鍵の各ビットの値について推測されることが困難である。したがって、(3)に係る復号装置は、各ビットの導出の安全性に判定の安全性を加えて、さらに安全である。   Since the decryption device according to (3) also indirectly determines the value of each bit from which the secret key is derived, even if the process of determining the value of each bit of the secret key is expanded in the memory or CPU register, the secret It is difficult to guess about the value of each bit of the key. Therefore, the decoding apparatus according to (3) is more secure by adding the security of determination to the security of deriving each bit.

(4) 前記べき剰余算部は、前記ビット導出部によって導出されたビットを複数のビットにまとめた値で場合分けし、各場合に固有の2乗算と乗算との組み合わせを繰り返すことにより前記べき剰余算を代替する、(1)から(3)のいずれか一に記載の復号装置。   (4) The power residue calculation unit divides the bits derived by the bit deriving unit into a plurality of bits, and repeats a combination of unique multiplication and multiplication in each case. The decoding device according to any one of (1) to (3), which substitutes a residue calculation.

(4)に係る復号装置は、秘密鍵の各ビットの値をさらに間接的に判定するので、秘密鍵の各ビットの値について推測されることがさらに困難である。したがって、(4)に係る復号装置は、さらに安全である。   Since the decryption apparatus according to (4) further indirectly determines the value of each bit of the secret key, it is more difficult to infer the value of each bit of the secret key. Therefore, the decoding device according to (4) is more secure.

(5) 前記べき剰余算部は、ダミーの演算を混在させた演算をする、(1)から(4)のいずれか一に記載の復号装置。   (5) The decoding apparatus according to any one of (1) to (4), wherein the power residue calculation unit performs an operation in which dummy operations are mixed.

(5)に係る復号装置は、復号処理における秘密鍵に関するアルゴリズムの解読について困難化されているので、さらに安全である。   The decryption apparatus according to (5) is more secure because it is difficult to decrypt the algorithm related to the secret key in the decryption process.

(6) (1)に記載の復号装置が実行する方法であって、前記乱数生成部が、乱数を発生させる乱数ステップと、前記復号演算部が、秘密鍵を用いて前記暗号文を復号する復号演算ステップと、を備え、前記復号演算ステップは、前記ビット導出部が、複数の異なる前記乱数と前記秘密鍵とを含んだ排他的論理和の演算を混在させた演算により前記秘密鍵の各ビットを導出するビット導出ステップと、前記べき剰余算部が、前記ビット導出ステップによって前記秘密鍵の最上位ビット又は最下位ビットから順に導出された前記各ビットの値を判定し、判定結果に応じた2乗算と乗算とを繰り返すことにより復号のためのべき剰余算を代替する、べき剰余算ステップと、を備える、方法。   (6) A method executed by the decryption device according to (1), wherein the random number generation unit generates a random number, and the decryption operation unit decrypts the ciphertext using a secret key. A decryption operation step, wherein the decryption operation step is performed by the bit derivation unit by performing an operation in which exclusive OR operations including a plurality of different random numbers and the secret key are mixed. A bit deriving step for deriving a bit, and the power residue calculating unit determines a value of each bit derived in order from the most significant bit or the least significant bit of the secret key by the bit deriving step, and according to the determination result And a power residue calculation step of substituting power residue calculation for decoding by repeating two multiplications and multiplications.

したがって、(6)に係る方法は、(1)と同様に、RSA暗号における復号処理が、安全、かつ、高速である。   Therefore, in the method according to (6), similarly to (1), the decryption process in the RSA encryption is safe and fast.

(7) コンピュータに、(6)に記載の方法の各ステップを実行させるためのプログラム。   (7) A program for causing a computer to execute each step of the method according to (6).

したがって、(7)に係るプログラムは、RSA暗号における復号処理が、安全、かつ、高速であるように、コンピュータに機能させる。   Therefore, the program according to (7) causes the computer to function so that the decryption process in the RSA encryption is safe and high speed.

本発明によれば、RSA暗号における復号処理が、保護技術を適用した場合でも、安全、かつ、高速である。   According to the present invention, the decryption process in the RSA encryption is safe and fast even when the protection technique is applied.

本発明の実施形態1に係る復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the decoding apparatus which concerns on Embodiment 1 of this invention. 本発明の実施形態2に係る復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the decoding apparatus which concerns on Embodiment 2 of this invention.

[実施形態1]
以下、本発明の実施形態について、図を参照しながら説明する。図1は、本発明の実施形態1に係る復号装置10の構成を示すブロック図である。
復号装置10は、乱数生成部11と、復号演算部12とを備える。各部を詳述する。
[Embodiment 1]
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a decoding apparatus 10 according to Embodiment 1 of the present invention.
The decryption device 10 includes a random number generation unit 11 and a decryption calculation unit 12. Each part will be described in detail.

乱数生成部11は、乱数を発生させる。生成される乱数は、暗号学的に安全な乱数であることが望ましい。   The random number generator 11 generates a random number. The generated random number is preferably a cryptographically secure random number.

復号演算部12は、秘密鍵を用いて暗号文を復号する。復号演算部12は、ビット導出部121と、べき剰余算部122とを備える。具体的には、復号演算部12は、RSAの復号処理として、a=b(mod n)のべき剰余算をする。ここで、aは平文を表し、bは暗号文を表し、dは秘密鍵を表し、nは公開鍵をそれぞれ表す。復号演算部12は、べき剰余算を、ビット導出部121によって導出された各ビットに基づいて、べき剰余算部122による演算をする。 The decryption operation unit 12 decrypts the ciphertext using the secret key. The decoding calculation unit 12 includes a bit derivation unit 121 and a power residue calculation unit 122. Specifically, the decoding operation unit 12 performs a power residue calculation of a = b d (mod n) as RSA decoding processing. Here, a represents plaintext, b represents ciphertext, d represents a secret key, and n represents a public key. The decoding operation unit 12 performs an operation by the power residue calculation unit 122 on the basis of each bit derived by the bit deriving unit 121.

ビット導出部121は、複数の異なる乱数と秘密鍵dとを含んだ排他的論理和の演算を混在させた演算により秘密鍵dの各ビットを導出する。具体的には、ビット導出部121は、秘密鍵dを直接的に演算(例えば、シフト演算など)をするのではなく、間接的にi番目のビットを導出する(後述する<安全のための間接的なビット導出>参照)。   The bit deriving unit 121 derives each bit of the secret key d by an operation in which an exclusive OR operation including a plurality of different random numbers and the secret key d is mixed. Specifically, the bit deriving unit 121 does not directly calculate the secret key d (for example, shift operation), but indirectly derives the i-th bit (to be described later <for safety See Indirect Bit Derivation>).

べき剰余算部122は、ビット導出部121によって秘密鍵dの最上位ビット又は最下位ビットから順に導出された各ビットの値に基づいて、2乗算と乗算とを繰り返すことにより復号のためのべき剰余算を代替する。例えば、後述するアルゴリズム1は、秘密鍵dの最上位ビットから順に導出された各ビットの値に基づいて、2乗算と乗算とを繰り返す例である。同様に、後述するアルゴリズム2は、秘密鍵dの最下位ビットから順に導出された各ビットの値に基づいて、2乗算と乗算とを繰り返す例である。
このようなべき剰余算に、秘密鍵dの値を直接的に利用することのない演算(後述する<安全のための間接的なビット導出>)を組み込むと、組み込まれたべき剰余算は、演算の過程がメモリやCPUレジスタに展開されても、安全に実行可能である。
The power residue calculation unit 122 should perform the decryption by repeating the multiplication and multiplication based on the value of each bit sequentially derived from the most significant bit or the least significant bit of the secret key d by the bit deriving unit 121. Substitutes remainder calculation. For example, algorithm 1 to be described later is an example in which double multiplication and multiplication are repeated based on the value of each bit derived in order from the most significant bit of the secret key d. Similarly, algorithm 2, which will be described later, is an example in which double multiplication and multiplication are repeated based on the value of each bit sequentially derived from the least significant bit of the secret key d.
When an operation that does not directly use the value of the secret key d (<indirect bit derivation for security> described later) is incorporated in such a power residue calculation, Even if the operation process is developed in a memory or CPU register, it can be executed safely.

<高速のためのべき剰余算>
ここで、べき剰余算部122が実行する演算について、さらに説明する。
秘密鍵dの2進数は、数式1のように表される。
<Power residue calculation for high speed>
Here, the calculation executed by the power residue calculation unit 122 will be further described.
The binary number of the secret key d is expressed as Equation 1.

Figure 0006360440
Figure 0006360440

べき剰余算部122は、べき剰余を数式11のように計算する。   The power residue calculation unit 122 calculates the power residue as in Expression 11.

Figure 0006360440
Figure 0006360440

このべき剰余算(アルゴリズム1)は、次のように実装されることが可能である。
t[0]=1;
for(i=k−1;i>=0;i−−)

t[0]=t[0]*t[0] mod n;
t[1]=t[0]*b mod n;
t[0]=t[d[i]];
This power residue calculation (algorithm 1) can be implemented as follows.
t [0] = 1;
for (i = k−1; i> = 0; i−−)
{
t [0] = t [0] * t [0] mod n;
t [1] = t [0] * b mod n;
t [0] = t [d [i]];
}

べき剰余算部122は、べき剰余を数式12のように計算することもできる。   The power residue calculation unit 122 can also calculate the power residue as in Expression 12.

Figure 0006360440
Figure 0006360440

この、べき剰余算(アルゴリズム2)は、次のように実装されることが可能である。
t[0]=1;
x=b;
for(i=0;i<k;i++)

t[1]=t[0]*x mod n;
t[0]=t[d[i]];
x=x*x mod n;
This power residue calculation (algorithm 2) can be implemented as follows.
t [0] = 1;
x = b;
for (i = 0; i <k; i ++)
{
t [1] = t [0] * x mod n;
t [0] = t [d [i]];
x = x * x mod n;
}

復号装置10は、アルゴリズム1及びアルゴリズム2のどちらの場合も、保護対象は秘密鍵dのみであり、秘密鍵dの各ビットの値を判定し、判定結果に応じた2乗算と乗算とを繰り返し、高速な処理が可能である。   In both the algorithm 1 and the algorithm 2, the decryption device 10 is protected only by the secret key d, determines the value of each bit of the secret key d, and repeats the multiplication and multiplication according to the determination result. High-speed processing is possible.

<安全のための間接的な右シフト演算>
例えば、ビット導出部121は、数式2の演算により、間接的に秘密鍵dのiビット右シフトを行う。
((((d xor r) xor r xor r)>>i)xor r) xor ((r>>i) xor r)・・・数式2
<Indirect right shift operation for safety>
For example, the bit deriving unit 121 indirectly performs i-bit right shift of the secret key d by the calculation of Equation 2.
((((D xor r d ) xor r 0 xor r d ) >> i) xor r) xor (((r 0 >> i) xor r) Equation 2

ここで、数式2が、秘密鍵dのiビット右シフトに相当することについて説明する。
r、rz、d、は、それぞれ異なる乱数であるとし、次の演算式があるとする。
Z xor r=(((d xor r) xor r xor r)>>i)xor r
この演算式と、r=(r>>i) xor rとの排他的論理和を行うと、
左辺は、Zとなり、右辺は、乱数が消去され、(d>>i)となる。
すなわち、秘密鍵dのiビット右シフトは、数式2の演算を行うことにより、実現される。
Here, the fact that Equation 2 corresponds to an i-bit right shift of the secret key d will be described.
It is assumed that r, r z, r d, and r 0 are different random numbers, and there is the following arithmetic expression.
Z xor r z = (((d xor r d ) xor r 0 xor r d ) >> i) xor r
Performing an exclusive OR of this arithmetic expression and r z = (r 0 >> i) xor r,
The left side is Z, and the right side is the random number is erased and (d >> i).
That is, the i-bit right shift of the secret key d is realized by performing the calculation of Equation 2.

<安全のための間接的な論理積演算>
秘密鍵dと1との論理積演算は、例えば、数式3により行われ、間接的に秘密鍵d&1の値が求められる。
((d xor r)&(1 xor r)) xor (((d xor r)&r) xor (r&(1 xor r)) xor (r&r))・・・数式3
<Indirect AND operation for safety>
The logical product operation of the secret key d and 1 is performed by, for example, Expression 3, and the value of the secret key d & 1 is obtained indirectly.
((D xor r d ) & (1 xor r 1 )) xor (((d xor r d ) & r 1 ) xor (r d & (1 xor r 1 )) xor (r d & r 1 )) Formula 3

ここで、数式3が、秘密鍵d&1の値の導出に相当することについて説明する。
z、d、は、それぞれ異なる乱数であるとし、次の演算式があるとする。
Z xor r=(d xor r)&(1 xor r
この演算式と、r=((d xor r)&r) xor (r&(1 xor r)) xor (r&r)との排他的論理和を行うと、
左辺は、Zとなり、右辺は、乱数が消去され、(d&1)となる。
すなわち、秘密鍵d&1の値は、秘密鍵d&1の演算の代わりに、数式3の演算を行うことにより、求められる。
したがって、秘密鍵dのiビット目の値は、(d>>i)&1の演算の代わりに、数式2の演算と数式3の演算とを行うことにより、求められる。
このような、秘密鍵dの値を直接的に利用することのない演算は、演算の過程がメモリやCPUレジスタに展開されても、安全に実行可能である。
Here, it will be described that Equation 3 corresponds to derivation of the value of the secret key d & 1.
It is assumed that r z, r d, and r 1 are different random numbers, and there are the following arithmetic expressions.
Z xor r z = (d xor r d ) & (1 xor r 1 )
When this arithmetic expression is exclusive-ORed with r z = ((d xor r d ) & r 1 ) xor (r d & (1 xor r 1 )) xor (r d & r 1 ),
The left side is Z, and the right side is (d & 1) with the random number erased.
That is, the value of the secret key d & 1 is obtained by performing the calculation of Equation 3 instead of the calculation of the secret key d & 1.
Therefore, the value of the i-th bit of the secret key d is obtained by performing the calculations of Formula 2 and Formula 3 instead of the calculation of (d >> i) & 1.
Such an operation that does not directly use the value of the secret key d can be executed safely even if the operation process is expanded in a memory or a CPU register.

<安全のための間接的なビット判定>
べき剰余算部122は、秘密鍵dの各ビットの値の判定に、各ビットの値と乱数との排他的論理和を用いる。
具体的には、ビットの判定は、((d xor r)==(1 xor r))の判断によって行われる。ここで、dのビットの値は、数式2で求められた値&1(すなわち、d>>i&1の値)である。
すなわち、((d xor r)==(1 xor r))の判断が真の場合、dのビットの値は1であり、偽の場合、dのビットの値は0である。
べき剰余算部122は、このようなビットの判定によって、秘密鍵dのiビット目が0であるか1であるかを判定することで、秘密鍵dの値を直接的に利用せずに判定することが可能である。
このような、秘密鍵dの値を直接的に利用することのない判定は、演算の過程がメモリやCPUレジスタに展開されても、安全に実行可能である。
<Indirect bit judgment for safety>
The power residue calculation unit 122 uses the exclusive OR of the value of each bit and a random number to determine the value of each bit of the secret key d.
Specifically, the bit is determined by the determination of ((d i xor r) == (1 xor r)). Here, the bit value of d i is the value & 1 obtained by Equation 2 (that is, the value of d >> i & 1).
That is, if the determination is true ((d i xor r) == (1 xor r)), the bit value of d i is 1, if false, the bit value of d i is 0.
The power residue calculation unit 122 determines whether the i-th bit of the secret key d is 0 or 1 by such bit determination, so that the value of the secret key d is not directly used. It is possible to determine.
Such a determination that does not directly use the value of the secret key d can be safely executed even if the calculation process is expanded in the memory or the CPU register.

<安全のための複数ビットの判定>
さらに、べき剰余算部122は、ビット導出部121によって導出されたビットを複数のビットにまとめた値で場合分けして2乗算と乗算とを組み合わせ、べき剰余算を代替する。べき剰余算部122は、複数のビットをまとめて判定することで秘密鍵dのiビット目の推測をさらに困難にすることが可能である。
<Decision of multiple bits for safety>
Further, the power residue calculation unit 122 substitutes the power residue calculation by dividing the bits derived by the bit deriving unit 121 into a plurality of bits and combining two multiplications and multiplications. The power residue calculation unit 122 can make it more difficult to estimate the i-th bit of the secret key d by collectively determining a plurality of bits.

例えば、べき剰余算部122は、秘密鍵dのiビット目とi+1ビット目を一度に判定し、00、01、10、11の4とおりに場合分けする。   For example, the power residue calculation unit 122 determines the i-th bit and the i + 1-th bit of the secret key d at once, and divides the case into four cases of 00, 01, 10, and 11.

例えば、後述するアルゴリズム4において、判定した値が00の場合は、秘密鍵dのiビット目が0の処理と、i+1ビット目が0の処理とを、次のように行う。
t=t*1 mod n;
x=x*x mod n;
t=t*1 mod n;
x=x*x mod n;
For example, in the algorithm 4 to be described later, when the determined value is 00, the process in which the i-th bit of the secret key d is 0 and the process in which the i + 1-th bit is 0 are performed as follows.
t = t * 1 mod n;
x = x * x mod n;
t = t * 1 mod n;
x = x * x mod n;

例えば、判定した値が10の場合は、秘密鍵dのiビット目が1の処理と、i+1ビット目が0の処理とを、次のように行う。
t=t*x mod n;
x=x*x mod n;
t=t*1 mod n;
x=x*x mod n;
For example, when the determined value is 10, the process in which the i-th bit of the secret key d is 1 and the process in which the i + 1-th bit is 0 are performed as follows.
t = t * x mod n;
x = x * x mod n;
t = t * 1 mod n;
x = x * x mod n;

<安全のためのダミー演算の混在>
べき剰余算部122は、ダミーの演算を混在させた演算をする。
<Mixed dummy operations for safety>
The power residue calculation unit 122 performs an operation in which dummy operations are mixed.

上述のアルゴリズム1に、以下のようにダミーの演算を追加することで、べき剰余算部122は、ダミーの演算が混在するアルゴリズム3を実行する。ここで、bは暗号文である。この処理によって最終的に得られるtの値が平文aと等しくなる。   By adding a dummy calculation as described below to the algorithm 1, the power residue calculation unit 122 executes the algorithm 3 in which the dummy calculation is mixed. Here, b is a ciphertext. The value of t finally obtained by this processing becomes equal to the plaintext a.

<アルゴリズム3>
t=1;
for(i=k−1;i>=0;i−−)

t=t*t (mod n);
if(d[i]==1)
t=t*b mod n;
else()
t=t*1 mod n;
<Algorithm 3>
t = 1;
for (i = k−1; i> = 0; i−−)
{
t = t * t (mod n);
if (d [i] == 1)
t = t * b mod n;
else ()
t = t * 1 mod n;
}

同様に、アルゴリズム2に、以下のようにダミーの演算を追加することで、べき剰余算部122は、ダミーの演算が混在するアルゴリズム4を実行する。   Similarly, by adding a dummy operation to the algorithm 2 as described below, the power residue calculation unit 122 executes the algorithm 4 in which dummy operations are mixed.

<アルゴリズム4>
t=1;
x=b;
for(i=0;i<k;i++)

if(d[i]==1)
t=t*x(mod n);
else()
t=t*1 mod n;
x=x*x (mod n);
<Algorithm 4>
t = 1;
x = b;
for (i = 0; i <k; i ++)
{
if (d [i] == 1)
t = t * x (mod n);
else ()
t = t * 1 mod n;
x = x * x (mod n);
}

上述のように、保護対象が秘密鍵dのみなので、オーバーヘッドを抑制することができ、復号装置10は、復号処理を、安全のための特別の演算であって、秘密鍵dを直接的に利用せずに間接的に利用するような特別の演算に代替することが可能である。また、復号装置10は、復号処理を、安全のためのアルゴリズムであって、秘密鍵dに関する処理にダミーの演算を追加し、アルゴリズムの難読化により秘密鍵dの推測を困難にするためのアルゴリズムに代替することが可能である。   As described above, since only the secret key d is protected, overhead can be suppressed, and the decryption apparatus 10 performs decryption processing as a special operation for safety, and directly uses the secret key d. It is possible to substitute for a special operation that is used indirectly without using it. Further, the decryption apparatus 10 is an algorithm for safety of decryption, and adds a dummy operation to the process related to the secret key d, and makes it difficult to guess the secret key d by obfuscation of the algorithm. It is possible to substitute.

[実施形態2]
実施形態2は、安全のために保護記憶部を適用した実施形態である。
復号装置10は、実施形態1の構成に加えて、保護記憶部30をさらに備える。乱数生成部11と、復号演算部12とについては、実施形態1と同様である。
[Embodiment 2]
The second embodiment is an embodiment in which a protection storage unit is applied for safety.
The decryption device 10 further includes a protection storage unit 30 in addition to the configuration of the first embodiment. The random number generation unit 11 and the decryption calculation unit 12 are the same as those in the first embodiment.

保護記憶部30(例えば、メインメモリ)は、データに対するアクセスのパターンを保護するアクセスパターン保護部31を有し、データを秘匿して記憶する。
アクセスパターン保護部31は、例えば、書き出し処理(例えば、データをキャッシュメモリから保護記憶部30に戻すとき)において、保護記憶部30へデータを書き出すときのアドレスを、保護記憶部30からデータを読み出したときのアドレスとは異なるアドレスに変更する。その結果、アクセスパターン保護部31は、データを読み出す保護記憶部30のアドレスを都度変化させる。このように、アクセスパターン保護部31は、読み出し処理及び書き出し処理におけるアドレスが同一のアドレスとなって、同じパターンのアクセスが発生することを防止する。アクセスパターン保護部31は、例えば、ORAM(Oblivious RAM)において実現されている。
The protection storage unit 30 (for example, main memory) has an access pattern protection unit 31 that protects an access pattern for data, and stores the data in a secret manner.
For example, the access pattern protection unit 31 reads the data from the protection storage unit 30 and the address for writing the data to the protection storage unit 30 in the writing process (for example, when returning data from the cache memory to the protection storage unit 30). Change the address to a different address. As a result, the access pattern protection unit 31 changes the address of the protection storage unit 30 from which data is read each time. As described above, the access pattern protection unit 31 prevents the addresses in the read process and the write process from having the same address and the same pattern access. The access pattern protection unit 31 is realized by, for example, an ORAM (Obvious RAM).

復号演算部12は、保護記憶部30に記憶された秘密鍵dを用い、ビット導出部121及びべき剰余算部122により、実施形態1において説明した演算をする。   The decryption calculation unit 12 uses the secret key d stored in the protection storage unit 30 to perform the calculation described in the first embodiment by the bit derivation unit 121 and the power residue calculation unit 122.

保護が必要となるのは秘密鍵dだけであるため、オーバーヘッドが抑制され、復号装置10は、演算中に秘密鍵dを保護記憶部30に安全に保護しながら、パフォーマンスの著しい低下を招くことなく、高速に復号する。
さらに、復号装置10は、保護記憶部30による秘密鍵dの安全な保護と、安全のための特別な演算などとを組み合わせて保護技術を適用しても、オーバーヘッドが抑制され、パフォーマンスの著しい低下を招くことなく、高速に復号する。
Since only the secret key d needs to be protected, the overhead is suppressed, and the decryption apparatus 10 causes the performance to drop significantly while protecting the secret key d in the protection storage unit 30 safely during the operation. Without decoding.
Furthermore, even if the decryption apparatus 10 applies the protection technique by combining the safe protection of the secret key d by the protection storage unit 30 and the special operation for safety, the overhead is suppressed and the performance is significantly reduced. Without incurring high-speed decoding.

本実施形態によれば、復号装置10の復号処理は、秘密鍵dから直接的に各ビットを導出しないで間接的に導出するので、秘密鍵dの各ビットを導出する過程がメモリやCPUレジスタに展開されても、秘密鍵dの各ビットの値について推測されることが困難であり、安全である。復号装置10の復号処理は、2乗算と乗算とを繰り返す、べき剰余算によって処理され高速であり、各ビットの導出についての間接的な演算が秘密鍵dだけに限られているので、オーバーヘッドが抑制され、高速である。
さらに、復号装置10の復号処理は、アクセスパターン保護部31を有する保護記憶部30を適用した場合でも、適用される範囲が秘密鍵d及び秘密鍵dに関する演算に限られているので、オーバーヘッドが抑制され、高速である。
復号装置10の復号処理は、秘密鍵dの各ビットの値の判定において、秘密鍵dを間接的に利用するので、演算の過程がメモリやCPUレジスタに展開されても、秘密鍵dの各ビットの値について推測されることが困難であり、安全である。
復号装置10の復号処理は、秘密鍵dに関するアルゴリズムが、秘密鍵dの各ビットを複数のビットにまとめた値での場合分けや、ダミーの演算の挿入により、難読化され、演算の過程がメモリやCPUレジスタに展開されても、秘密鍵dの各ビットの値について推測されることが困難であり、安全である。
したがって、復号装置10は、保護技術を適用した場合でも、オーバーヘッドが抑制され、従来の実装ではできなかった、安全、かつ、高速な復号を行う。
According to the present embodiment, since the decryption process of the decryption device 10 is indirectly derived without directly deriving each bit from the secret key d, the process of deriving each bit of the secret key d is a memory or CPU register. However, it is difficult to guess the value of each bit of the secret key d, and it is safe. The decryption process of the decryption device 10 is performed by power residue calculation that repeats two multiplications and multiplications, and is high-speed. Since indirect operations for deriving each bit are limited only to the secret key d, overhead is reduced. Suppressed and fast.
Furthermore, the decryption process of the decryption apparatus 10 is limited to the calculation related to the secret key d and the secret key d, even when the protection storage unit 30 having the access pattern protection unit 31 is applied. Suppressed and fast.
Since the decryption process of the decryption device 10 indirectly uses the secret key d in the determination of the value of each bit of the secret key d, each of the secret key d can be obtained even if the calculation process is expanded in the memory or the CPU register. It is difficult to guess about the value of the bit and it is safe.
In the decryption process of the decryption device 10, the algorithm related to the secret key d is obfuscated by dividing each bit of the secret key d into a plurality of bits or inserting a dummy operation, and the process of the operation is Even if it is expanded in a memory or a CPU register, it is difficult to guess the value of each bit of the secret key d, and it is safe.
Therefore, even when the protection technique is applied, the decryption device 10 suppresses overhead, and performs safe and high-speed decryption that was not possible with the conventional implementation.

以上、本発明の実施形態について説明したが、本発明は上述した実施形態に限るものではない。また、本発明の実施形態に記載された効果は、本発明から生じる最も好適な効果を列挙したに過ぎず、本発明による効果は、本発明の実施形態に記載されたものに限定されるものではない。   As mentioned above, although embodiment of this invention was described, this invention is not restricted to embodiment mentioned above. The effects described in the embodiments of the present invention are only the most preferable effects resulting from the present invention, and the effects of the present invention are limited to those described in the embodiments of the present invention. is not.

復号装置10による一連の処理は、ソフトウェアにより行うこともできる。一連の処理をソフトウェアによって行う場合には、そのソフトウェアを構成するプログラムが、汎用のコンピュータなどにインストールされる。また、当該プログラムは、コンピュータ読み取り可能な記録媒体(例えば、CD−ROMのようなリムーバブルメディアなど)に記録されてユーザに配布されてもよいし、ネットワークを介してユーザのコンピュータにダウンロードされることにより配布されてもよい。   A series of processing by the decoding device 10 can also be performed by software. When a series of processing is performed by software, a program constituting the software is installed in a general-purpose computer or the like. The program may be recorded on a computer-readable recording medium (for example, a removable medium such as a CD-ROM) and distributed to the user, or may be downloaded to the user's computer via a network. May be distributed.

10 復号装置
11 乱数生成部
12 復号演算部
121 ビット導出部
122 べき剰余算部
30 保護記憶部
31 アクセスパターン保護部
DESCRIPTION OF SYMBOLS 10 Decoding apparatus 11 Random number generation part 12 Decoding operation part 121 Bit derivation part 122 Power remainder calculation part 30 Protection memory | storage part 31 Access pattern protection part

Claims (7)

RSA暗号における暗号文を復号する復号装置であって、
乱数を発生させる乱数生成部と、
秘密鍵を用いて前記暗号文を復号する復号演算部と、を備え、
前記復号演算部は、
複数の異なる前記乱数と前記秘密鍵とを含んだ排他的論理和の演算を混在させた演算により前記秘密鍵の各ビットを導出するビット導出部と、
前記ビット導出部によって前記秘密鍵の最上位ビット又は最下位ビットから順に導出された前記各ビットの値を判定し、判定結果に応じた2乗算と乗算とを繰り返すことにより復号のためのべき剰余算を代替する、べき剰余算部と、を備える、
復号装置。
A decryption device for decrypting ciphertext in the RSA cipher,
A random number generator for generating random numbers;
A decryption operation unit that decrypts the ciphertext using a secret key,
The decoding operation unit
A bit derivation unit for deriving each bit of the secret key by an operation in which an exclusive OR operation including a plurality of different random numbers and the secret key is mixed,
The value of each bit derived in order from the most significant bit or the least significant bit of the secret key by the bit deriving unit is determined, and by performing multiplication and multiplication according to the determination result, a power residue for decryption A power residue calculation unit that replaces the calculation,
Decoding device.
データに対するアクセスのパターンを保護するアクセスパターン保護部を有する保護記憶部をさらに備え、
前記復号演算部は、前記保護記憶部に記憶された前記秘密鍵を用いる、
請求項1に記載の復号装置。
A protection storage unit having an access pattern protection unit for protecting a pattern of access to data;
The decryption operation unit uses the secret key stored in the protection storage unit.
The decoding device according to claim 1.
前記べき剰余算部は、前記秘密鍵の各ビットの値の判定に、前記各ビットの値と前記乱数との排他的論理和を用いる、請求項1又は2に記載の復号装置。   The decryption apparatus according to claim 1 or 2, wherein the power residue calculation unit uses an exclusive OR of the value of each bit and the random number for determination of the value of each bit of the secret key. 前記べき剰余算部は、前記ビット導出部によって導出されたビットを複数のビットにまとめた値で場合分けし、各場合に固有の2乗算と乗算との組み合わせを繰り返すことにより前記べき剰余算を代替する、請求項1から3のいずれか一項に記載の復号装置。   The power residue calculation unit divides the bits derived by the bit deriving unit into a plurality of bits, and repeats the combination of two multiplications and multiplications specific to each case to perform the power residue calculation. The decoding device according to any one of claims 1 to 3, which is substituted. 前記べき剰余算部は、ダミーの演算を混在させた演算をする、請求項1から4のいずれか一項に記載の復号装置。   The decoding apparatus according to any one of claims 1 to 4, wherein the power residue calculation unit performs an operation in which dummy operations are mixed. 請求項1に記載の復号装置が実行する方法であって、
前記乱数生成部が、乱数を発生させる乱数ステップと、
前記復号演算部が、秘密鍵を用いて前記暗号文を復号する復号演算ステップと、を備え、
前記復号演算ステップは、
前記ビット導出部が、複数の異なる前記乱数と前記秘密鍵とを含んだ排他的論理和の演算を混在させた演算により前記秘密鍵の各ビットを導出するビット導出ステップと、
前記べき剰余算部が、前記ビット導出ステップによって前記秘密鍵の最上位ビット又は最下位ビットから順に導出された前記各ビットの値を判定し、判定結果に応じた2乗算と乗算とを繰り返すことにより復号のためのべき剰余算を代替する、べき剰余算ステップと、を備える、
方法。
A method performed by the decoding device according to claim 1, comprising:
The random number generation unit generates a random number; and
The decryption operation unit comprises a decryption operation step of decrypting the ciphertext using a secret key,
The decoding operation step includes
A bit derivation step in which the bit derivation unit derives each bit of the secret key by an operation in which an exclusive OR operation including a plurality of different random numbers and the secret key is mixed; and
The power residue calculation unit determines the value of each bit derived in order from the most significant bit or the least significant bit of the secret key in the bit deriving step, and repeats two multiplications and multiplications according to the determination result A power residue calculation step for substituting power residue calculation for decoding by
Method.
コンピュータに、請求項6に記載の方法の各ステップを実行させるためのプログラム。   The program for making a computer perform each step of the method of Claim 6.
JP2015000953A 2015-01-06 2015-01-06 Decoding device, method and program Active JP6360440B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015000953A JP6360440B2 (en) 2015-01-06 2015-01-06 Decoding device, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015000953A JP6360440B2 (en) 2015-01-06 2015-01-06 Decoding device, method and program

Publications (2)

Publication Number Publication Date
JP2016126211A JP2016126211A (en) 2016-07-11
JP6360440B2 true JP6360440B2 (en) 2018-07-18

Family

ID=56359419

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015000953A Active JP6360440B2 (en) 2015-01-06 2015-01-06 Decoding device, method and program

Country Status (1)

Country Link
JP (1) JP6360440B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6996561B2 (en) 2017-09-05 2022-01-17 日本電気株式会社 Systems, modifiers, methods and programs

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4962165B2 (en) * 2007-06-22 2012-06-27 大日本印刷株式会社 Cryptographic processing apparatus, cryptographic processing program, and cryptographic processing method
US8670557B2 (en) * 2007-09-10 2014-03-11 Spansion Llc Cryptographic system with modular randomization of exponentiation
JP4772081B2 (en) * 2008-04-21 2011-09-14 富士通株式会社 Tamper resistant elliptic curve cryptography using secret key
JP2010008883A (en) * 2008-06-30 2010-01-14 Toshiba Corp Arithmetic device for cipher, arithmetic method for cipher, and program
WO2012090288A1 (en) * 2010-12-27 2012-07-05 富士通株式会社 Cryptographic processing device, method of cryptographic processing and program

Also Published As

Publication number Publication date
JP2016126211A (en) 2016-07-11

Similar Documents

Publication Publication Date Title
JP5167348B2 (en) Software encryption method, software decryption method, software encryption device, and software decryption device
JP5572610B2 (en) Transpose data conversion for security enhancement
US9565018B2 (en) Protecting cryptographic operations using conjugacy class functions
JP2001337599A (en) Scalar-fold calculating method and device for elliptic curve cipher, and storage medium
JP5929905B2 (en) Order-preserving encryption system, apparatus, method, and program
US8280042B2 (en) Decryption processor and decryption processing method
KR20180110550A (en) Method and apparatus for white-box cryptography for protecting against side channel analysis
JP2014085674A5 (en)
CN111385092B (en) Cipher device using information blinding and its cipher processing method
JP2006311383A (en) Data managing method, data management system and data managing device
JP5742960B2 (en) Cryptographic apparatus and method and program
JP2010068135A (en) Fraudulent operation detection circuit, apparatus having the same, and fraudulent operation detection method
JP6360440B2 (en) Decoding device, method and program
JP2020034662A (en) Id base hash verification system component, id base code device, id base hash verification system configuration method and program
KR101440680B1 (en) Homomorphic Encryption and Decryption Method using Chinese Remainder Theorem and apparatus using the same
JP5113630B2 (en) Secret sharing method, program, and apparatus
JP6249915B2 (en) Storage device, method and program
CN112134701B (en) Encryption method capable of repudiating editing of sensitive keywords
KR20090004625A (en) Changing the order of public key cryptographic computations
WO2021130935A1 (en) Digital watermark embedding device, digital watermark extraction device, digital watermark embedding method, digital watermark extraction method, and program
JP6452910B1 (en) Secret analysis device, secret analysis system, secret analysis method, and secret analysis program
JP6876423B2 (en) Internal state initializer, method and program in stream cipher
JPWO2015173905A1 (en) Encryption device, storage system, decryption device, encryption method, decryption method, encryption program, and decryption program
US20210409208A1 (en) Cryptographic processing method, related electronic device and computer program
JP2012242573A (en) Decoding processing apparatus, decoding processing method and decoding processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170816

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180501

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180622

R150 Certificate of patent or registration of utility model

Ref document number: 6360440

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150