大部分的電腦密碼學技術如:RSA、DSA、Diffie-Hellman等在運作過程之均使用到大量的模指數運算;模指數運算包含大量的模餘運算,而這也是整個電腦密碼技術運作過程中最耗時間與系統資源的部分,若能改善模餘運算效能對現今的電腦密碼技術的執行效能將可造成巨大的影響。為了能有效率的進行模餘運算,目前主流的兩個方法是:蒙哥馬利模餘和巴雷特模餘演算法。雖然直觀上以硬體來實作這些運算可能會有較好的效率,但硬體的建置存在缺乏彈性的弱點且一般的行動裝置考量到降低硬體建置成本,幾乎都不會考量納入此特殊硬體,因此一般的行動裝置在運作網路安全協定執行電腦密碼技術時僅以軟體形式運作。本篇論文探討重要的模餘演算法 (Modular Reduction Algorithm) 之原理與實作於Android 平台之方法,並分析比較其計算時間,又計算耗電量情形與計算時間成正比關係,故藉由時間分析結果也可以了解不同模餘方法間造成的耗電差異。
Most of the cryptographies like RSA, DSA and Diffe-Hellman should perform the Modular Exponentiation Operation which includes many Modular Operations. However, this is the most time and resources consuming part of the entire cryptography operating process. If we can improve Modular Operation efficacy then we might make a revolutionary impact on the implementation efficacy of cryptography nowadays. Currently, two principle methods are used to implement modular operation efficiently: Montgomery Reduction and Barrett modular reduction Algorithm. Though it is more efficient to implement these calculations by using hardware, the disadvantage of the lacking of flexibility and the higher cost when establishing hardware are the reasons that why general mobile devices refuse to use these special hardware. As a result, general mobile devices only operate in software forms when operating network security protocols. This paper explores the theorem and the methods of implementing important Modular Reduction Algorithm on Android platform. We analyze and compare the calculation time and find that it is directly proportional to the power consumption. With these results of time analysis, we are able to understand the variations of power consumption by using different modular operations.