【正文】
encryption。 參 考 文 獻(xiàn) [1] 盧開澄,清華大學(xué)出版社,《計(jì)算機(jī)密碼學(xué)》, 1998 [2] 馮登國(guó),裴定一,科學(xué)出版社,《密碼學(xué)導(dǎo)引》, 1999 [3] Burt Kaliski, Rfc 2313, PKCS1 The implement of RSA publickey algorithm and RSA signature algorithm GU tingting LI Tao (Department of Computer,Sichuan University Chengdu 610065) Abstract The implement tenique of RSA publickey algorithm and RSA signature algorithm has been presented. RSA cryptosystem is a publickey cryptosystem .The key ponents of the implement are keys generation ,encryption and decryption. Therefore, the big number structure and its operations, then generation of the big prime, as well as the details of the implemention of encryption and decryption have thus been presented. Key words RSA algorithm。 RSA 算法是一種安全技術(shù),但是 RSA算法的安全性只是一種計(jì)算安全 性,絕不是無條件的安全性,這是由它的理論基礎(chǔ)決定的。 RSA加密解密計(jì)算的時(shí)間主要是模冪運(yùn)算的時(shí)間,即形式為 xc mod n 的函數(shù)的運(yùn)算時(shí)間。 五、 RSA 算法的時(shí)間復(fù)雜性 RSA算法的時(shí)間復(fù)雜性取決于它所設(shè)計(jì)的幾個(gè)基本運(yùn)算的時(shí)間復(fù)雜性。簽名不正確。 簽名實(shí)際是加密的字符串。加密算法中使用的加密塊為 01 類型。 (1) 消息摘要計(jì)算 。首先用 MD5 算法對(duì)信息作散列計(jì)算。 從 PKCS 格式分離明文的過程也是檢查 數(shù) 據(jù)完整性的過程。 (2) RSA計(jì)算 。 unsigned char coefficient[MAX_RSA_PRIME_LEN]。 /*公鑰 n */ unsigned char publicExponent[MAX_RSA_ LEN]。 (4) 密文由 整型數(shù)據(jù) 轉(zhuǎn)換成 字符型數(shù)據(jù)。當(dāng) BT=02 時(shí), PS為非 0 隨機(jī)數(shù);當(dāng) BT=01, PS值為 FF。 (1) 格式化明文 。選取 a=2,則 a 一定不會(huì)是任何素?cái)?shù)的倍數(shù)。 素?cái)?shù)的產(chǎn)生 對(duì)隨機(jī)數(shù)作素性檢測(cè),若通過則為素?cái)?shù);否則增加一個(gè)步長(zhǎng)后再做素性檢測(cè),直到找出素?cái)?shù)。它必須具有足夠的隨機(jī)性,以防止破譯者掌握隨機(jī)數(shù)的規(guī)律性后重現(xiàn)密鑰的配制過程或者探測(cè)到加密塊中的明文 。 (6) 計(jì)算 d mod (p1), d mod (q1)。 (2) 隨機(jī)生成大素?cái)?shù) p,直到 gcd (e,p1)=1。 /* 公鑰 n 的位數(shù) */ unsigned char modulus[MAX_RSA_ LEN] 。但是為加快 RSA 解密計(jì)算的效率,采用中國(guó)剩余定理算法,因此 RSA私鑰包含 p,q,d mod (p1