隨著電腦科技的進步,帶給人類極大的便利性,但伴隨而來的卻 是安全性的問題。最簡單便利的安全措施是利用使用者帳號及密碼加 以控管,但密碼太短容易被破解,密碼太長又不容易記,若在網路上 進行傳輸,利用簡單的網路封包截取工具就可取得相關之使用者帳號 及密碼,因此使用如Smart Card這種可提供身份認證及內含密碼學演 算法的低成本硬體裝置,已成現今社會的一個趨勢。 因此本篇論文乃利用低成本且取得容易的8051單晶片來完成512 位元的RSA密碼系統。而RSA密碼系統演算法中,最主要的運算為 模指數運算,但在8051內部指令中並無模指數運算的相關指令,因此 本篇設計先將模指數運算利用L-algorithm轉換成模乘法運算,再利用 Montgomery演算法轉換成加法及移位計算,以利用現有的指令完成 RSA密碼系統。 RSA密碼系統的安全性乃是基於因數分解的困難度,然而近年 來,實體密碼攻擊法(physical cryptanalysis)已在密碼學領域中成為一個 新的學門,它可因為密碼演算法設計的不周詳而加以攻擊,因此本篇 論文在完成512位元的RSA密碼系統後,將以SPA(Simple power analysis)及DPA(Differential power analysis)加以攻擊。並針對SPA攻擊 ,讓di無論是否為1都執行Montgomery運算,以進行防禦。對於DPA 攻擊,將以每次執行時都變更金鑰的方式來加以防禦,以使本篇所完 成之512位元的RSA密碼系統更為安全可靠。 As information technology has developed rapidly, it provides more convenient life for people. As the result, the security has become the main concern. Recently, user id and password are major methods to protect private information. However, the short password can be broken by hackers. Too long is not easy to memorize. Network traffic-analyzing tool provides the function to gain the user id and password while doing transaction via network. Therefore, low cost Smart Card including user name identification and cryptosystem algorithm has become new trend of modern society. The first object of this thesis is to present the design and implementati- on of a 512-bit RSA cryptosystem by using 8051 microcontroller. In RSA cryptosystem algorithm, modular exponentiation is the essential arithmetic operation. However, 8051 microcontroller does not provide the modular exponentiation. In order to complete RSA cryptosystem, this thesis has mentioned that using L-algorithm to transfer to modular multiplication. Then using Montgomery to transfer addition and shift calculation. The security of RSA cryptosystem relies on the comparative difficulty of factoring prime. Recently, physical cryptanalysis has become the new direction of cryptanalysis because it can attack the cryptosystem algorithm with careless design. Therefore, the second object of thesis focuses on SPA (Simple power analysis) and DPA (Differential power analysis). The main strategy to against SPA is to execute Montgomery Algorithm, no matter di is 1 or not. In addition, changing the private key is the method to against DPA. As the result, 512-bit RSA cryptosystem can become more safety and reliable.