FI111491B - Generating a key pair - Google Patents

Generating a key pair Download PDF

Info

Publication number
FI111491B
FI111491B FI20002610A FI20002610A FI111491B FI 111491 B FI111491 B FI 111491B FI 20002610 A FI20002610 A FI 20002610A FI 20002610 A FI20002610 A FI 20002610A FI 111491 B FI111491 B FI 111491B
Authority
FI
Finland
Prior art keywords
prime
generating
numbers
block
condition
Prior art date
Application number
FI20002610A
Other languages
Finnish (fi)
Swedish (sv)
Other versions
FI20002610A (en
FI20002610A0 (en
Inventor
Lauri Paatero
Original Assignee
Setec Oy
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 Setec Oy filed Critical Setec Oy
Priority to FI20002610A priority Critical patent/FI111491B/en
Publication of FI20002610A0 publication Critical patent/FI20002610A0/en
Priority to PCT/FI2001/001034 priority patent/WO2002045313A1/en
Priority to AU2002218340A priority patent/AU2002218340A1/en
Publication of FI20002610A publication Critical patent/FI20002610A/en
Application granted granted Critical
Publication of FI111491B publication Critical patent/FI111491B/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/302Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Lock And Its Accessories (AREA)
  • Storage Device Security (AREA)

Description

111491111491

Avainparin generointi Tämän keksintö koskee ratkaisua, jolla kryptograafista operaatiota varten voidaan generoida toistensa pareina toimiva julkinen avain ja salainen 5 avain.The present invention relates to a solution for generating a pair of public key and secret key 5 for a cryptographic operation.

RSA-kryptaus (Rivest, Shamir, Adelman public-key encryption) on eräs esimerkki kryptograafisesta operaatiosta, jossa tarvitaan toistensa pareina toimivaa julkista avainta ja salaista avainta. RSA-kryptausta voidaan käyttää viestin salaamiseksi ennen sen lähettämistä epäluotettavan tiedonsiirto-10 kanavan kautta vastaanottajalle. Viestin lähettäjällä on käytettävissään vastaanottajan julkinen avain, jolloin hän kyseistä avainta käyttämällä kryptaa viestin ennen lähetystä. Vastaanottajalle on vuorostaan käytössään salainen avain, joka mahdollistaa vastaanotetun kryptatun viestin palauttamisen alkuperäiseen selväkieliseen muotoonsa. Jotta viestin kryptaus ja kryptatun viestin 15 palauttaminen onnistuisi, tulee lähettäjällä ja vastaanottajalla olla käytössään tämän mahdollistava avainpari.RSA encryption (Rivest, Shamir, Adelman public-key encryption) is an example of a cryptographic operation that requires a paired public key and a secret key. RSA encryption can be used to encrypt a message before sending it via an untrusted communication channel 10 to the recipient. The sender of the message has access to the recipient's public key, whereupon he encrypts the message before sending it. The recipient, in turn, has access to a secret key which allows the received encrypted message to be returned to its original plain-language format. For the message to be encrypted and the encrypted message to be successfully retrieved, the sender and the recipient must have a key pair that enables this.

Elektroninen allekirjoitus on eräs toinen esimerkki kryptograafisesta operaatiosta, jossa tarvitaan toistensa pareina toimivia salaisia avaimia. Tällöin viestin lähettäjä tuottaa viestistä ja salaisesta avaimesta riippuvaisen 20 elektronisen allekirjoituksen. Tämän jälkeen viestin lähettäjä lähettää viestin sekä elektronisen allekirjoituksen vastaanottajalle, jolla on käytössään julkinen avain. Julkisen avaimen avulla viestin vastaanottaja voi tämän jälkeen varmistaa, että elektroninen allekirjoitus on oikein. Elektroninen allekirjoitus on oikein, jos se on tuotettu viestillä jonka vastaanottaja on vastaanottanut ja vastaanot-25 tajan käytössä olevan julkisen avaimen parina toimivan salaisen avaimen avulla.An electronic signature is another example of a cryptographic operation that requires secret keys that are paired with each other. In this case, the sender of the message generates 20 electronic signatures depending on the message and the secret key. The message sender then sends the message and the electronic signature to the recipient, who has the public key. The public key then allows the recipient of the message to verify that the electronic signature is correct. An electronic signature is correct if it is generated by a message received by the recipient and by a secret key which is the pair of the public key used by the recipient.

Ennestään tunnetaan ratkaisu toistensa pareina toimivan julkisen avaimen ja salaisen avaimen generoimiseksi. Tätä tunnettua ratkaisua on selostettu tarkemmin kuvion 1 vuokaavion yhteydessä. Tähän tunnettuun ratkai- •» • ' 30 suun liittyy se epäkohta, että avainparin generointi on suhteellisen hidasta.A prior art solution for generating a public key and a secret key that functions in pairs is known. This known solution is explained in more detail in connection with the flow chart of Figure 1. A disadvantage of this known solver is that the generation of the key pair is relatively slow.

Hitaus aiheutuu ensisijaisesti siitä, että avainparin generointiin käytettävien alkulukujen etsiminen on hidasta. Satunnaisesti generoidun parittoman luvun arvon kasvattaminen siten, että siitä tulee alkuluku voidaan kylläkin suorittaa suhteellisen nopeasti. Ongelmallista on kuitenkin se, että kun on löydetty alku-35 luku on vielä varmistettava, että tämä löydetty alkuluku p täyttää ehdon, jonka 111491 2 mukaan suurin yhteinen tekijä luvulla [p-1] ja valitulla kokonaisluvulla e on yksi. Jos näin ei ole, joudutaan löydetty alkuluku hylkäämään, eli käytännössä palataan generoimaan satunnaisesti uutta paritonta lukua. Edellä mainitut toimenpiteet joudutaan lisäksi usein suorittamaan useita (kymmeniä) kertoja, ennen 5 kuin löydetään alkuluku joka täyttää asetetut ehdot. Tämän jälkeen on samat toimenpiteet vielä toistettava toisen ehdot täyttävän alkuluvun q löytämiseksi.The slowness is primarily due to the slow search for prime numbers used to generate the key pair. Increasing the value of a randomly generated odd number so that it becomes a prime can be performed relatively quickly. However, it is problematic that once a prime number 35 is found, it is still necessary to verify that this prime p found satisfies the condition that 111491 2 has the largest common factor in [p-1] and the selected integer e being one. If this is not the case, the found prime must be discarded, that is, practically returning to randomly generate a new odd number. In addition, the above operations often need to be performed several (tens) times before finding a prime that satisfies the set conditions. Then the same steps must be repeated to find another prime q that satisfies the conditions.

Sopivien alkulukujen löytäminen on näin ollen tunnetuissa ratkaisuissa hidasta. Tämä hitaus on hyvin kiusallista erityisesti silloin, kun on tarve generoida useita avainpareja. Toimikorttien tuotanto on eräs esimerkki tilan-10 teestä, jossa esiintyy tarve generoida suuria määriä avainpareja. Kun kyseessä on esimerkiksi elektronisena henkilökorttina toimivasta toimikortista, tulee jokaisen toimikortin muistiin tallentaa yksilöllinen, korttikohtainen salainen avain, jonka avulla toimikortin haltija voi tuottaa elektronisen allekirjoituksen. Tällaisia toimikortteja tuotetaan massatuotantona, jolloin tarvittavien avainpa-15 rien määrä on hyvin suuri. Tunnettuja ratkaisuja hyödyntämällä avainparin generointi ja salaisen avaimen tallennus toimikortin muistiin voi kestää jopa minuutin, mikä on hyvin pitkä aika massatuotannon kannalta.Thus, finding known prime numbers is slow in known solutions. This slowness is very embarrassing especially when it comes to generating multiple key pairs. Smart card production is one example of space-10 tea, where there is a need to generate large numbers of key pairs. For example, in the case of a smart card acting as an electronic identity card, each smart card must store in the memory a unique key specific to the card, enabling the holder to produce an electronic signature. Such smart cards are mass-produced, with a very large number of key pairs required. By utilizing known solutions, generating a key pair and storing a secret key in a smart card memory can take up to a minute, which is a very long time for mass production.

Tämän keksinnön tarkoitus on ratkaista edellä selostettu ongelma ja sadaa aikaan ratkaisu, joka mahdollistaa avainparin generoinnin nopeammin 20 kuin tunnetuissa ratkaisuissa. Tämä päämäärä saavutetaan keksinnön mukaisella menetelmällä toistensa pareina toimivan julkisen avaimen ja salaisen avaimen generoimiseksi kryptograafista operaatiota varten, jossa menetelmässä: valitaan kokonaisluku e, valitaan kaksi alkulukua p ja q jotka täyttävät ehdon, jonka mukaan lukujen [e] ja [p-1] sekä vastaavasti [e] ja [q-1] suurin 25 yhteinen tekijä on 1, lasketaan julkinen avain n=p*q, ja etsitään salainen avain d siten, että 1 <d<((p-1 )*(q-1)) ja e*d=1(mod(p-1)*(q-1)). Keksinnön mukaiselle menetelmälle on tunnusomaista, että menetelmässä mainitun ehdon täyttävien alkulukujen p ja q etsintä käsittää vaiheet, joissa: etsitään satunnainen pariton luku joka täyttää mainitun ehdon, ja mikäli mainittu luku ei ole alkuluku haetaan 30 mainitun luvun tilalle alkuluku joukosta [luku+k*e], jossa k on positiivinen ja parillinen kokonaisluku.The object of the present invention is to solve the problem described above and to provide a solution which enables the generation of a key pair faster than in known solutions. This object is achieved by the method of the invention for generating a pair of public key and secret key for a cryptographic operation, the method of: selecting an integer e, selecting two prime numbers p and q satisfying the condition that [e] and [p-1] and [e] and [q-1] have a maximum common factor of 1, calculate the public key n = p * q, and find the secret key d such that 1 <d <((p-1) * (q-1)) and e * d = 1 (mod (p-1) * (q-1)). The method of the invention is characterized in that the process of searching for prime numbers p and q satisfying said condition comprises the steps of: searching for a random odd number satisfying said condition and, if said number is not a prime, retrieving 30 primes from the prime number [number + k * e ], where k is a positive and an even integer.

Keksinnön kohteena on edelleen laitteisto toistensa pareina toimivan julkisen avaimen ja salaisen avaimen generoimiseksi, joka laitteisto käsittää: välineitä, jotka määrittelevät kokonaisluvun e, välineitä kahden alkuluvun p ja q 35 generoimiseksi, jotka alkuluvut täyttävät ehdon, jonka mukaan [e] ja [p-1] sekä 111491 3 vastaavasti [e] ja [q-1] suurin yhteinen tekijä on 1, laskinvälineitä jotka kertovat mainitut alkuluvut keskenään julkisen avaimen n laskemiseksi, ja laskinvälinei-, tä, jotka laskevat salaisen avaimen d siten, että 1<d< ((p-1 )(q-1)) ja e*d=1(mod(p-1)(q-1)). Keksinnön mukaiselle laitteistolle on tunnusomaista, 5 että välineisiin alkuluvun generoimiseksi kuuluu: välineitä mainitun ehdon täyttävän satunnaisen parittoman luvun generoimiseksi ja syöttämiseksi tarkistus-välineille, tarkistusvälineitä, jotka tarkastavat onko niille syötetty luku alkuluku, ja välineitä, jotka hakevat tarkistusvälineille syötetyn luvun tilalle uuden luvun joukosta [luku+k*e], jossa k positiivinen ja parillinen kokonaisluku, ja jotka syötit) tävät mainitun uuden luvun tarkistusvälineille, mikäli tarkistusvälineiden suorittama tarkistus osoittaa, että niille syötetty luku ei ole alkuluku.The invention further relates to an apparatus for generating a public key and a secret key which function in pairs, comprising: means for defining an integer e, means for generating two prime numbers p and q 35 which satisfy the condition that [e] and [p-1 ] and 111491 3 respectively, the largest common factor of [e] and [q-1] is 1, the calculator means which multiply said prime numbers to compute the public key n, and the calculator means which compute the secret key d such that 1 <d <( (p-1) (q-1)) and e * d = 1 (mod (p-1) (q-1)). The apparatus according to the invention is characterized in that the means for generating a prime include: means for generating and supplying a random odd number satisfying said condition to the checking means, checking means for checking whether the number entered is prime, and means for retrieving the number entered from the checking means. number + k * e], where k is a positive and even integer, and you enter) said new number on the verification means if the verification performed by the verification means indicates that the number entered on them is not a prime.

Keksintö perustuu siihen ajatukseen, että ensin generoidaan luku (p) joka täyttää pienimpään yhteiseen tekijään liittyvän ehdon, ja vasta tämän jälkeen tarkistetaan onko kyseessä alkuluku. Mikäli tällöin osoittautuu, että 15 tarkasteltava luku (p) ei ole alkuluku, voidaan alkuluvun etsintä rajoitta tiettyyn rajoitettuun lukujen joukkoon (p+k*e). Koska etsintä rajoittuu tiettyyn rajoitettuun lukujen joukkoon on se nopeampaa kuin tunnetuissa ratkaisuissa. Lisäksi etsinnän tuloksena saatu alkuluku täyttää varmasti myös suurimpaan yhteiseen tekijään liittyvän ehdon, koska etsintä on rajoitettu vain niihin lukuihin, 20 jotka täyttävät tämän ehdon.The invention is based on the idea of first generating a number (p) that satisfies the condition related to the smallest common factor, and only then checks whether it is a prime. If it turns out that the number (p) to be considered is not a prime, the search for the prime can be limited to a limited set of numbers (p + k * e). Because the search is limited to a limited set of numbers, it is faster than in known solutions. In addition, the prime resulting from the search will certainly also satisfy the condition related to the largest common factor, since the search is limited to only those numbers that satisfy this condition.

Keksinnön merkittävin etu on näin ollen, että avainparin generointi nopeutuu merkittävästi verrattuna tunnettuihin ratkaisuihin. Esimerkiksi toimikorttien valmistuksessa avainparin generointi ja salaisen avaimen tallennus toimikortin muistiin voidaan tehdä noin 15 sekunnissa, mikä on merkittävästi 25 lyhyempi aika kuin tunnetuissa ratkaisuissa.The major advantage of the invention is thus that the generation of the key pair is significantly accelerated compared to known solutions. For example, in smart card manufacturing, generating a key pair and storing a secret key in the memory of the smart card can be done in about 15 seconds, which is a significantly shorter time than known solutions.

Eräässä keksinnön edullisessa suoritusmuodossa alkuluvun hakeminen rajoitetusta joukosta p+k*e käsittää vaiheet joissa generoidaan satunnaisesti positiivinen ja parillinen kokonaisluku k, ja kasvatetaan luvun k arvoa kahdella kunnes yhtälön p+k*e tulokseksi saadaan alkuluku. Tässä keksinnön suori-30 tusmuodossa alustavasti valittua lukua p kasvatetaan näin ollen valitun kokonaisluvun e monikerroilla, jolloin voidaan varmistaa, että yhtälön p+k*e antama tulos täyttää suurimpaan yhteiseen tekijään liittyvän ehdon. Eli heti kun on löydetty alkuluku kelpaa kyseinen alkuluku käytettäväksi salaisen ja julkisen avaimen generoinnissa.In a preferred embodiment of the invention, retrieving a prime from a finite set of p + k * e involves the steps of randomly generating a positive and even integer k, and incrementing the value of k by two until a prime is obtained. Thus, in this embodiment of the invention, the initially selected number p is incremented by a multiple of the selected integer e, thereby ensuring that the result of the equation p + k * e satisfies the condition associated with the greatest common factor. That is, as soon as a prime is found, that prime is used for generating a secret and public key.

111491 4111491 4

Keksintöä selostetaan seuraavassa esimerkinomaisesti lähemmin viittaamalla oheisiin kuvioihin, joista: kuvio 1 esittää vuokaaviota tekniikan tason mukaisesta ratkaisusta avainparin generoimiseksi, 5 kuvio 2 esittää vuokaaviota keksinnön mukaisen menetelmän mu kaisesta avainparin generoinnista, ja kuvio 3 esittää lohkokaaviota keksinnön mukaisesta laitteistosta avainparin generoimiseksi.The invention will now be described in more detail by way of example with reference to the accompanying drawings, in which: Figure 1 is a flowchart of a prior art key pair generation, Figure 2 is a flowchart of a key pair generation according to the method of the invention, and Figure 3 is a block diagram of

Kuvion 1 vuokaavio soveltuu esimerkiksi salaisen ja julkisen avai-10 men generointiin RSA-kryptausta varten. RSA-kryptauksessa viestin lähettäjällä on käytössään julkinen avain n sekä kokonaisluku e. Näiden avulla lähettäjä kryptaa viestinsä. Viestin vastaanottajalla on vuorostaan käytettävissään salainen avain d, joka on julkisen avaimen n pari, sekä sama kokonaisluku e, joka on viestin lähettäjän käytössä. Näiden avulla vastaanottaja voi purkaa 15 kryptatun viestin sen alkuperäiseen (selväkieliseen) muotoon.The flowchart of Figure 1 is suitable, for example, for generating secret and public keys for RSA encryption. In RSA encryption, the sender of the message has the public key n and the integer e. These are used by the sender to encrypt their message. The recipient of the message, in turn, has access to the secret key d, which is a pair of public key n, and to the same integer e that is used by the sender of the message. These allow the recipient to decode 15 encrypted messages in their original (plain language) format.

Lohkossa A valitaan kokonaisluku e. Käytännössä kokonaisluku voi olla valittuna järjestelmäkohtaiseksi esimerkiksi siten, että kaikki tiettyyn järjestelmään kuuluvat laitteet hyödyntävät samaa kokonaislukua e. Näin ollen uutta kokonaislukua e ei tarvitse generoida erikseen jokaiselle avainparille, vaan se 20 voi olla etukäteen valittu.In block A, an integer e is selected. In practice, an integer may be selected system-specific, for example, so that all devices in a particular system use the same integer e. Thus, a new integer e does not need to be generated separately for each key pair.

Lohkossa B generoidaan satunnainen pariton luku p. Lohkossa C tarkistetaan onko generoitu luku p alkuluku. Jos ei ole kasvatetaan lohkossa D sen arvoa kahdella, kunnes lohkon C tarkistus osoittaa, että kyseessä on alku-luku.In block B a random odd number p is generated. In block C it is checked whether the generated number p is a prime number. If not, the value in block D is incremented by two until a check in block C indicates that it is a prime number.

25 Lohkossa E lasketaan luvun e sekä luvun p-1 suurin yhteinen tekijä GCD (Greatest Common Divisor). Mikäli tällöin osoittautuu, että luvuilla e ja p-1 on olemassa yhteinen tekijä joka on suurempi kuin 1, merkitsee tämä että luku p ei täytä asetettua ehtoa. Tällöin palataan lohkoon B ja aloitetaan uuden alkuluvun p etsintä.25 In block E, the greatest common factor in GCD (Greatest Common Divisor) of p and p-1 is calculated. If it turns out that the numbers e and p-1 have a common factor greater than 1, this means that the number p does not meet the set condition. This returns to block B and begins the search for a new prime p.

30 Mikäli sitävastoin lohkossa E havaitaan, että suurimpaan yhteiseen tekijään liittyvä ehto täyttyy siirrytään lohkoon F. Lohkot F -1 vastaavat lohkoja B - E sikäli, että niissä generoidaan vastaavalla tavalla toinen alkuluku q, joka täyttää suurimpaan yhteiseen tekijään liittyvän ehdon.If, on the other hand, it is found in block E that the condition having the greatest common factor is satisfied, then move to block F. Blocks F -1 correspond to blocks B to E in that they generate a second prime q correspondingly satisfying the condition related to the largest common factor.

5 111491 . Kun on löydetty kaksi alkulukua p ja q, jotka täyttävät suurimpaan yhteiseen tekijään liittyvän ehdon lasketaan lohkossa J julkinen avain n, joka , saadaan yhtälöstä n=p*q.5, 111491. When two prime numbers p and q are found that satisfy the condition related to the greatest common factor, then in block J the public key n is obtained, which is obtained from the equation n = p * q.

Lopuksi lohkossa K etsitään salainen avain d, joka täyttää ehdot: 5 1<d<(p-1)*(q-1) ja e*d=1(mod(p-1)*(q-1)). Tällaiset ehdot täyttävän luvun löytämiseksi voidaan hyödyntää esimerkiksi Euclidean algoritmia, jota on kuvattu mm. julkaisun "Handbook of applied cryptography", Menezes, Oorschot and Vanstone, CRC press, October 1996, luvussa 2.4.2 (algoritmi 2.104). Vaihtoehtoisesti voidaan hyödyntää esimerkiksi saman julkaisun luvussa 14.4.3 koh-10 dassa 14.64 selostettua algoritmia.Finally, in block K, a secret key d is found that satisfies the conditions: 5 1 <d <(p-1) * (q-1) and e * d = 1 (mod (p-1) * (q-1)). For example, the Euclidean algorithm described in, e. See "Handbook of applied Cryptography" in Menezes, Oorschot and Vanstone, CRC Press, October 1996, Chapter 2.4.2 (Algorithm 2.104). Alternatively, an algorithm such as that described in Chapter 14.4.3, paragraph 14.64 of the same publication, may be used.

Kuvion 1 vuokaaviossa esitetyn tunnetun ratkaisun merkittävin heikkous on se, että mikäli lohkoissa E ja I havaitaan, että suurimpaan yhteiseen tekijään liittyvä ehto ei täyty, joudutaan lukujen p ja vastaavasti q etsintä aloittamaan uudelleen uuden parittoman luvun generoinnilla. Näin ollen aikuis luvun etsintä joudutaan käytännössä toistamaan useita kertoja ennen kuin löytyy sellainen alkuluku, joka täyttää suurimpaan yhteiseen tekijään liittyvän ehdon.A major weakness of the known solution shown in the flowchart of Fig. 1 is that if it is found in blocks E and I that the condition of the greatest common factor is not met, the search for p and q, respectively, must be resumed by generating a new odd number. Thus, in practice, finding an adult number must be repeated several times before finding a prime number that satisfies the condition related to the greatest common factor.

Kuvio 2 esittää vuokaaviota keksinnön mukaisen menetelmän mukaisesta avainparin generoinnista. Kuvion 2 vuokaavio vastaa hyvin pitkälle 20 kuvion 1 vuokaaviota, mutta se poikkeaa kuvion 1 tapauksesta nimenomaan alkulukujen p ja q etsinnän osalta.Figure 2 shows a flow chart of key pair generation according to the method of the invention. The flowchart of Figure 2 is very similar to the flowchart of Figure 1 but differs from the case of Figure 1 specifically in the search for primes p and q.

Lohkossa A' valitaan kokonaisluku e. Käytännössä kokonaisluku voi olla valittuna järjestelmäkohtaiseksi esimerkiksi siten, että kaikki tiettyyn järjestelmään kuuluvat laitteet hyödyntävät samaa kokonaislukua e. Näin ollen uutta 25 kokonaislukua e ei tarvitse generoida erikseen jokaiselle avainparille, vaan se voi olla etukäteen valittu.In block A 'an integer e is selected. In practice, an integer may be selected system-specific, for example, so that all devices in a particular system use the same integer e. Thus, the new 25 integers e need not be generated separately for each key pair.

Lohkossa B' generoidaan satunnainen pariton luku p. Lohkossa C tarkistetaan täyttääkö generoitu luku p suurimpaan yhteiseen tekijään liittyvän ehdon. Ehto täyttyy jos suurin yhteinen tekijä on luvuille e ja (p-1) = 1. Mikäli 30 ehto ei täyty palataan lohkoon B' niin monta kertaa kunnes löytyy ehdon täyttävä luku p.In block B 'a random odd number p is generated. In block C it is checked whether the generated number p satisfies the condition related to the largest common factor. The condition is satisfied if the greatest common factor is for the numbers e and (p-1) = 1. If the condition 30 is not fulfilled, return to block B 'as many times as there is a number p satisfying the condition.

Kun on löydetty edellä mainitun ehdon täyttävä luku p, tarkistetaan lohkossa D' onko kyseinen luku alkuluku. Mikäli p ei ole alkuluku aloitetaan alkuluvun etsintä joukosta p+k*e. Kuvion 2 esimerkin mukaisessa tapauksessa 35 tämä tapahtuu siten, että lohkossa E' generoidaan parillinen satunnaisluku k, 111491 6 jonka jälkeen luvun p arvoa lohkossa F' kasvatetaan yhtälön p=p+k*e mukaisesti. Jos tämän jälkeen lohkossa D' todetaan, että p ei vieläkään ole alkuluku toistetaan lohkojen E' ja F' toimenpiteet, kunnes lohkossa D' todetaan, että p on alkuluku.When a number p satisfying the above condition is found, it is checked in block D 'whether that number is a prime number. If p is not a prime, the search for prime in p + k * e is started. In the case 35 of the example of Figure 2, this is done by generating in block E 'an even random number k, 111491 6, and then increasing the value of p in block F' according to the equation p = p + k * e. If, after this, it is found in block D 'that p is still not a prime, then the operations of blocks E' and F 'are repeated until it is found in block D' that p is a prime.

5 Kun on löydetty ehdot täyttävä alkuluku p suoritetaan lohkoissa G' - K' vastaavat toimenpiteet kuin lohkoissa B' - E', eli niissä generoidaan vastaavalla tavalla toinen alkuluku q, joka täyttää suurimpaan yhteiseen tekijään liittyvän ehdon.When a prime p satisfying the conditions is found, the steps G 'to K' perform similar operations to the blocks B 'to E', i.e. they generate a second prime q correspondingly satisfying the condition related to the largest common factor.

Kuvion 2 lohkot L' - M' vastaavat kuvion 1 lohkoja J - K, eli niissä 10 lasketaan julkinen avain n yhtälöllä n~p*q, ja lopuksi etsitään salainen avain d siten, että luku d täyttää ehdot 1<d< (p-1)*(q-1) ja e*d=1(mod(p-1)*(q-1)).The blocks L '- M' of Figure 2 correspond to blocks J - K of Figure 1, i.e., they calculate the public key n by the equation n ~ p * q, and finally find the secret key d such that d satisfies the conditions 1 <d <(p- 1) * (q-1) and e * d = 1 (mod (p-1) * (q-1)).

Kuvion 2 esimerkistä poiketen voidaan alkuluvun etsintä suorittaa hiukan poikkeavalla tavalla kuin mitä edellä on selostettu. Tällöin lohkojen E' -F' ja J' - K' sijasta toimitaan siten, että parillinen ja positiivinen satunnaisluku k 15 generoidaan ainoastaan yhden kerran, eli silloin kun ensimmäisen kerran on havaittu että luku p (tai vastaavasti q) ei ole alkuluku. Mikäli tämän ensimmäisen kerran jälkeen havaitaan, että luvun p=p+k*e uusi arvo ei vieläkään ole alkuluku, aloitetaan luvun k arvon kasvattaminen kahdella (k=k+2), jota toistetaan kunnes yhtälön p=p+k*e tuloksena saadaan alkuluku. Tällainen menettely 20 nopeuttaa alkuluvun löytämistä.Unlike the example in Figure 2, the prime search can be performed in a slightly different way than described above. Here, instead of blocks E '-F' and J '-K', the operation is such that an even and positive random number k 15 is generated only once, that is, when it is first discovered that p (or q, respectively) is not a prime. If, after this first time, it is found that the new value of p = p + k * e is still not a prime, incrementing the value of k by two (k = k + 2) is repeated and repeated until the result of p = p + k * e a prime number. Such a procedure 20 speeds up the discovery of the prime.

Kuvio 3 esittää lohkokaaviota keksinnön mukaisesta laitteistosta avainparin generoimiseksi. Kuvion 3 laitteiston avulla voidaan generoida . avainpareja esimerkiksi toimikortin valmistuksen yhteydessä, jolloin laitteisto voi muodostua esimerkiksi tietokoneesta, jolla avaimet tuotetaan. Kuvion 3 25 lohkojen toiminnot voidaan toteuttaa piiriratkaisuilla, tietokoneohjelmilla tai näiden yhdistelmillä. Kuvion 3 laitteiston avulla voidaan soveltaa kuvion 2 vuo-kaaviossa esitettyä menetelmää.Figure 3 is a block diagram of an apparatus according to the invention for generating a key pair. The hardware of Fig. 3 can be generated. key pairs, for example, in connection with the production of a smart card, whereby the hardware may consist of, for example, a computer that produces the keys. The functions of the blocks of Figure 3 25 may be implemented by circuit solutions, computer programs, or combinations thereof. The apparatus of Figure 3 can be applied to the method shown in the flow chart of Figure 2.

Lohkon 1 avulla suoritetaan kokonaisluvun e määrittely. Mikäli kyseessä on järjestelmä, jossa samaa kokonaislukua e hyödynnetään useiden • *« 30 avainparien yhteydessä, esimerkiksi kaikkien tiettyyn järjestelmään kuuluvien toimikorttien yhteydessä, niin kokonaisluku e voi olla etukäteen päätetty. Tällöin lohko 1 voi vastaanottaa kokonaisluvun laitteiston ulkopuolelta käyttöliittymän välityksellä, jolloin laitteiston käyttäjä voi syöttää sen esimerkiksi näppäimistön avulla laitteistolle. Vaihtoehtoisesti mikäli kokonaisluku e vaihtelee 7 111491 avainparista toiseen voi lohkoon 1 sisältyä satunnaislukugeneraattori joka tuottaa avainparikohtaisia kokonaislukuja e.With block 1, an integer e is determined. In the case of a system where the same integer e is utilized for multiple key pairs, such as all smart cards belonging to a particular system, the integer e may be predetermined. In this case, block 1 can receive an integer from outside the apparatus via a user interface, whereby the user of the apparatus can enter it, for example, by means of a keyboard into the apparatus. Alternatively, if the integer e ranges from 7111491 key pairs to another, block 1 may include a random number generator which produces key pair specific integers e.

Lohkoon 2 kuuluu satunnaislukugeneraattori, joka on järjestetty tuottamaan parittomia lukuja p ja q. Kyseiset luvut syötetään lohkolle 3, jossa 5 tarkistetaan täyttävätkö luvut ehdon, jonka mukaan suurin yhteinen tekijä luvuille e ja p-1 sekä vastaavasti e ja q-1 on yksi. Mikäli lohko 3 havaitsee, että on olemassa tätä suurempia yhteisiä tekijöitä, ohjaa se toistuvasti lohkoa 2 tuottamaan uuden luvun p ja/tai q, kunnes lohko 3 toteaa, että se on vastaanottanut ehdot täyttävät luvut p ja q.Block 2 includes a random number generator arranged to produce odd numbers p and q. These numbers are input to block 3, where 5 checks whether the numbers satisfy the condition that the largest common factor for e and p-1 and e and q-1, respectively, is one. If block 3 detects that larger common factors exist, it repeatedly directs block 2 to produce a new number p and / or q until block 3 determines that it has received the conditions p and q.

10 Lohko 3 syöttää mainitun ehdon täyttävät luvut tarkistuslohkolle 4, joka suorittaa tarkistuksen sen selvittämiseksi ovatko luvut p ja q alkulukuja. Mikäli p ja/tai q ei ole alkuluku syöttää lohko 4 luku/luvut laskentalohkolle 6, joka hakee niiden tilalle uudet luvut rajoitetusta joukosta. Tämä tapahtuu siten, että lohko 5 generoi lohkon 4 ohjauksesta positiivisten, parillisen satunnaislu- 15 vun k, jonka se syöttää lohkolle 6. Lohko 6 muuttaa tämän jälkeen luvun p ja/tai q arvoa kaavan p=p+k*e ja/tai q=q+k*e mukaisesti sekä syöttää uuden luvun/luvut lohkolle 4 uutta alkuluvun tarkistusta varten. Mikäli myöskään uusi luku/luvut eivät ole alkulukuja syöttää lohko 4 ne toistuvasti takaisin laskenta-lohkolle 6, kunnes lohko 4 havaitsee, että sekä luku p että q ovat alkulukuja.Block 3 supplies numbers meeting said condition to check block 4, which performs a check to determine if the numbers p and q are prime. If p and / or q is not a prime, block 4 will enter the number (s) in the computation block 6, which will retrieve them from a limited set of numbers. This is done by block 5 generating, from the control of block 4, a positive, even random number k, which it supplies to block 6. Block 6 then changes the value of p and / or q by the formula p = p + k * e and / or q = q + k * e and enter a new number (s) for block 4 for new prime check. Also, if the new number (s) are not prime, block 4 repeatedly feeds it back to counting block 6 until block 4 discovers that both p and q are prime.

20 Kun lohko 4 on todennut luvut p ja q alkuluvuiksi laskee laskin 7 julkisen avaimen n kertomalla luvut p ja q toistensa kanssa, eli n=p*q. Vastaavasti laskin 8 laskee salaisen avaimen d, joka täyttää ehdot 1<d<(p-1)*(q-1) ja .. e*d=1(mod(p-1)*(q-1)), esimerkiksi kuvion 1 lohkon k yhteydessä mainittuaWhen block 4 has determined the numbers p and q as prime numbers, the calculator 7 calculates the public key n by multiplying the numbers p and q with each other, that is, n = p * q. Similarly, calculator 8 calculates the secret key d which satisfies the conditions 1 <d <(p-1) * (q-1) and .. e * d = 1 (mod (p-1) * (q-1)), e.g. 1 in connection with block k of Figure 1

Euclidean algoritmia hyödyntämällä.Utilizing the Euclidean algorithm.

25 Kuvion 3 laitteisto tuottaa näin ollen tuloksen, joka muodostuu julki sesta avaimesta n sekä salaisesta avaimesta d. Mikäli kokonaisluku e on generoitu laitteiston toimesta sisältyy myös kyseinen kokonaisluku e laitteiston edelleen syöttämään tulokseen.The apparatus of Figure 3 thus produces a result consisting of a public key n and a secret key d. If the integer e is generated by the hardware, that integer e is also included in the result further input by the hardware.

On ymmärrettävä, että edellä oleva selitys ja siihen liittyvät kuviot 30 on ainoastaan tarkoitettu havainnollistamaan esillä olevaa keksintöä. Alan ammattimiehelle tulevat olemaan ilmeisiä erilaiset keksinnön variaatiot ja muunnelmat ilman että poiketaan oheisissa patenttivaatimuksissa esitetyn keksinnön suojapiiristä ja hengestä.It is to be understood that the foregoing description and the accompanying figures 30 are only intended to illustrate the present invention. Various variations and modifications of the invention will be apparent to those skilled in the art without departing from the scope and spirit of the invention set forth in the appended claims.

Claims (3)

1. Förfarande för genererig av en som varandras par fungerande of-fentlig nyckel och hemlig nyckel för en kryptografisk operation, i vilket förfarande: ett heltal e väljs, 5 tvä primtal p och q väljs, vilka primtal fyller villkoret att talen [e] och [p-1] samt motsvarande [e] och [q-1] har som största gemensamma nämnare 1, den offentliga nyckeln n=p*q räknas, och den hemliga nyckeln d söks, sä att: 1 <d<[[p-1 ]*[q-1 ]] och 10 e*d=1[mod[p-1]*[q-1]], kännetecknad av, att i förfarandet omfattar sök-ningen efter primtal p och q som uppfyller nämnda villkor steg där: ett slumpmässigt udda tai söks, vilket tai uppfyller nämnda villkor, och ifall nämnda tai inte är ett primtal söks istället för nämnda tai ett 15 primtal ur gruppen [luku+k*e], där k är ett positivt och jämt heltal.A method for generating one of each other's pairs of public key public key and secret key for a cryptographic operation, in which method: an integer e is selected, two primes p and q are selected, which primers fulfill the condition that the numbers [e] and [p-1] and the corresponding [e] and [q-1] have the largest common denominator 1, the public key n = p * q is counted, and the secret key d is searched, so that: 1 <d <[[p -1] * [q-1]] and 10 e * d = 1 [mod [p-1] * [q-1]], characterized in that the process comprises the search for prime numbers p and q that fulfill the aforementioned conditions step there: a random odd tai is sought, which tai meets said condition, and if said tai is not a prime number, instead of said tai a prime number is sought from the group [luku + k * e], where k is a positive and even integer . 2. Förfarande enligt krav 1, kännetecknad av, att nämnda sökning av primtal ur gruppen [luku+k*e] omfattar steg där: ett positivt och jämnt heltal k genereras slumpmässigt, och värdet pa talet k ökas med tvä tills ekvationen [luku+k*e] ger som 20 resultat ett primtal.Method according to claim 1, characterized in that said search of prime numbers from the group [luku + k * e] comprises steps where: a positive and even integer k is randomly generated, and the value of the number k is increased by two until the equation [luku + k * e] gives a prime number as a result. 3. Anordning för generering av en som varandras par fungerande offentlig nyckel och hemlig nyckel, vilken anordning omfattar: medel (1) som definierar ett heltal e, medel för generering av tvä primtal p och q, vilka primtal fyller villkoret 25 att [e] och [p-1] samt motsvarande [e] och [q-1] har som största gemensamma nämnare 1, kalkyleringsmedel (7) som multiplicerar nämnda primtal med var-andra för att beräkna den offentliga nyckeln n, och kalkyleringsmedel (8) beräknar den hemliga nyckeln d sä, att: 30 1 <d<[[p-1 ]*[q-1 ]] och e*d=1[mod[p-1]*[q-1]], k ä n n e t e c k n a d av, att med-len för generering av primtal omfattar: medel (2 - 3) för generering och matning tili kontrollmedel (4) ett slumpmässigt udda tai som uppfyller nämnda villkor, kontrollmedel (4) som kontrollerar ifall det tili dessa matade talet är 35 ett primtal, och 111491 medel (5, 6) som istället för talet som matats till kontrollmedlen sö-ker ett nytt tai ur gruppen [luku+k*e], där k är ett positivt och jämt heltal, och som matar nämnda nya tal till kontrollmedlen (4), ifall kontrollen utförd av kontrollmedlen indikerar att talet som matats till dem inte är ett primtal.A device for generating a pair of public key operating keys and a secret key, comprising: means (1) defining an integer e, means for generating two prime numbers p and q, which prime numbers satisfy the condition that [e] and [p-1] and corresponding [e] and [q-1] have as their largest common denominator 1, calculating means (7) which multiplies said prime number by each other to calculate the public key n, and calculating means (8) calculate the secret key d is such that: 1 <d <[[p-1] * [q-1]] and e * d = 1 [mod [p-1] * [q-1]], characterized the means for generating prime numbers comprising: means (2 - 3) for generating and feeding to control means (4) a random odd tai that satisfies said condition, control means (4) which checks if the number of these numbers is 35 a prime number, and means (5, 6) which, instead of the number fed to the control means, seek a new tai from the group [luku + k * e], where kä is a positive and even integer, and which feeds said new number to the control means (4), if the control performed by the control means indicates that the number fed to them is not a prime number.
FI20002610A 2000-11-28 2000-11-28 Generating a key pair FI111491B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
FI20002610A FI111491B (en) 2000-11-28 2000-11-28 Generating a key pair
PCT/FI2001/001034 WO2002045313A1 (en) 2000-11-28 2001-11-27 Key pair generation
AU2002218340A AU2002218340A1 (en) 2000-11-28 2001-11-27 Key pair generation

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
FI20002610 2000-11-28
FI20002610A FI111491B (en) 2000-11-28 2000-11-28 Generating a key pair

Publications (3)

Publication Number Publication Date
FI20002610A0 FI20002610A0 (en) 2000-11-28
FI20002610A FI20002610A (en) 2002-05-29
FI111491B true FI111491B (en) 2003-07-31

Family

ID=8559599

Family Applications (1)

Application Number Title Priority Date Filing Date
FI20002610A FI111491B (en) 2000-11-28 2000-11-28 Generating a key pair

Country Status (3)

Country Link
AU (1) AU2002218340A1 (en)
FI (1) FI111491B (en)
WO (1) WO2002045313A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8233618B2 (en) 2007-07-25 2012-07-31 Sai Chuen Hui Method and system for generating a pair of public key and secret key

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4405829A (en) * 1977-12-14 1983-09-20 Massachusetts Institute Of Technology Cryptographic communications system and method
DE69113245D1 (en) * 1991-03-14 1995-10-26 Omnisec Ag Regensdorf Public key encryption system using elliptical curves over rings.
US5231668A (en) * 1991-07-26 1993-07-27 The United States Of America, As Represented By The Secretary Of Commerce Digital signature algorithm
US5848159A (en) * 1996-12-09 1998-12-08 Tandem Computers, Incorporated Public key cryptographic apparatus and method

Also Published As

Publication number Publication date
AU2002218340A1 (en) 2002-06-11
WO2002045313A1 (en) 2002-06-06
FI20002610A (en) 2002-05-29
FI20002610A0 (en) 2000-11-28

Similar Documents

Publication Publication Date Title
Lindell Fast secure two-party ECDSA signing
Boneh et al. Using level-1 homomorphic encryption to improve threshold DSA signatures for bitcoin wallet security
Hohenberger et al. Synchronized aggregate signatures from the RSA assumption
Guillevic et al. Algorithms for outsourcing pairing computation
Saarinen The BlueJay ultra-lightweight hybrid cryptosystem
Bhat et al. Impact of computational power on cryptography
Paar et al. The RSA cryptosystem
Harn et al. Structured multisignature algorithms
Dubey et al. Cryptanalytic attacks and countermeasures on RSA
Ozmen et al. Energy-aware digital signatures for embedded medical devices
Stallings Digital signature algorithms
FI111491B (en) Generating a key pair
Andreevich et al. On Using Mersenne Primes in Designing Cryptoschemes
Rass et al. Authentic quantum nonces
Yang ECC, RSA, and DSA analogies in applied mathematics
Schmid ECDSA-application and implementation failures
Chen et al. Server-aided RSA key generation against collusion attack
Kadry et al. Design of secure mobile communication using fingerprint
Abdurahmonov et al. Improving Smart Card Security Using Elliptic Curve Cryptography over Prime Field (F p)
Horng A secure server-aided RSA signature computation protocol for smart cards
Lee et al. Cloud server aided computation for elgamal elliptic curve cryptosystem
Paar et al. Public-key cryptosystems based on the discrete logarithm problem
Pontie et al. Design of a secure architecture for scalar multiplication on elliptic curves
Mohanty et al. A strong designated verifiable DL based signcryption scheme
Xuan et al. Comparison research on digital signature algorithms in mobile web services

Legal Events

Date Code Title Description
PC Transfer of assignment of patent

Owner name: GEMALTO OY

MA Patent expired