s盒c语言算法,AES加密算法中的S盒及其C语言实现
摘要
詳細(xì)敘述了算法中S盒的構(gòu)造,并給出了其C語(yǔ)言實(shí)現(xiàn)的程序代碼.S盒由有限域G F(28)上所有元素的乘法逆元及在域G F(2)上的仿射變換構(gòu)成,經(jīng)過(guò)S盒的非線(xiàn)性字節(jié)代換,密文的差分均勻性和線(xiàn)性偏差都達(dá)到較理想的狀態(tài),提高了A E S算法抗擊差分密碼分析及線(xiàn)性密碼分析的能力.在A E S算法中,N r輪的加密過(guò)程都要對(duì)狀態(tài)矩陣中的字節(jié)求其在有限域G F(28)上的乘法逆元和作G F(2)上的仿射變換,這些都要多次用到大運(yùn)算量的非線(xiàn)性字節(jié)變換操作,為此可以通過(guò)一定的算法先算出G F(28)上所有元素的乘法逆元并作相應(yīng)的仿射變換以形成對(duì)字節(jié)代換的代換表,即S盒,然后通過(guò)查表的方法進(jìn)行加密過(guò)程中的字節(jié)代換,從而縮短明文的加密時(shí)間,提高A E S加密算法的整體效率.
The paper described detailedly the construction of S box in AES and gave its source program code of C language. The S box was constituted with the multiplication inverse element affined transformation in GF(2) of all elements of limited field GF(28),with S box 's nonlinear byte changed,ciphered text attained the ideal status of the even of difference and the linear of deviation,and increased the capability of the AES algorithm of anti beating the difference cipher of analysis and linear cipher of analysis. In AES algorithm,the round of Nr of encipher procedure must compute the multiplication inverse element in limited field GF(28) and affined transformation in GF(2) to the byte of the status matrix,and these all needed to use many times the big quantity transform operation of nonlinear byte,for this,through the certain algorithm to calculate multiplication inverse element of all elements of the GF(28) and affined transformation forming the generation changes table to byte generation changes,it's S box,then through the method of the looking table to finish the byte generation changes of encrypt proceed,thereby shortened the encipher time of the plain text and increased the whole efficiency of AES encrypt algorithm.
總結(jié)
以上是生活随笔為你收集整理的s盒c语言算法,AES加密算法中的S盒及其C语言实现的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: whu1572 Cyy and Fzz[
- 下一篇: 滤波器频率响应的归一化