200950457 九、發明說明: 【發明所屬之技術領域】 本創作係為一種非對稱加解密的方法,其至少 包含一明文(M)、一合數(n);從該合數選取一公 鑰(e)、一私鑰⑼;加解密運算以Mxemod/7 = c產生一 密文(C),以c X mod λ = Μ還原該明文。 【先前技術】 & 習用技術之非對稱加解密的方法,係以二個大 質數(Ρ、q)產生一模數 w = pxqr ,再以 ίί(7ϊ) = (/?-1)Χ(《-1) 备成 函數模數,以e X t/ mod參(w) = 1 產生,—公(e)、 一私鑰(d); —明文(Μ)以π mod„ = c 產生一密文 (C);以Crfmod« = M 取得該明文。 習用技術的安全重點,強調以二個大質數之乘積 值’藉由該值無法在短時間以破解方式還原該質 數,提高該配對公、私鑰之安全性。 【發明内容】 β 發明所欲解決之技術問題: 習用技術採用次方運算,該次方值的長度增加 即表示耗費愈多運算時間;但以龐大之金融交易、 契約簽定之高安全性考量’該方法本身無法縮短處 理時間。 發明解決問題之技術手段: 選取一明文如)、一合數(η);從該合數選取 么餘(e)、一私瑜(d),以a/ x e m〇d w = c產生一密文 5 200950457 (C),以Cxc/mod« = M還原該明文。 發明對照先前技術之功效: 對照本發明與習用技術,兩者的差別: 1. 錄起:習用技術之瑜匙exc/ mod #(n) = 1 須以搜尋方 式找到適當的鑰匙;本發明之鑰匙,在合數⑻内 以任意挑選產生’容易製造且數量豐富。 2. 運算:習用技術以次方運算,即多次乘法;本發 明直接以乘法運算,即祇乘一次,處理迅速β 【實施方式】 本發明之非對稱加解密方式,其主要係包含: 符被舆定義: Ρ :質數。 η:合數,至少一質數乘積。 例 :(a) n^pxq P,q e P 2* •表不為2# mod w 0 例 :(a) 2。= 2㈣β 尸1> = 1 • 2的倒數。 例 :⑻ Xx2 = i (b) κ = (Λ+% X*' •表不為K mod w。 例:⑻ % = 2㈣吻-1)·1 (b) ^χ2'=1 公鑰舆私鑰: 本發明無須考慮習用技術之函數模數外《),當 合數(η)產生,即可選取一公鑰⑻、一私鑰⑼,其 至少包含以下步驟,如第一圖所示: 6 200950457 1· η = pxqxrx... p,q,r,…& ; 2 ie = 2,,c/ = Xf · .\e = Y2\d^T , 加密與解密: 由於ex〇T = l ,因此任意一明文乘以e再乘以d 或乘以d再乘以e,必可還原該明文;本發明加解 密運算,如第二圖所示:200950457 IX. Description of the invention: [Technical field to which the invention pertains] The present invention is an asymmetric encryption and decryption method, which includes at least one plaintext (M) and one composite number (n); a public key is selected from the composite number ( e), a private key (9); the encryption and decryption operation generates a ciphertext (C) with Mxemod/7 = c, and restores the plaintext with c X mod λ = Μ. [Prior Art] & Asymmetric encryption and decryption method of the conventional technique, which generates a modulus w = pxqr with two large prime numbers (Ρ, q), and then ίί(7ϊ) = (/?-1)Χ( "-1) Prepare a function modulus, which is generated by e X t/ mod with reference to (w) = 1, - public (e), a private key (d); - plaintext (Μ) with π mod„ = c Ciphertext (C); Obtain the plaintext with Crfmod« = M. The safety focus of the conventional technique emphasizes the product value of two large prime numbers' by which the prime number cannot be reduced in a short time and the pair is improved. The security of the private key. [Invention] The technical problem to be solved by the invention is as follows: The conventional technique uses the power of the power of the second party, and the increase in the length of the power value means that the operation time is more and more; but the financial transaction and contract are huge. Signed high security considerations 'The method itself can not shorten the processing time. Invented the technical means to solve the problem: Select a plain text such as), a composite number (η); select from the composite number (e), a private Yu (d) Generate a ciphertext 5 200950457 (C) with a/ xem〇dw = c and restore the plaintext with Cxc/mod« = M. Controlling the efficacy of the prior art: In contrast to the present invention and the prior art, the difference between the two: 1. Record: the skill of the technology exc / mod # (n) = 1 must find the appropriate key by searching; the key of the present invention In the composite number (8), it is easy to manufacture and abundant in quantity. 2. Operation: The conventional technique uses the power of the second power, that is, multiple multiplication; the present invention directly multiplies, that is, only multiplies, and processes the fast β. Mode] The asymmetric encryption and decryption method of the present invention mainly includes: 舆 is defined as: Ρ: prime number η: composite number, at least one prime product. Example: (a) n^pxq P, qe P 2* • The table is not 2# mod w 0 Example: (a) 2 = 2 (four) β corpse 1 > = 1 • The reciprocal of 2. Example: (8) Xx2 = i (b) κ = (Λ+% X*' • The table is not K Mod w. Example: (8) % = 2 (four) kiss -1) · 1 (b) ^ χ 2' = 1 public key 舆 private key: The present invention does not need to consider the function of the function of the external modulus "), when the composite number (η) is generated , you can select a public key (8) and a private key (9), which at least include the following steps, as shown in the first figure: 6 200950457 1· η = pxqxrx... p,q,r,...&am p; ; 2 ie = 2,,c/ = Xf · .\e = Y2\d^T , Encryption and decryption: Since ex〇T = l , any plaintext is multiplied by e and multiplied by d or multiplied by d Multiply by e, the plaintext can be restored; the encryption and decryption operation of the present invention is as shown in the second figure:
1. M xe mod n = C ❺ 2. Cxd mod n = M 加解密的實施例: 為使得審查委員能更清楚了解本發明之内容, 以下係針對質數判斷、公鑰與私鑰及加密與解密作 一詳細說明: 設P = 45433,? = 52691,以一維16位元矩陣表示為 P = [10110001011110011 ? = [1100110111010011]: 質數判斷: 一數值排除最低位元,取兩端為1且最大長度為 2或%之次方值;取該數值之餘數,當輸出為1 表示該數值為質數。 • 以《 =尸= [1011000101111001]為例,其次方值為 [1011000101 111] ·· 。i 0。。i。1 i ! i] =1,所以 45433 為質數。 • 以《 = 1729 = [110011000001】為例,其次方值為 [noon]: 7 200950457 2[1 1 ° ° 1 1]*1 ,所以1729不為質數。 上例之1729為一 CarmichaelNi皿ber ,以習用技術會 誤判為質數;在本發明可避免此類錯誤。 公鑰舆私錡: ” = 彳= [1000111010110 000 0010101110111011] [01000111010110000001010111011110] i = [11000001010000100011110011000111] e = 2'=[01010001110000100011010010010110] ® ^ = =[10001101110111101010000001100110] 加密舆解密: M = [l01101110110101l]<« C = Mx e mod « = [01011101010011110110100000101010] M = Cxd mod n = [l 011011101101011] 從實施例e =政,該運算式的i經由亂數產 生’相較習用技術,製作極具簡單化、彈性化《在 ❹ 安全性考量上,除了η被破解,但以目前技術尚無 短時間就可解出;或從公鑰找出i ,才有可能算出 私鑰,但找出i就和破解η有同樣的難題;再者, 由於本發明祇計算一次,更可擴充鍮匙長度,提高 安全等級。 雖然本案是以一個最佳實施例做說明,但精於 此技藝者能在不脫離本案精神與範_下做各種不同 形式的改變。以上所舉實施例僅用以說明本案而 已,非用以限制本案之範圍。舉凡不違本案精神所 8 200950457 從事的種種修改或變化,俱屬本案申請專利範圍。 【圖式簡單說明】 第一圖係本發明之公鑰與私鑰的流程圖。 第二圖係本發明之加密與解密的流程圖。 【主要元件符號說明】1. M xe mod n = C ❺ 2. Cxd mod n = M Example of encryption and decryption: In order to enable the reviewing committee to have a clearer understanding of the contents of the present invention, the following are for prime judgment, public and private keys, and encryption and decryption. For a detailed description: Let P = 45433,? = 52691, expressed as a one-dimensional 16-bit matrix P = [10110001011110011 ? = [1100110111010011]: Prime number judgment: A value excludes the lowest bit, taking the power of both ends and the maximum length is 2 or %; The remainder of the value, when the output is 1, indicates that the value is a prime number. • Take “= corp.=[1011000101111001] as an example, followed by [1011000101 111] ··. i 0. . i. 1 i ! i] =1, so 45433 is a prime number. • Take " = 1729 = [110011000001] as an example, the second value is [noon]: 7 200950457 2[1 1 ° ° 1 1]*1 , so 1729 is not a prime number. In the above example, 1729 is a CarmichaelNi dish, which is misclassified as a prime number by conventional techniques; such errors can be avoided in the present invention. Public key privacy: ” = 彳= [1000111010110 000 0010101110111011] [01000111010110000001010111011110] i = [11000001010000100011110011000111] e = 2'=[01010001110000100011010010010110] ® ^ = =[10001101110111101010000001100110] Encryption decryption: M = [l01101110110101l]<« C = Mx e mod « = [01011101010011110110100000101010] M = Cxd mod n = [l 011011101101011] From the example e = politics, the i of the expression is generated by random numbers. Compared with the conventional technology, the production is extremely simple and flexible. "In terms of security considerations, except that η is cracked, but the current technology can be solved in a short time; or from the public key to find i, it is possible to calculate the private key, but find out i and crack η The same problem; furthermore, since the present invention is only calculated once, the length of the key can be expanded to improve the security level. Although the present case is illustrated by a preferred embodiment, the skilled person can do without departing from the spirit of the case. Various changes are made in the following examples. The above embodiments are only used to illustrate the case and are not intended to limit the scope of the case. It is not in violation of the spirit of the case that all the modifications or changes made in 200950457 belong to the scope of patent application in this case. [Simplified description of the drawings] The first figure is a flow chart of the public key and private key of the present invention. Flowchart for encryption and decryption. [Main component symbol description]