JP2000200038A - Method and device for generating prime number, and rsa encipherment system and record medium - Google Patents

Method and device for generating prime number, and rsa encipherment system and record medium

Info

Publication number
JP2000200038A
JP2000200038A JP10377682A JP37768298A JP2000200038A JP 2000200038 A JP2000200038 A JP 2000200038A JP 10377682 A JP10377682 A JP 10377682A JP 37768298 A JP37768298 A JP 37768298A JP 2000200038 A JP2000200038 A JP 2000200038A
Authority
JP
Japan
Prior art keywords
prime
generating
prime number
key
random number
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.)
Withdrawn
Application number
JP10377682A
Other languages
Japanese (ja)
Inventor
Koichi Ito
孝一 伊藤
Masahiko Takenaka
正彦 武仲
Kazuhiro Yokoyama
和弘 横山
Naoya Torii
直哉 鳥居
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP10377682A priority Critical patent/JP2000200038A/en
Publication of JP2000200038A publication Critical patent/JP2000200038A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To generate a prime number with a high speed used for a prime number key of an RSA cryptograph resistant to repeated ciphering attacks. SOLUTION: In this prime number generating method, a prime number p0' is generated and a random number Sp0 is generated and it is judged whether or not p0=Sp0p0'+1 is a prime number, and if p0 is a prime number, a random number Rp is generated and it is judged whether or not the random number Rp satisfies the below-mentioned conditions (x), (y), and when the random number Rp satisfies (x), (y), it is judged whether or not p=Rp p0+1 is a prime number, and further judged whether or not the random number Rp satisfies the condition (z), and if the condition (z) is satisfied, the (p) is outputted as a prime number becoming a prime number key of the RSA cryptograph. The conditions (x), (y), (z) are; Rp=WrpRp'... (x), Rp'=SrpRp" +1... (y), gcd (eup-1, p-1)<=Srp... (z). Where, Rp', Rp": prime number, Srp, Srp: the product of the prime numbers, e: ciphering key of RSA cryptograph, and up=1 cm (Srp, Sp0).

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、例えばRSA暗号
方式における素数鍵となる素数を生成する方法及び装
置、並びに、生成したその素数を用いるRSA暗号化方
法及びその素数生成のプログラムを記録した記録媒体に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and an apparatus for generating a prime number serving as a prime key in, for example, an RSA encryption method, an RSA encryption method using the generated prime number, and a recording recording a program for generating the prime number. Regarding the medium.

【0002】[0002]

【従来の技術】素因数分解の困難さを利用した公開鍵暗
号系のRSA暗号方式における暗号文は、mを平文、e
を暗号化鍵、nを公開鍵とした場合に、me (mod n)
で表される。この暗号文me に対して、me ,(me
e ,((me e e ,・・・のように暗号化を何回も繰
り返すことにより、下記式に示すように平文mを得ると
いう攻撃、所謂、繰り返し暗号化攻撃が知られている。
2. Description of the Related Art A ciphertext in an RSA cryptosystem of a public key cryptosystem utilizing the difficulty of factorization of a factor is expressed as follows:
Is an encryption key and n is a public key, m e (mod n)
It is represented by For this cipher text me , me , ( me )
e , ((m e ) e ) An attack in which plaintext m is obtained as shown in the following equation by repeating encryption many times as in e ,. I have.

【0003】[0003]

【数1】 (Equation 1)

【0004】このような暗号化攻撃によって解読される
暗号文の個数は、RSA暗号の鍵として用いる2つの素
数鍵p,qの性質に大きく依存する。よって、RSA暗
号の素数鍵p,qの生成法に工夫を行うことにより、R
SA暗号文の繰り返し暗号化攻撃に対する強度を高める
ことができる。
[0004] The number of ciphertexts decrypted by such an encryption attack largely depends on the properties of two prime keys p and q used as RSA encryption keys. Therefore, by devising a method for generating the prime keys p and q of the RSA encryption, R
The strength against repeated encryption attacks on the SA cipher text can be increased.

【0005】繰り返し暗号化攻撃に対する対策として、
本発明者等は以下のような素数生成方法(以下、従来例
という)を提案している(特願平9−205074号)。この
従来例では、繰り返し暗号化攻撃に弱い暗号文の個数を
少数に限定できるように、以下の(1)〜(4)の条件
を満たす素数p,qをRSA暗号の素数鍵とする。
As a countermeasure against repeated encryption attacks,
The present inventors have proposed the following prime number generation method (hereinafter, referred to as a conventional example) (Japanese Patent Application No. 9-205074). In this conventional example, prime numbers p and q satisfying the following conditions (1) to (4) are used as prime keys of the RSA encryption so that the number of ciphertexts vulnerable to repeated encryption attacks can be limited to a small number.

【0006】 (1) p=2Rp 0 +1 q=2Rq 0 +1 (Rp ,Rq ,p0 ,q0 :素数) (2) Rp =2xpypp ′+1 (Rp ′,Rq ′:素数, Rq =2xqyqq ′+1 xp,xq,yp,yq≧1) (3) p0 =2p0 ′+1 q0 =2q0 ′+1 (p0 ′,q0 ′:素数) (4) gcd(ez ,(p−1)(q−1)/4)=1 (z=2xpq ypq ,xpq =max(xp,xq),ypq =max(yp,yq), max(a,b)=a(a>bの場合),b(a≦bの場合)[0006] (1) p = 2R p p 0 +1 q = 2R q q 0 +1 (R p, R q, p 0, q 0: prime) (2) R p = 2 xp 3 yp R p '+1 ( R p ', R q ': prime number, R q = 2 xq 3 yq R q '+1 xp, xq, yp, yq ≧ 1) (3) p 0 = 2p 0 ' +1 q 0 = 2q 0 '+1 (p 0 ', q 0': prime) (4) gcd (e z , (p-1) (q-1) / 4) = 1 (z = 2 xpq 3 ypq, xpq = max (xp, xq), ypq = Max (yp, yq), max (a, b) = a (when a> b), b (when a ≦ b)

【0007】[0007]

【発明が解決しようとする課題】上記(1)〜(4)の
判定条件を満たすp,qをRSA暗号の素数鍵として用
いた場合、繰り返し暗号化攻撃に弱い暗号文は4個だけ
になり、非常に安全性が高い鍵を生成できる。しかしな
がら、この(1)〜(4)の条件を満たす素数は非常に
少ないので、鍵生成に要する時間が膨大になるという問
題があり、改善が望まれている。
When p and q satisfying the above conditions (1) to (4) are used as a prime key of the RSA encryption, only four ciphertexts are vulnerable to repeated encryption attacks. , Can generate a very secure key. However, since the prime numbers satisfying the conditions (1) to (4) are very small, there is a problem that the time required for key generation becomes enormous, and improvement is desired.

【0008】本発明は斯かる事情に鑑みてなされたもの
であり、繰り返し暗号化攻撃に弱い暗号文の個数を4個
に抑える場合においても、上述した従来例よりも高速に
RSA暗号の素数鍵を生成できる素数生成方法及び装
置、並びに、生成したその素数を素数鍵に用いるRSA
暗号化方法及びその素数生成のプログラムを記録した記
録媒体を提供することを目的とする。
The present invention has been made in view of such circumstances, and even when the number of ciphertexts that are vulnerable to repeated encryption attacks is reduced to four, the prime number key of the RSA encryption is faster than the above-described conventional example. And method for generating a prime number, and an RSA using the generated prime number as a prime key
An object of the present invention is to provide a recording medium on which an encryption method and a program for generating a prime number thereof are recorded.

【0009】本発明の他の目的は、繰り返し暗号化攻撃
に弱い暗号文の個数を4個より多くする場合にもRSA
暗号の素数鍵を生成できる素数生成方法及び装置、並び
に、生成したその素数を素数鍵に用いるRSA暗号化方
法及びその素数生成のプログラムを記録した記録媒体を
提供することにある。
Another object of the present invention is to provide an RSA even when the number of ciphertexts vulnerable to repeated encryption attacks is set to more than four.
It is an object of the present invention to provide a method and an apparatus for generating a prime number capable of generating a cryptographic prime key, an RSA encryption method using the generated prime number as a prime key, and a recording medium recording a program for generating the prime number.

【0010】[0010]

【課題を解決するための手段】請求項1に係る素数生成
方法は、RSA暗号の素数鍵となる素数を生成する方法
において、素数p0 ′を生成するステップと、乱数Sp0
を生成するステップと、p0 =Sp00 ′+1が素数で
あるか否かを判定するステップと、該p0 が素数である
場合に、乱数Rp を生成するステップと、該乱数Rp
以下の(a),(b)の条件を満たすか否かを判定する
ステップと、前記乱数Rp が(a),(b)の条件を満
たす場合に、p=Rp 0 +1が素数であるか否かを判
定するステップと、以下の(c)の条件を満たすか否か
を判定するステップと、(c)の条件を満たす場合に、
そのpを前記素数鍵となる素数として生成するステップ
とを有することを特徴とする。 Rp =SRpp …(a) rp =Srpp ′+1 …(b) gcd(eup−1,p−1)≦SRp …(c) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0
Prime number generation method according to claim 1 Means for Solving the Problems] it is a method for generating a prime number which is a prime RSA key cryptography, and generating a prime number p 0 ', the random number S p0
, Determining whether p 0 = S p0 p 0 '+1 is a prime number, generating a random number R p when p 0 is a prime number, p is equal to or less than (a), determining whether or not the condition (b), the random number R p is (a), in the case where satisfies the (b), p = R p p 0 +1 Determining whether or not is a prime number; determining whether or not the following condition (c) is satisfied;
Generating p as a prime number serving as the prime number key. R p = S Rp r p ... (a) r p = S rp R p '+1 ... (b) gcd (e up -1, p-1) ≦ S Rp ... (c) where, r p, R p' : Prime numbers S Rp , S rp : product of prime numbers e: RSA encryption key up = lcm (S rp , S p0 )

【0011】請求項2に係る素数生成方法は、RSA暗
号の素数鍵となる素数を生成する方法において、素数p
0 ′を生成するステップと、乱数Sp0を生成するステッ
プと、p0 =Sp00 ′+1が素数であるか否かを判定
するステップと、該p0 が素数である場合に、乱数Rp
を生成するステップと、該乱数Rp が以下の(d),
(e),(f)の条件を満たすか否かを判定するステッ
プと、前記乱数Rp が(d),(e),(f)の条件を
満たす場合に、p=Rp 0 +1が素数であるか否かを
判定するステップと、以下の(g)の条件を満たすか否
かを判定するステップと、(g)の条件を満たす場合
に、そのpを前記素数鍵となる素数として生成するステ
ップとを有することを特徴とする。 Rp =SRpp …(d) rp =Srpp ′+1 …(e) SRp 2 ≦w …(f) gcd(eup−1,p−1)≦SRp …(g) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0) w:繰り返し暗号化攻撃に弱い暗号文の最大個数
According to a second aspect of the present invention, in the method for generating a prime number serving as a prime key of the RSA encryption, the prime number p
0 ′, generating a random number S p0 , determining whether p 0 = S p0 p 0 ′ +1 is a prime number, and determining whether p 0 is a prime number. R p
And generating the random number R p by the following (d),
Determining whether the conditions of (e) and (f) are satisfied; and, if the random number R p satisfies the conditions of (d), (e) and (f), p = R p p 0 +1 Determining whether or not is a prime number; determining whether or not the following condition (g) is satisfied; and, if the condition of (g) is satisfied, replacing p with the prime number serving as the prime key And generating it as R p = S Rp r p ... (d) r p = S rp R p '+1 ... (e) S Rp 2 ≦ w ... (f) gcd (e up -1, p-1) ≦ S Rp ... (g ) Where r p , R p ′: prime S Rp , S rp : product of primes e: RSA encryption key up = lcm (S rp , S p0 ) w: maximum of ciphertext vulnerable to repeated encryption attacks Quantity

【0012】請求項3に係る素数生成装置は、RSA暗
号の素数鍵となる素数を生成する装置において、素数p
0 ′を生成する手段と、乱数Sp0を生成する手段と、p
0 =Sp00 ′+1が素数であるか否かを判定する手段
と、該p0 が素数である場合に、乱数Rp を生成する手
段と、該乱数Rp が以下の(h),(i)の条件を満た
すか否かを判定する手段と、前記乱数Rp が(h),
(i)の条件を満たす場合に、p=Rp 0 +1が素数
であるか否かを判定する手段と、以下の(j)の条件を
満たすか否かを判定する手段と、(j)の条件を満たす
場合に、そのpを前記素数鍵となる素数として生成する
手段とを備えることを特徴とする。 Rp =SRpp …(h) rp =Srpp ′+1 …(i) gcd(eup−1,p−1)≦SRp …(j) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0
According to a third aspect of the present invention, in the apparatus for generating a prime number serving as a prime key of the RSA encryption,
Means for generating 0 ', means for generating a random number S p0 ,
0 = a S p0 p 0 'means determines whether or +1 is prime, when the p 0 is a prime number, and means for generating a random number R p, the random number R p is less than or equal to (h) , (I) to determine whether the condition is satisfied, and the random number R p is (h),
Means for determining whether or not p = R p p 0 +1 is a prime number when the condition (i) is satisfied; means for determining whether or not the following condition (j) is satisfied; ), Means for generating p as a prime number serving as the prime key when the condition is satisfied. R p = S Rp r p ... (h) r p = S rp R p '+1 ... (i) gcd (e up -1, p-1) ≦ S Rp ... (j) where, r p, R p' : Prime numbers S Rp , S rp : product of prime numbers e: RSA encryption key up = lcm (S rp , S p0 )

【0013】請求項4に係るRSA暗号化方法は、請求
項1または2に従って生成した素数pを暗号化用の素数
鍵として用いることを特徴とする。
[0013] The RSA encryption method according to claim 4 is characterized in that the prime number p generated according to claim 1 or 2 is used as a prime key for encryption.

【0014】請求項5に係る記録媒体は、RSA暗号の
素数鍵となる素数を生成するためのプログラムを記録し
てあるコンピュータでの読み取り可能な記録媒体におい
て、素数p0 ′を生成することを前記コンピュータにさ
せるプログラムコード手段と、乱数Sp0を生成すること
を前記コンピュータにさせるプログラムコード手段と、
0 =Sp00 ′+1が素数であるか否かを判定するこ
とを前記コンピュータにさせるプログラムコード手段
と、該p0 が素数である場合に、乱数Rp を生成するこ
とを前記コンピュータにさせるプログラムコード手段
と、該乱数Rp が以下の(k),(l)の条件を満たす
か否かを判定することを前記コンピュータにさせるプロ
グラムコード手段と、前記乱数Rp が(k),(l)の
条件を満たす場合に、p=Rp 0 +1が素数であるか
否かを判定することを前記コンピュータにさせるプログ
ラムコード手段と、以下の(m)の条件を満たすか否か
を判定することを前記コンピュータにさせるプログラム
コード手段と、(m)の条件を満たす場合に、そのpを
前記素数鍵となる素数として生成することを前記コンピ
ュータにさせるプログラムコード手段とを有することを
特徴とする。 Rp =SRpp …(k) rp =Srpp ′+1 …(l) gcd(eup−1,p−1)≦SRp …(m) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0
According to a fifth aspect of the present invention, there is provided a recording medium in which a prime number p 0 ′ is generated in a computer-readable recording medium storing a program for generating a prime number serving as a prime number key of the RSA encryption. Program code means for causing the computer, and program code means for causing the computer to generate a random number Sp0 ;
program code means for causing the computer to determine whether p 0 = S p0 p 0 '+1 is a prime number; and generating the random number R p when the p 0 is a prime number. program code means for causing the, random number R p is less than or equal to (k), and program code means for causing the computer to determine whether or not the condition (l), the random number R p is (k) , (L), the program code means for causing the computer to determine whether p = R p p 0 +1 is a prime number, and whether the following condition (m) is satisfied: A program code means for causing the computer to determine whether or not a program is to generate, when the condition (m) is satisfied, p as a prime number serving as the prime number key. And having a code means. R p = S Rp r p ... (k) r p = S rp R p '+1 ... (l) gcd (e up -1, p-1) ≦ S Rp ... (m) where, r p, R p' : Prime numbers S Rp , S rp : product of prime numbers e: RSA encryption key up = lcm (S rp , S p0 )

【0015】本発明では、以下のような各手段にて、上
述した問題を解決する。 (手段1)繰り返し暗号化攻撃に弱い暗号文の個数が従
来例と同様に4個である場合について、従来例より広い
判定条件を用いて素数を生成することにより、RSA暗
号の素数鍵として使用できる素数をより短時間で生成す
る。 (手段2)繰り返し暗号化攻撃に弱い暗号文の個数が従
来例の4個より多い場合についても、RSA暗号の素数
鍵として使用できる素数の生成を可能とすることによ
り、従来例より広い判定条件を満たすRSA暗号の素数
鍵となる素数を短時間で生成する。
In the present invention, the above-mentioned problems are solved by the following means. (Means 1) When the number of ciphertexts that are vulnerable to repetitive encryption attacks is four as in the conventional example, a prime number is generated using a wider range of determination conditions than in the conventional example, and used as a prime key of the RSA encryption Generate possible prime numbers in a shorter time. (Means 2) Even when the number of ciphertexts vulnerable to the repetitive encryption attack is larger than four in the conventional example, by making it possible to generate a prime number that can be used as a prime key of the RSA encryption, a wider range of determination conditions than in the conventional example Is generated in a short time as a prime key of the RSA encryption satisfying the following condition.

【0016】図1は、本発明における素数生成の全体の
流れを示すフローチャートであり、入力値w(w≧4)
が与えられると、以下の手順にて、(繰り返し暗号化攻
撃に弱い暗号文の個数)≦wとなるようなRSA暗号の
素数鍵となり得る素数pを生成する。
FIG. 1 is a flowchart showing the overall flow of generating a prime number according to the present invention, in which an input value w (w ≧ 4) is set.
Is given, a prime p that can be a prime key of the RSA cryptosystem such that (the number of ciphertexts vulnerable to repeated encryption attacks) ≦ w is generated in the following procedure.

【0017】 S1:大きな素数p0 ′を生成して、S2へ進む。 S2:小さな乱数Sp0を生成して、S3へ進む。 S3:素数判定法を用いて、p0 =Sp00 ′+1が素
数であるか否かを判定する。判定の結果、p0 が素数で
ある場合にはS4へ進み、p0 が素数でない場合にはS
2へ戻る。 S4:乱数Rp を生成して、S5へ進む。 S5:Rp に関する条件判定を行う。この条件判定の内
容について後述する。判定結果がyes である場合にはu
p,SRpを生成してS6へ進み、判定結果がnoである場
合にはS4へ戻る。 S6:素数判定法を用いて、p=Rp 0 +1が素数で
あるか否かを判定する。判定の結果、pが素数である場
合にはS7へ進み、pが素数でない場合にはS4へ戻
る。 S7:RSA暗号の暗号化鍵eについて、gcd(eup
1,p−1)≦SRpであるか否かを判定する。判定の結
果、yes である場合には素数pを出力して処理を終了
し、noである場合にはS4へ戻る。
S1: Generate a large prime p 0 ′, and proceed to S2. S2: Generate a small random number S p0 and proceed to S3. S3: It is determined whether or not p 0 = S p0 p 0 '+1 is a prime number by using a prime number determination method. As a result of the determination, if p 0 is a prime number, the process proceeds to S4. If p 0 is not a prime number, S4
Return to 2. S4: Generate a random number R p and proceed to S5. S5: Condition determination regarding R p is performed. The details of this condition determination will be described later. U if the result is yes
p and S Rp are generated, and the process proceeds to S6. If the determination result is no, the process returns to S4. S6: It is determined whether or not p = R p p 0 +1 is a prime number by using a prime number determination method. As a result of the determination, if p is a prime number, the process proceeds to S7, and if p is not a prime number, the process returns to S4. S7: For the encryption key e of the RSA encryption, gcd (e up
(1, p-1) ≦ S Rp is determined. If the result of the determination is yes, a prime number p is output and the process ends, and if the result is no, the process returns to S4.

【0018】図2,図3は、図1のS5におけるRp
関する条件判定処理の内容を示すフローチャートであ
り、Rp ,Sp0,wを入力した後、Rp に関して以下の
手順を行い、判定結果としてyes またはnoを出力する。
FIG. 2 and FIG. 3 are flowcharts showing the contents of the condition determination processing for R p in S5 of FIG. 1. After inputting R p , S p0 , and w, the following procedure is performed for R p . Outputs yes or no as the judgment result.

【0019】S11:SRp=1,rp =Rp ,i=1とし
て、S12へ進む。 S12:ti (1≦i≦h)を、小さい順に並べた素数数
列(t1 =2,t2 =3,t3 =5,t4 =7,・・
・)として、rp =0(mod ti )であるか否かを判定
する。判定の結果、yes である場合にはS13へ進み、no
である場合にはS15へ進む。 S13:SRp=SRp×ti ,rp =rp /ti として、S
14へ進む。 S14:SRp 2 ≦wであるか否かを判定する。判定の結
果、yes である場合にはS12へ戻り、noである場合には
判定結果=noとして処理を終了する。 S15:i:=i+1として、S16へ進む。 S16:i≦hであるか否かを判定する。判定の結果、ye
s である場合にはS12へ戻り、noである場合にはS17へ
進む。 S17:素数判定法を用いて、rp が大きな素数であるか
否かを判定する。判定の結果、yes である場合にはS18
へ進み、noである(素数でないかまたは小さな素数であ
る)場合には判定結果=noとして処理を終了する。 S18:Srp=1,Rp ′=rp −1,i=1として、S
19へ進む。 S19:Rp ′=0(mod ti )であるか否かを判定す
る。判定の結果、yes である場合にはS20へ進み、noで
ある場合にはS21へ進む。 S20:Srp=Srp×ti ,Rp ′=Rp ′/ti とし
て、S19へ戻る。 S21:i=i+1として、S22へ進む。 S22:i≦hであるか否かを判定する。判定の結果、ye
s である場合にはS19へ戻り、noである場合にはS23へ
進む。 S23:素数判定法を用いて、Rp ′が大きな素数である
か否かを判定する。判定の結果、yes である場合にはS
24へ進み、noである(素数でないかまたは小さな素数で
ある)場合には判定結果=noとして処理を終了する。 S24:up=lcm(Srp,Sp0)を計算し、up,SRpを出力
し、判定結果=yes として処理を終了する。
S11: Assuming that S Rp = 1, r p = R p and i = 1, the routine proceeds to S12. S12: prime number sequence (t 1 = 2, t 2 = 3, t 3 = 5, t 4 = 7,...) In which t i (1 ≦ i ≦ h) are arranged in ascending order
), It is determined whether or not r p = 0 (mod t i ). If the result of the determination is yes, proceed to S13, no
If it is, the process proceeds to S15. S13: Assuming that S Rp = S Rp × t i and r p = r p / t i ,
Proceed to 14. S14: It is determined whether or not S Rp 2 ≦ w. If the result of the determination is yes, the process returns to S12, and if the result is no, the process ends with the determination result = no. S15: i: = i + 1, and the process proceeds to S16. S16: It is determined whether or not i ≦ h. As a result of the judgment, ye
If it is s, the process returns to S12. If it is no, the process proceeds to S17. S17: Using the primality test, it is determined whether r p is large prime. If the result of the determination is yes, S18
The process proceeds to step no, and when the result is no (not a prime number or a small prime number), the processing ends with the determination result = no. S18: S rp = 1, R p '= r p -1, as i = 1, S
Proceed to 19. S19: It is determined whether or not R p '= 0 (mod t i ). If the result of the determination is yes, the operation proceeds to S20, and if the result is no, the operation proceeds to S21. S20: Set S rp = S rp × t i , R p ′ = R p ′ / t i , and return to S19. S21: Set i = i + 1 and proceed to S22. S22: It is determined whether or not i ≦ h. As a result of the judgment, ye
If it is s, the process returns to S19. If it is no, the process proceeds to S23. S23: It is determined whether or not R p 'is a large prime number by using a prime number determination method. If the result of the determination is yes, S
Proceeding to step 24, if no (not a prime number or a small prime number), the process ends with the determination result = no. S24: Up = lcm (S rp , S p0 ) is calculated, up and S Rp are output, and the processing is terminated with the determination result = yes.

【0020】以上のようにして生成した素数をRSA暗
号の素数鍵とした場合、その素数鍵p,qに関して、以
下の(5)〜(10)に示される条件が満たされる。
When the prime numbers generated as described above are used as the prime keys of the RSA encryption, the following conditions (5) to (10) are satisfied for the prime keys p and q.

【0021】 (5) p=Rp 0 +1 q=Rq 0 +1 (p0 ,q0 :大きな素数) (6) Rp =SRpp (rp ,rq :大きな素数, Rq =SRqq Rp,SRq:小さな素数の積) (7) rp =Srpp ′+1 (Rp ′,Rq ′:大きな素数, rq =Srqq ′+1 Srp,Srq:小さな素数の積) (8) p0 =Sp00 ′+1 (p0 ′,q0 ′:大きな素数, q0 =Sq00 ′+1 Sp0,Sq0:小さな素数の積) (9) gcd(eup−1,p−1)≦SRp (up=lcm(Srp,Sp0)) gcd(euq−1,q−1)≦SRq (uq=lcm(Srq,Sq0)) (10) SRp 2 ≦w SRq 2 ≦w[0021] (5) p = R p p 0 +1 q = R q q 0 +1 (p 0, q 0: large prime numbers) (6) R p = S Rp r p (r p, r q: large prime numbers, R q = S Rq r q S Rp, S Rq: product of small primes) (7) r p = S rp R p '+1 (R p', R q ': large primes, r q = S rq R q ' +1 S rp , S rq : product of small prime numbers (8) p 0 = S p0 p 0 ′ +1 (p 0 , q 0 ′: large prime number, q 0 = S q0 q 0 ′ +1 S p0 , S q0 : Product of small prime numbers) (9) gcd (e up −1, p−1) ≦ S Rp (up = lcm (S rp , S p0 )) gcd (e uq −1, q−1) ≦ S Rq ( uq = lcm (S rq, S q0)) (10) S Rp 2 ≦ w S Rq 2 ≦ w

【0022】よって、以下に述べる理由(A)〜(G)
から、繰り返し暗号化攻撃に弱い暗号文の個数がSRp
Rq個に限定される。ここで、上記(10)よりSRp 2
w,SRq 2 ≦wであるので、SRpRq≦wとなる。この
結果、(繰り返し暗号化攻撃に弱い暗号文の個数)≦w
となる。
Therefore, the following reasons (A) to (G)
From the number of ciphertexts vulnerable to repeated encryption attacks is S Rp S
Limited to Rq . Here, from the above (10), S Rp 2
w, S Rq 2 ≦ w, so that S Rp S Rq ≦ w. As a result, (the number of ciphertexts vulnerable to repeated encryption attacks) ≦ w
Becomes

【0023】(A)u回の繰り返し暗号化攻撃で解読さ
れる暗号文の個数は、下記式を満たすmの個数と一致す
る。
(A) The number of ciphertexts decrypted by u repeated encryption attacks matches the number of m that satisfies the following equation.

【0024】[0024]

【数2】 (Equation 2)

【0025】(B)一般的に、mk ≡1(mod n)を満
たすmの個数は、gcd(k,φ(p))×gcd(k,φ
(q))で表される。但し、φはオイラー関数であり、
オイラー関数の性質として、xが素数である場合、φ
(x)=x−1となる。
(B) In general, the number of m that satisfies m k ≡1 (mod n) is gcd (k, φ (p)) × gcd (k, φ
(Q)). Where φ is an Euler function,
As a property of the Euler function, when x is a prime number, φ
(X) = x−1.

【0026】(C)(A),(B)より、任意の小さな
uに対して、以下の(11) の条件が成立する場合には、
(繰り返し暗号化攻撃に弱い暗号文の個数)≦SRpRq
となる。 gcd(eu −1,φ(p))≦SRp, gcd(eu −1,φ(q))≦SRq …(11)
(C) From (A) and (B), if the following condition (11) is satisfied for an arbitrary small u,
(Number of ciphertexts vulnerable to repeated encryption attacks) ≤ S Rp S Rq
Becomes gcd ( eu− 1, φ (p)) ≦ SRp , gcd ( eu− 1, φ (q)) ≦ SRq (11)

【0027】(D)条件(11) は、gcd(eu −1,φ
(p)φ(q))≦SRpRqと等価である。また、φ
(p)φ(q)=(p−1)(q−1)=SRpRqp
q 00 であり、しかも、SRpRqが小さな素数の
積、rp q 0 0 が大きな素数であるので、条件
(11) は更に、以下の(12) の条件と等価である。 gcd(eu −1,rp q 0 0 )=1 …(12)
(D) Condition (11) is gcd (e u− 1, φ
(P) φ (q)) ≦ S Rp S Rq Also, φ
(P) φ (q) = (p-1) (q-1) = S Rp S Rq r p
Since r q p 0 q 0 , and S Rp S Rq is a product of small prime numbers, and r p r q p 0 q 0 is a large prime number, condition (11) further satisfies the following condition (12) Is equivalent to gcd (e u -1, r p r q p 0 q 0) = 1 ... (12)

【0028】(E)条件(12) は、以下の(13) の条件
と等価である。 eu ≠1(mod rp ), eu ≠1(mod rq ), eu ≠1(mod p0 ), eu ≠1(mod q0 ) …(13) 条件(13) が任意の小さなuについて満たされるか否か
は、u|lcm(φ(rp ),φ(rq ),φ(p0 ),φ
(q0 ))について満たされるか否かを調べれば良い。
φ(rp )=Srpp ′,φ(rq )=Srqq ′,φ
(p0 )=Sp00 ′,φ(q0 )=Sq00 ′である
ので、小さなuの条件は、以下の(14) となる。 u|lcm(Srp,Srq,Sp0,Sq0) …(14)
(E) The condition (12) is equivalent to the following condition (13). eu ≠ 1 (mod r p ), eu ≠ 1 (mod r q ), eu ≠ 1 (mod p 0 ), eu ≠ 1 (mod q 0 ) ... (13) Whether it is satisfied for a small u is determined by u | lcm (φ (r p ), φ (r q ), φ (p 0 ), φ
It is sufficient to check whether or not (q 0 )) is satisfied.
φ (r p ) = S rp R p ′, φ (r q ) = S rq R q ′, φ
Since (p 0 ) = S p0 p 0 ′, φ (q 0 ) = S q0 q 0 ′, the condition of small u is as follows (14). u | lcm (S rp , S rq , S p0 , S q0 ) (14)

【0029】(F)条件(11) と条件(13) とが等価で
あることに注意すると、(E)から、条件(14) を満た
すuのうち最大の数であるupq=lcm(Srp,Srq,S
p0,Sq0)について、以下の(15) の条件が満たされる
場合には、任意の小さなuについて、条件(11) が満た
されないことになり、その結果、(繰り返し暗号化攻撃
に弱い暗号文の個数)≦SRpRqが満たされる。 gcd(eupq −1,φ(p))≦SRp, gcd(eupq −1,φ(q))≦SRq …(15)
(F) Note that the conditions (11) and (13) are equivalent. From (E), it can be seen that the maximum number of u satisfying the condition (14) is upq = lcm (S rp , S rq , S
When the following condition (15) is satisfied with respect to p0 , Sq0 ), the condition (11) is not satisfied for an arbitrary small u, and as a result, (ciphertext vulnerable to repeated encryption attacks) ) ≦ S Rp S Rq is satisfied. gcd (e upq −1, φ (p)) ≦ S Rp , gcd (e upq −1, φ (q)) ≦ S Rq (15)

【0030】(G)条件(15) は条件(9) と等価であ
るので、前述の条件(5)〜(9)が満たされる場合に
は、(繰り返し暗号化攻撃に弱い暗号文の個数)≦SRp
Rqとなる。
(G) Since the condition (15) is equivalent to the condition (9), if the above conditions (5) to (9) are satisfied, (the number of ciphertexts vulnerable to the repetitive encryption attack) ≦ S Rp
S Rq .

【0031】[0031]

【発明の実施の形態】以下、本発明をその実施の形態を
示す図面に基づいて具体的に説明する。以下の実施の形
態ではRSA暗号の素数鍵を生成する場合について説明
する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be specifically described below with reference to the drawings showing the embodiments. In the following embodiment, a case where a prime key of the RSA encryption is generated will be described.

【0032】図4は、本発明の素数生成装置をコンピュ
ータを利用して実現した場合の全体の構成例を示す図で
ある。ここに例示するプログラムは、図1及び図2,図
3に示すS1〜S7及びS11〜S24を含んでおり、以下
に説明する記録媒体に記録されている。
FIG. 4 is a diagram showing an example of the entire configuration when the prime number generating device of the present invention is realized using a computer. The program exemplified here includes S1 to S7 and S11 to S24 shown in FIGS. 1, 2, and 3, and is recorded on a recording medium described below.

【0033】図4において、コンピュータ10とオンライ
ン接続する記録媒体11は、コンピュータ10の設置場所か
ら隔たって設置される例えばWWW(World Wide Web)の
サーバコンピュータを用いてなり、記録媒体11には前述
の如きプログラム11a が記録されている。記録媒体11か
ら読み出されたプログラム11a がコンピュータ20を制御
することにより、コンピュータ10がRSA暗号の素数鍵
を生成する。
In FIG. 4, a recording medium 11 that is connected to the computer 10 on-line is, for example, a WWW (World Wide Web) server computer that is installed separately from a place where the computer 10 is installed. The program 11a is recorded as follows. The computer 10 generates a prime key of the RSA encryption by controlling the computer 20 by the program 11a read from the recording medium 11.

【0034】コンピュータ10の内部に設けられた記録媒
体12は、内蔵設置される例えばハードディスクドライブ
またはROMなどを用いてなり、記録媒体12には前述の
如きプログラム12a が記録されている。記録媒体12から
読み出されたプログラム12aがコンピュータ10を制御す
ることにより、コンピュータ10がRSA暗号の素数鍵を
生成する。
The recording medium 12 provided inside the computer 10 uses a built-in hard disk drive or ROM, for example, and the recording medium 12 stores the program 12a as described above. The program 10a read from the recording medium 12 controls the computer 10 so that the computer 10 generates a prime key of the RSA encryption.

【0035】コンピュータ10に設けられたディスクドラ
イブ10a に装填して使用される記録媒体13は、運搬可能
な例えば光磁気ディスク,CD−ROMまたはフレキシ
ブルディスクなどを用いてなり、記録媒体13には前述の
如きプログラム13a が記録されている。記録媒体13から
読み出されたプログラム13a がコンピュータ10を制御す
ることにより、コンピュータ10がRSA暗号の素数鍵を
生成する。
The recording medium 13 used by being loaded into the disk drive 10a provided in the computer 10 is a transportable medium such as a magneto-optical disk, a CD-ROM or a flexible disk. The program 13a is recorded as follows. The program 13a read from the recording medium 13 controls the computer 10 so that the computer 10 generates a prime key of the RSA encryption.

【0036】図5は、コンピュータ10の内部構成例を示
すブロック図である。コンピュータ10内部には、CPU
1を中心にして、バス2に接続された、上記記録媒体12
及びディスクドライブ10a と、外部のキーボード,マウ
スに接続されたI/Oポート3と、素数生成処理におけ
る中間値などを格納するRAM4と、素数を生成する素
数生成部5と、素数であるか否かを判定する素数判定部
6と、所望の大きさの乱数を生成する乱数生成部7とが
設けられている。
FIG. 5 is a block diagram showing an example of the internal configuration of the computer 10. Inside the computer 10, a CPU
1, the recording medium 12 connected to the bus 2
A disk drive 10a, an I / O port 3 connected to an external keyboard and mouse, a RAM 4 for storing an intermediate value or the like in a prime generation process, a prime generation unit 5 for generating a prime, There is provided a prime number determining unit 6 for determining whether or not a random number is generated, and a random number generating unit 7 for generating a random number of a desired size.

【0037】次に、RSA暗号の素数鍵となる素数の生
成処理の具体例について説明する。なお、以下の例で
は、素数判定方法として、確定的素数判定法の1つであ
るPocklington 法と確率的素数判定法の1つであるMill
er-Rabin法とを用いる。これらの素数判定方法につい
て、以下に簡単に説明する。
Next, a specific example of a process of generating a prime number serving as a prime key of the RSA encryption will be described. In the following example, as the prime number determination method, the Pocklington method, which is one of the deterministic prime number determination methods, and the Mill, which is one of the stochastic prime number determination methods
The er-Rabin method is used. These prime number determination methods will be briefly described below.

【0038】Pocklington 法は、U.Maurer,^Fast gener
ation of secure RSA-moduli withalmost maximum dive
rsity", Advances in Cryptology-EUROCRYPT'89(LNCS43
4),pp.634-647,1990に示されており、次のようなアルゴ
リムを有する。 判定する素数候補p=2hp p′+1を入力する。
但し、p′は素数であり、p′>hp である。 乱数aを選ぶ。 ap-1 ≡1(mod p)を判定する。真ならばに処
理が進み、そうでなければpを合成数と判定して終了す
る。 以下の(16)の条件を判定する。真ならばpを素数
と判定して終了する。そうでなければpを合成数と判定
して終了する。
The Pocklington method is described in U. Maurer, ^ Fast gener
ation of secure RSA-moduli withalmost maximum dive
rsity ", Advances in Cryptology-EUROCRYPT'89 (LNCS43
4), pp. 634-647, 1990, and has the following algorithm: Determining inputs a prime candidate p = 2h p p '+ 1 .
However, p 'is a prime number, p' is a> h p. Select a random number a. a p-1 ≡1 (mod p) is determined. If true, the process proceeds; otherwise, p is determined to be the number of composites and the process ends. The following condition (16) is determined. If true, p is determined to be a prime number, and the process ends. Otherwise, p is determined to be the number of composites, and the process ends.

【0039】[0039]

【数3】 (Equation 3)

【0040】Miller-Rabin法は、「“暗号理論入門”
(岡本栄司著,共立出版)」の16ページの“素数判定
(ラビン法)”に示されており、次のようなアルゴリム
を有する。但し、素数候補をsとし、小さい素数の積を
Aとおく。 (I) gcd(s,A)≠1ならば、sを合成数と判定して終
了する。 (II) s=1+2k w(w:奇数)となるk,wを計算
する。 (III) i=1からLまで以下の(i)〜(v)を繰り返
す。 (i)1<x<sを満たすxをランダムに生成 (ii)y=xw (mod s) (iii)j=0 (iv)j<kかつy≠1かつy≠s−1である限り y=y2 (mod s), j=j+1 (v)j=kまたは(j>0かつy=1)ならば、sを
合成数と判定して終了 (IV) sを素数と判定して終了する。
The Miller-Rabin method is described in “Introduction to Cryptography Theory”.
(Eiji Okamoto, Kyoritsu Shuppan) ”on page 16 in“ Prime Number Judgment (Rabin Method) ”and has the following algorithm. However, let s be a prime candidate and let A be a product of small primes. (I) If gcd (s, A) ≠ 1, s is determined to be the number of composites, and the process ends. (II) s = 1 + 2 k w (w: odd) and a k, calculates the w. (III) The following (i) to (v) are repeated from i = 1 to L. (I) randomly generate x satisfying 1 <x <s (ii) y = x w (mod s) (iii) j = 0 (iv) j <k, y ≠ 1 and y ≠ s−1 As long as y = y 2 (mod s), j = j + 1 (v) If j = k or (j> 0 and y = 1), determine s as a composite number and end. (IV) Determine s as a prime number. To end.

【0041】また、以下の例では、Sp0=2,w=232
の固定値を用いて、512 ビットのRSA暗号の素数鍵を
生成する。
In the following example, S p0 = 2, w = 2 32
, A prime key of the 512-bit RSA encryption is generated.

【0042】図6は、素数鍵となる512 ビットの素数を
生成するための実施例における処理全体の手順を示すフ
ローチャートである。
FIG. 6 is a flowchart showing the overall processing procedure in the embodiment for generating a 512-bit prime number serving as a prime number key.

【0043】まず、w=232に固定した後(ステップS
31)、259 ビットの素数p0 ′を生成する(ステップS
32)。Pocklington 法を用いてp0 =2p0 ′+1が素
数であるか否かを判定する(ステップS33)。素数でな
い場合には(S33:NO)、別の素数p0 ′を生成する
(S32)。素数である場合には(S33:YES)、252 ビッ
トの大きな乱数Rp を生成する(ステップS34)。
[0043] First of all, after fixing to w = 2 32 (step S
31), generating a 259-bit prime p 0 '(step S
32). Using the Pocklington method, it is determined whether p 0 = 2p 0 '+1 is a prime number (step S33). If it is not a prime number (S33: NO), another prime number p 0 'is generated (S32). If it is a prime number (S33: YES), a large 252-bit random number Rp is generated (step S34).

【0044】この乱数Rp に関する条件判定を行う(ス
テップS35)。図7,図8は、このRp に関する条件判
定処理の内容を示すフローチャートである。まず、この
乱数Rp を入力した後(ステップS41)、SRp=1,r
p =Rp ,i=1と設定する(ステップS42)。t
i (1≦i≦300)を、小さい順に並べた300 個の素数数
列とし、rp =0(mod ti )であるか否かを判定する
(ステップS43)。
[0044] performing a condition judgment regarding the random number R p (step S35). 7, FIG. 8 is a flowchart showing the contents of a condition determination processing for this R p. First, after inputting this random number R p (step S41), S Rp = 1, r
p = R p and i = 1 are set (step S42). t
i (1 ≦ i ≦ 300) is set as a sequence of 300 prime numbers arranged in ascending order, and it is determined whether or not r p = 0 (mod t i ) (step S43).

【0045】rp =0(mod ti )である場合には(S
43:YES)、SRp=SRp×ti ,rp=rp /ti と設定
し(ステップS44)、SRp 2 ≦232であるか否かを判定
する(ステップS45)。SRp 2 ≦232である場合には
(S45:YES)、rp =0(modti )であるか否かを判
定する(S43)。SRp 2 >232である場合には(S45:
NO)、判定結果=noを出力して(ステップS46)、処理
を終了する。
If r p = 0 (mod t i ), then (S
43: YES), it sets S Rp = S Rp × t i , and r p = r p / t i ( step S44), determines whether the S Rp 22 32 (step S45). If a S Rp 2 ≦ 2 32 (S45 : YES), r p = 0 determines whether the (modt i) (S43). If S Rp 2 > 2 32 (S45:
NO), the determination result = no is output (step S46), and the process ends.

【0046】rp =0(mod ti )でない場合には(S
43:NO)、i=i+1とした後(ステップS47)、i≦
300 であるか否かを判定する(ステップS48)。i≦30
0 である場合には(S48:YES)、rp =0(mod ti
であるか否かを判定する(S43)。i>300 である場合
には(S48:NO)、Miller-Rabin法を用いてrp が大き
な素数であるか否かを判定する(ステップS49)。大き
な素数でない場合には(S49:NO)、判定結果=noを出
力して(S46)、処理を終了する。
If r p = 0 (mod t i ), then (S
43: NO), after setting i = i + 1 (step S47), i ≦
It is determined whether it is 300 (step S48). i ≦ 30
If it is 0 (S48: YES), r p = 0 (mod t i )
Is determined (S43). If i> is 300 (S48: NO), r p using the Miller-Rabin method determines whether a large prime number (step S49). If it is not a large prime number (S49: NO), the determination result = no is output (S46), and the process ends.

【0047】rp が大きな素数である場合には(S49:Y
ES)、Srp=1,Rp ′=rp −1,i=1と設定し
(ステップS50)、Rp ′=0(mod ti )であるか否
かを判定する(ステップS51)。Rp ′=0(mod
i )である場合には(S51:YES)、Srp=Srp×
i ,Rp ′=Rp ′/ti と設定して(ステップS5
2)、Rp′=0(mod ti )であるか否かを判定する
(S51)。
[0047] If r p is a large prime number (S49: Y
ES), S rp = 1, R p '= r p -1, i = 1 and set (step S50), R p' is determined whether a = 0 (mod t i) (step S51) . R p ′ = 0 (mod
t i ) (S51: YES), S rp = S rp ×
t i , R p ′ = R p ′ / t i (Step S5)
2) It is determined whether or not R p '= 0 (mod t i ) (S51).

【0048】Rp ′=0(mod ti )でない場合には
(S51:NO)、i=i+1とした後(ステップS53)、
i≦300 であるか否かを判定する(ステップS54)。i
≦300である場合には(S54:YES)、Rp ′=0(mod
i )であるか否かを判定する(S51)。i>300 であ
る場合には(S54:NO)、Miller-Rabin法を用いて
p′が大きな素数であるか否かを判定する(ステップ
S55)。大きな素数でない場合には(S55:NO)、判定
結果=noを出力して(S46)、処理を終了する。
If R p ′ = 0 (mod t i ) is not satisfied (S51: NO), after setting i = i + 1 (step S53),
It is determined whether or not i ≦ 300 (step S54). i
If ≦ 300 (S54: YES), R p ′ = 0 (mod
t i ) is determined (S51). If i> 300 (S54: NO), it is determined using the Miller-Rabin method whether or not R p 'is a large prime number (step S55). If it is not a large prime number (S55: NO), the determination result = no is output (S46), and the process ends.

【0049】一方、Rp ′が大きな素数である場合には
(S55:YES)、判定結果=yes とSrp及びSRpとを出力
して(ステップS56)、処理を終了する。
On the other hand, if R p ′ is a large prime number (S55: YES), the judgment result = yes, Srp and S Rp are output (step S56), and the process is terminated.

【0050】S35における乱数Rp に関する条件判定結
果がnoである場合には(S35:NO)、別の乱数Rp を生
成する(S34)。S35における乱数Rp に関する条件判
定結果がyes である場合には(S35:YES)、Pocklingto
n 法を用いてp=Rp 0 +1が素数であるか否かを判
定する(ステップS36)。素数でない場合には(S36:
NO)、別の乱数Rp を生成する(S34)。pが素数であ
る場合には(S36:YES)、RSA暗号の暗号化鍵eにつ
いて以下の(17)の条件を満たすか否かを判定する(ス
テップS37)。
[0050] If the condition judgment result regarding the random number R p is no in S35 (S35: NO), it generates another random number R p (S34). If the result of the condition determination regarding the random number R p in S35 is yes (S35: YES), the Pocklingto
It is determined whether or not p = R p p 0 +1 is a prime number using the n method (step S36). If it is not a prime number (S36:
NO), another random number Rp is generated (S34). If p is a prime number (S36: YES), it is determined whether the encryption key e of the RSA encryption satisfies the following condition (17) (step S37).

【0051】[0051]

【数4】 (Equation 4)

【0052】条件(17)を満たさない場合には(S37:
NO)、別の乱数Rp を生成する(S34)。条件(17)を
満たす場合には(S37:YES)、素数pを出力して(ステ
ップS38)、処理を終了する。
If the condition (17) is not satisfied (S37:
NO), another random number Rp is generated (S34). If the condition (17) is satisfied (S37: YES), the prime number p is output (step S38), and the process ends.

【0053】次に、本発明による素数生成と従来例によ
る素数生成との比較について述べる。前記(1)〜
(4)で示される従来例における条件と、(5)〜(1
0)で示される本発明における条件とを比較すると、繰
り返し暗号化攻撃に弱い暗号文の個数が4個である場合
について、本発明の方が条件が広く、また、本発明で
は、繰り返し暗号化攻撃に弱い暗号文が4個以上である
場合についてもRSA暗号の素数鍵の生成が可能であ
る。
Next, comparison between generation of prime numbers according to the present invention and generation of prime numbers according to the conventional example will be described. (1)-
The conditions in the conventional example shown in (4) and (5) to (1)
Compared with the condition in the present invention shown in (0), the condition of the present invention is wider when the number of ciphertexts vulnerable to the repetitive encryption attack is four, and in the present invention, Even when there are four or more ciphertexts that are vulnerable to attack, it is possible to generate a prime key of the RSA encryption.

【0054】よって、本発明では従来例と比べて、繰り
返し暗号化攻撃に強いRSA暗号の素数鍵をより高速に
生成することが可能である。
Thus, in the present invention, it is possible to generate a RSA encryption prime key that is resistant to repeated encryption attacks at a higher speed than in the conventional example.

【0055】繰り返し暗号化攻撃に弱い暗号文の個数が
4個である場合について、本発明と従来例とによるRS
A暗号の素数鍵の生成時間を計測した。その計測結果を
表1に示す。表1の数値は、素数鍵(素数p)1個あた
りの生成時間を示している。本発明では従来例に比べ
て、大幅に生成時間を短縮できていることが分かる。
In the case where the number of ciphertexts vulnerable to the repetitive encryption attack is four, the RS and the RS according to the present invention and the conventional example are used.
The generation time of the prime key of the A cipher was measured. Table 1 shows the measurement results. Numerical values in Table 1 indicate generation times per one prime number key (prime number p). It can be seen that the generation time can be greatly reduced in the present invention as compared with the conventional example.

【0056】[0056]

【表1】 [Table 1]

【0057】[0057]

【発明の効果】以上のように、本発明では、繰り返し暗
号化攻撃に弱い暗号文の個数を4個に抑える場合におい
ても、前述した従来例よりも高速にRSA暗号の素数鍵
を生成できる。また、繰り返し暗号化攻撃に弱い暗号文
の個数を4個より多くする場合にも、RSA暗号の素数
鍵を生成することが可能となる。
As described above, in the present invention, even when the number of ciphertexts that are vulnerable to repeated encryption attacks is suppressed to four, the prime number key of the RSA encryption can be generated faster than in the conventional example described above. In addition, even when the number of ciphertexts that are vulnerable to repeated encryption attacks is set to more than four, it is possible to generate a prime key of the RSA encryption.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明による素数生成の処理手順を示すフロー
チャートである。
FIG. 1 is a flowchart showing a procedure for generating a prime number according to the present invention.

【図2】図1でのRp に関する条件判定処理(S5)の
手順を示すフローチャートである。
FIG. 2 is a flowchart showing a procedure of a condition determination process (S5) for R p in FIG. 1;

【図3】図1でのRp に関する条件判定処理(S5)の
手順を示すフローチャートである。
FIG. 3 is a flowchart illustrating a procedure of a condition determination process (S5) for R p in FIG. 1;

【図4】本発明の素数生成装置をコンピュータを利用し
て実現した場合の全体の構成例を示す図である。
FIG. 4 is a diagram illustrating an example of an overall configuration when a prime number generation device of the present invention is implemented using a computer.

【図5】コンピュータの内部構成例を示すブロック図で
ある。
FIG. 5 is a block diagram illustrating an example of an internal configuration of a computer.

【図6】本発明による具体的な素数生成の処理手順を示
すフローチャートである。
FIG. 6 is a flowchart showing a specific prime number generation processing procedure according to the present invention.

【図7】図6でのRp に関する条件判定処理(S35)の
手順を示すフローチャートである。
FIG. 7 is a flowchart showing a procedure of a condition determination process (S35) for R p in FIG. 6;

【図8】図6でのRp に関する条件判定処理(S35)の
手順を示すフローチャートである。
FIG. 8 is a flowchart showing a procedure of a condition determination process (S35) relating to R p in FIG. 6;

【符号の説明】[Explanation of symbols]

1 CPU 5 素数生成部 6 素数判定部 7 乱数生成部 10 コンピュータ 11,12,13 記録媒体 DESCRIPTION OF SYMBOLS 1 CPU 5 Prime number generation part 6 Prime number judgment part 7 Random number generation part 10 Computer 11,12,13 Recording medium

───────────────────────────────────────────────────── フロントページの続き (72)発明者 横山 和弘 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 (72)発明者 鳥居 直哉 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 Fターム(参考) 5B056 AA04 BB11 BB42 HH00 5J104 AA23 JA28 NA02 NA08 NA27 9A001 EE03  ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Kazuhiro Yokoyama 4-1-1, Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Prefecture Inside Fujitsu Limited (72) Inventor Naoya Torii 4-1-1, Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa No. 1 Fujitsu Limited F term (reference) 5B056 AA04 BB11 BB42 HH00 5J104 AA23 JA28 NA02 NA08 NA27 9A001 EE03

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 RSA暗号の素数鍵となる素数を生成す
る方法において、素数p0 ′を生成するステップと、乱
数Sp0を生成するステップと、p0 =Sp00 ′+1が
素数であるか否かを判定するステップと、該p0 が素数
である場合に、乱数Rp を生成するステップと、該乱数
p が以下の(a),(b)の条件を満たすか否かを判
定するステップと、前記乱数Rp が(a),(b)の条
件を満たす場合に、p=Rp 0 +1が素数であるか否
かを判定するステップと、以下の(c)の条件を満たす
か否かを判定するステップと、(c)の条件を満たす場
合に、そのpを前記素数鍵となる素数として生成するス
テップとを有することを特徴とする素数生成方法。 Rp =SRpp …(a) rp =Srpp ′+1 …(b) gcd(eup−1,p−1)≦SRp …(c) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0
1. A method for generating a prime number serving as a prime key of an RSA encryption, comprising the steps of generating a prime p 0 ′, generating a random number S p0 , and p 0 = S p0 p 0 ′ +1 and whether the determining whether, when the p 0 is a prime number, and generating a random number R p, the random number R p is less than or equal to (a), whether or not the condition (b) And determining whether p = R p p 0 +1 is a prime number when the random number R p satisfies the conditions (a) and (b), And a step of generating p as a prime number serving as the prime key when the condition (c) is satisfied. R p = S Rp r p ... (a) r p = S rp R p '+1 ... (b) gcd (e up -1, p-1) ≦ S Rp ... (c) where, r p, R p' : Prime numbers S Rp , S rp : product of prime numbers e: RSA encryption key up = lcm (S rp , S p0 )
【請求項2】 RSA暗号の素数鍵となる素数を生成す
る方法において、素数p0 ′を生成するステップと、乱
数Sp0を生成するステップと、p0 =Sp00 ′+1が
素数であるか否かを判定するステップと、該p0 が素数
である場合に、乱数Rp を生成するステップと、該乱数
p が以下の(d),(e),(f)の条件を満たすか
否かを判定するステップと、前記乱数Rp が(d),
(e),(f)の条件を満たす場合に、p=Rp 0
1が素数であるか否かを判定するステップと、以下の
(g)の条件を満たすか否かを判定するステップと、
(g)の条件を満たす場合に、そのpを前記素数鍵とな
る素数として生成するステップとを有することを特徴と
する素数生成方法。 Rp =SRpp …(d) rp =Srpp ′+1 …(e) SRp 2 ≦w …(f) gcd(eup−1,p−1)≦SRp …(g) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0) w:繰り返し暗号化攻撃に弱い暗号文の最大個数
2. A method for generating a prime number serving as a prime key of an RSA encryption, comprising the steps of: generating a prime p 0 ′, generating a random number S p0 , and p 0 = S p0 p 0 ′ +1. A step of determining whether or not the random number is present, a step of generating a random number R p when the p 0 is a prime number, and a step of generating the random number R p according to the following conditions (d), (e), and (f). and whether the determining meets, the random number R p is (d),
When the conditions of (e) and (f) are satisfied, p = R p p 0 +
Determining whether 1 is a prime number; determining whether the following condition (g) is satisfied;
(G) generating p as a prime number serving as the prime key when the condition (g) is satisfied. R p = S Rp r p ... (d) r p = S rp R p '+1 ... (e) S Rp 2 ≦ w ... (f) gcd (e up -1, p-1) ≦ S Rp ... (g ) Where r p , R p ′: prime S Rp , S rp : product of primes e: RSA encryption key up = lcm (S rp , S p0 ) w: maximum of ciphertext vulnerable to repeated encryption attacks Quantity
【請求項3】 RSA暗号の素数鍵となる素数を生成す
る装置において、素数p0 ′を生成する手段と、乱数S
p0を生成する手段と、p0 =Sp00 ′+1が素数であ
るか否かを判定する手段と、該p0 が素数である場合
に、乱数Rp を生成する手段と、該乱数Rp が以下の
(h),(i)の条件を満たすか否かを判定する手段
と、前記乱数Rp が(h),(i)の条件を満たす場合
に、p=Rp0 +1が素数であるか否かを判定する手
段と、以下の(j)の条件を満たすか否かを判定する手
段と、(j)の条件を満たす場合に、そのpを前記素数
鍵となる素数として生成する手段とを備えることを特徴
とする素数生成装置。 Rp =SRpp …(h) rp =Srpp ′+1 …(i) gcd(eup−1,p−1)≦SRp …(j) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0
3. An apparatus for generating a prime number serving as a prime key of an RSA encryption, comprising: means for generating a prime p 0 ′;
means for generating p0 , means for determining whether or not p 0 = S p0 p 0 '+1 is a prime number; means for generating a random number R p when p 0 is a prime number; R p is less than or equal to (h), means for determining whether or not the condition (i), the random number R p is (h), if the condition is satisfied in (i), p = R p p 0 Means for determining whether or not +1 is a prime number; means for determining whether or not the following condition (j) is satisfied; and when the condition of (j) is satisfied, p is used as the prime key. Means for generating a prime number. R p = S Rp r p ... (h) r p = S rp R p '+1 ... (i) gcd (e up -1, p-1) ≦ S Rp ... (j) where, r p, R p' : Prime numbers S Rp , S rp : product of prime numbers e: RSA encryption key up = lcm (S rp , S p0 )
【請求項4】 請求項1または2に従って生成した素数
pを暗号化用の素数鍵として用いることを特徴とするR
SA暗号化方法。
4. The method according to claim 1, wherein the prime number p generated according to claim 1 or 2 is used as a prime number key for encryption.
SA encryption method.
【請求項5】 RSA暗号の素数鍵となる素数を生成す
るためのプログラムを記録してあるコンピュータでの読
み取り可能な記録媒体において、素数p0 ′を生成する
ことを前記コンピュータにさせるプログラムコード手段
と、乱数Sp0を生成することを前記コンピュータにさせ
るプログラムコード手段と、p0 =Sp00 ′+1が素
数であるか否かを判定することを前記コンピュータにさ
せるプログラムコード手段と、該p0 が素数である場合
に、乱数Rp を生成することを前記コンピュータにさせ
るプログラムコード手段と、該乱数Rp が以下の
(k),(l)の条件を満たすか否かを判定することを
前記コンピュータにさせるプログラムコード手段と、前
記乱数Rp が(k),(l)の条件を満たす場合に、p
=Rp 0 +1が素数であるか否かを判定することを前
記コンピュータにさせるプログラムコード手段と、以下
の(m)の条件を満たすか否かを判定することを前記コ
ンピュータにさせるプログラムコード手段と、(m)の
条件を満たす場合に、そのpを前記素数鍵となる素数と
して生成することを前記コンピュータにさせるプログラ
ムコード手段とを有することを特徴とする記録媒体。 Rp =SRpp …(k) rp =Srpp ′+1 …(l) gcd(eup−1,p−1)≦SRp …(m) 但し、 rp ,Rp ′:素数 SRp,Srp:素数の積 e:RSA暗号の暗号化鍵 up=lcm(Srp,Sp0
5. Program code means for causing a computer to generate a prime p 0 ′ on a computer-readable recording medium on which a program for generating a prime serving as a prime key of an RSA encryption is recorded. Program code means for causing the computer to generate a random number S p0, and program code means for causing the computer to determine whether p 0 = S p0 p 0 '+1 is a prime number, determining if p 0 is a prime number, and program code means for generating a random number R p on the computer, the random number R p is less than or equal to (k), whether or not the condition (l) Program code means for causing the computer to do the following: if the random number R p satisfies the conditions (k) and (l),
= Program code for the program code means for causing the computer that R p p 0 +1 is determined whether the prime, to determine whether or not the condition of the following (m) to the computer And a program code means for causing the computer to generate p as a prime number serving as the prime key when the condition (m) is satisfied. R p = S Rp r p ... (k) r p = S rp R p '+1 ... (l) gcd (e up -1, p-1) ≦ S Rp ... (m) where, r p, R p' : Prime numbers S Rp , S rp : product of prime numbers e: RSA encryption key up = lcm (S rp , S p0 )
JP10377682A 1998-12-29 1998-12-29 Method and device for generating prime number, and rsa encipherment system and record medium Withdrawn JP2000200038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10377682A JP2000200038A (en) 1998-12-29 1998-12-29 Method and device for generating prime number, and rsa encipherment system and record medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10377682A JP2000200038A (en) 1998-12-29 1998-12-29 Method and device for generating prime number, and rsa encipherment system and record medium

Publications (1)

Publication Number Publication Date
JP2000200038A true JP2000200038A (en) 2000-07-18

Family

ID=18509074

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10377682A Withdrawn JP2000200038A (en) 1998-12-29 1998-12-29 Method and device for generating prime number, and rsa encipherment system and record medium

Country Status (1)

Country Link
JP (1) JP2000200038A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002278450A (en) * 2001-03-14 2002-09-27 Toshiba Corp Device, method and program for prime number generation
KR100396740B1 (en) * 2000-10-17 2003-09-02 학교법인 한국정보통신학원 Provably secure public key encryption scheme based on computational diffie-hellman assumption
JP2010277085A (en) * 2009-05-28 2010-12-09 Proton World Internatl Nv Protection of prime number generation in rsa algorithm

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100396740B1 (en) * 2000-10-17 2003-09-02 학교법인 한국정보통신학원 Provably secure public key encryption scheme based on computational diffie-hellman assumption
JP2002278450A (en) * 2001-03-14 2002-09-27 Toshiba Corp Device, method and program for prime number generation
JP4664514B2 (en) * 2001-03-14 2011-04-06 株式会社東芝 Prime number generating apparatus and program
JP2010277085A (en) * 2009-05-28 2010-12-09 Proton World Internatl Nv Protection of prime number generation in rsa algorithm

Similar Documents

Publication Publication Date Title
US7372961B2 (en) Method of public key generation
US6091819A (en) Accelerating public-key cryptography by precomputing randomly generated pairs
US6480605B1 (en) Encryption and decryption devices for public-key cryptosystems and recording medium with their processing programs recorded thereon
Fiat Batch RSA.
US20100166174A1 (en) Hash functions using elliptic curve cryptography
JP4137385B2 (en) Encryption method using public and private keys
US6404890B1 (en) Generating RSA moduli including a predetermined portion
WO1998007253A9 (en) Accelerating public-key cryptography by precomputing randomly generated pairs
US20070206789A1 (en) Elliptic curve cryptosystem optimization using two phase key generation
US6480606B1 (en) Elliptic curve encryption method and system
Huang et al. A new cryptographic key assignment scheme with time-constraint access control in a hierarchy
JP3518672B2 (en) Prime number generation device and encryption system
Joye et al. Fast generation of prime numbers on portable devices: An update
US20020041683A1 (en) Method for selecting optimal number of prime factors of a modulus for use in a cryptographic system
US20020176573A1 (en) Information security device, prime number generation device, and prime number generation method
US20050240762A1 (en) Cryptographic method and apparatus
JP2000200038A (en) Method and device for generating prime number, and rsa encipherment system and record medium
Petit et al. Cryptographic hash functions and expander graphs: The end of the story?
Ashraf et al. Message transmission for GH-public key cryptosystem
Zahhafi et al. A DSA-like digital signature protocol
KR20070049823A (en) Operation methods for modular exponentiation and scalar multiplication stable for power attack
JP4102090B2 (en) Information security device, prime number generation device, and prime number generation method
JP2003218858A (en) Signature generation method and signature verification method, signature-generating apparatus and signature- verifying apparatus, signature generation program and signature verification program, and storage medium for storing signature generation program and storage medium for storing signature verification program
Sanghi New Digital Signature Scheme Based on MDLP and Multinacci Matrices
Gysin et al. How to use Pell’s equation in cryptography

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060307