




免费预览已结束,剩余10页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
附录 外文原文及翻译 keep your data secure with the new advanced encryption standardjames mccaffreysummarythe advanced encryption standard (aes) is a national institute of standards and technology specification for the encryption of electronic data. it is expected to become the accepted means of encrypting digital information, including financial, telecommunications, and government data. this article presents an overview of aes and explains the algorithms it uses.after reading this article you will be able to encrypt data using aes, test aes-based software, and use aes encryption in your systems.note that the code presented in this article and any other implementation based on this article is subject to applicable federal cryptographic module export controls (see commercial encryption export controls for the exact regulations).aes is a new cryptographic algorithm that can be used to protect electronic data. specifically, aes is an iterative, symmetric-key block cipher that can use keys of 128, 192, and 256 bits, and encrypts and decrypts data in blocks of 128 bits (16 bytes). unlike public-key ciphers, which use a pair of keys, symmetric-key ciphers use the same key to encrypt and decrypt data. encrypted data returned by block ciphers have the same number of bits that the input data had. iterative ciphers use a loop structure that repeatedly performs permutations and substitutions of the input data. figure 1 shows aes in action encrypting and then decrypting a 16-byte block of data using a 192-bit key.figure 1 some dataaes is the successor to the older data encryption standard (des). des was approved as a federal standard in 1977 and remained viable until 1998 when a combination of advances in hardware, software, and cryptanalysis theory allowed a des-encrypted message to be decrypted in 56 hours. since that time numerous other successful attacks on des-encrypted data have been made and des is now considered past its useful lifetime.西安工业大学毕业设计(论文) in late 1999, the rijndael (pronounced rain doll) algorithm, created by researchers joan daemen and vincent rijmen, was selected by the nist as the proposal that best met the design criteria of security, implementation efficiency, versatility, and simplicity. although the terms aes and rijndael are sometimes used interchangeably, they are distinct. aes is widely expected to become the de facto standard for encrypting all forms of electronic data including data used in commercial applications such as banking and financial transactions, telecommunications, and private and federal information.overview of the aes algorithmthe aes algorithm is based on permutations and substitutions. permutations are rearrangements of data, and substitutions replace one unit of data with another. aes performs permutations and substitutions using several different techniques. to illustrate these techniques, lets walk through a concrete example of aes encryption using the data shown in figure 1.the following is the 128-bit value that you will encrypt with the indexes array:00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15the 192-bit key value is:00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 170 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23figure 2 sboxwhen the aes constructor is called, two tables that will be used by the encryption method are initialized. the first table is a substitution box named sbox. it is a 16 16 matrix. the first five rows and columns of sbox are shown in figure 2. behind the scenes, the encryption routine takes the key array and uses it to generate a key schedule table named w, shown in figure 3.figure 3 key sched.the first nk (6) rows of w are seeded with the original key value (0x00 through 0x17) and the remaining rows are generated from the seed key. the variable nk represents the size of the seed key in 32-bit words. youll see exactly how w is generated later when i examine the aes implementation. the point is that there are now many keys to use instead of just one. these new keys are called the round keys to distinguish them from the original seed key.figure 4 statethe aes encryption routine begins by copying the 16-byte input array into a 44 byte matrix named state (see figure 4). the aes encryption algorithm is named cipher and operates on state and can be described in pseudocode (see figure 5).the encryption algorithm performs a preliminary processing step thats called addroundkey in the specification. addroundkey performs a byte-by-byte xor operation on the state matrix using the first four rows of the key schedule, and xors input stater,c with round keys table wc,r.for example, if the first row of the state matrix holds the bytes 00, 44, 88, cc , and the first column of the key schedule is 00, 04, 08, 0c , then the new value of state0,2 is the result of xoring state0,2 (0x88) with w2,0 (0x08), or 0x80:1 0 0 0 1 0 0 00 0 0 0 1 0 0 0 xor1 0 0 0 0 0 0 0the main loop of the aes encryption algorithm performs four different operations on the state matrix, called subbytes, shiftrows, mixcolumns, and addroundkey in the specification. the addroundkey operation is the same as the preliminary addroundkey except that each time addroundkey is called, the next four rows of the key schedule are used. the subbytes routine is a substitution operation that takes each byte in the state matrix and substitutes a new byte determined by the sbox table. for example, if the value of state0,1 is 0x40 and you want to find its substitute, you take the value at state0,1 (0x40) and let x equal the left digit (4) and y equal the right digit (0). then you use x and y as indexes into the sbox table to find the substitution value, as shown in figure 2.shiftrows is a permutation operation that rotates bytes in the state matrix to the left. figure 6 shows how shiftrows works on state. row 0 of state is rotated 0 positions to the left, row 1 is rotated 1 position left, row 2 is rotated 2 positions left, and row 3 is rotated 3 positions left.figure 6 running shiftrows on statethe mixcolumns operation is a substitution operation that is the trickiest part of the aes algorithm to understand. it replaces each byte with the result of mathematical field additions and multiplications of values in the bytes column. i will explain the details of special field addition and multiplication in the next section.suppose the value at state0,1 is 0x09, and the other values in column 1 are 0x60, 0xe1, and 0x04; then the new value for state0,1 is shown in the following:state0,1 = (state0,1 * 0x01) + (state1,1 * 0x02) +(state2,1 * 0x03) +(state3,1 * 0x01) = (0x09 * 0x01) + (0x60 * 0x02) + (0xe1 * 0x03) +(0x04 * 0x01) = 0x57the addition and multiplication are special mathematical field operations, not the usual addition and multiplication on integers.the four operations subbytes, shiftrows, mixcolumns, and addroundkey are called inside a loop that executes nr timesthe number of rounds for a given key size, less 1. the number of rounds that the encryption algorithm uses is either 10, 12, or 14 and depends on whether the seed key size is 128, 192, or 256 bits. in this example, because nr equals 12, the four operations are called 11 times. after this iteration completes, the encryption algorithm finishes by calling subbytes, shiftrows, and addroundkey before copying the state matrix to the output parameter.in summary, there are four operations that are at the heart of the aes encryption algorithm. addroundkey substitutes groups of 4 bytes using round keys generated from the seed key value. subbytes substitutes individual bytes using a substitution table. shiftrows permutes groups of 4 bytes by rotating 4-byte rows. mixcolumns substitutes bytes using a combination of both field addition and multiplication.field addition and multiplication in gf(28)as youve seen, the aes encryption algorithm uses fairly straightforward techniques for substitution and permutation, except for the mixcolumns routine. the mixcolumns routine uses special addition and multiplication. the addition and multiplication used by aes are based on mathematical field theory. in particular, aes is based on a field called gf(28).the gf(28) field consists of a set of 256 values from 0x00 to 0xff, plus addition and multiplication, hence the (28). gf stands for galois field, named after the mathematician who founded field theory. one of the characteristics of gf(28) is that the result of an addition or multiplication operation must be in the set 0x00 . 0xff. although the theory of fields is rather deep, the net result for gf(28) addition is simple: gf(28) addition is just the xor operation.multiplication in gf(28) is trickier, however. as youll see later in the c# implementation, the aes encryption and decryption routines need to know how to multiply by only the seven constants 0x01, 0x02, 0x03, 0x09, 0x0b, 0x0d, and 0x0e. so instead of explaining gf(28) multiplication theory in general, i will explain it just for these seven specific cases.multiplication by 0x01 in gf(28) is special; it corresponds to multiplication by 1 in normal arithmetic and works the same wayany value times 0x01 equals itself.now lets look at multiplication by 0x02. as in the case of addition, the theory is deep, but the net result is fairly simple. if the value being multiplied is less than 0x80, then the result of multiplication is just the value left-shifted 1 bit position. if the value being multiplied is greater than or equal to 0x80, then the result of multiplication is the value left-shifted 1 bit position xored with the value 0x1b. this prevents field overflow and keeps the product of the multiplication in range.once youve established addition and multiplication by 0x02 in gf(28), you can use them to define multiplication by any constant. to multiply by 0x03 in gf(28), you can decompose 0x03 as powers of 2 and additions. to multiply an arbitrary byte b by 0x03, observe that 0x03 = 0x02 + 0x01. thus:b * 0x03 = b * (0x02 + 0x01) = (b * 0x02) + (b * 0x01)this can be done because you know how to multiply by 0x02 and 0x01 and how to perform addition. similarly, to multiply an arbitrary byte b by 0x0d, you do this:b * 0x0d = b * (0x08 + 0x04 + 0x01) = (b * 0x08) + (b * 0x04) + (b * 0x01) = (b * 0x02 * 0x02 * 0x02) + (b * 0x02 * 0x02) + (b * 0x01)the other multiplications needed for the aes mixcolumns routine in the encryption and decryption algorithm follow the same general pattern, as shown here:b * 0x09 = b * (0x08 + 0x01) = (b * 0x02 * 0x02 * 0x02) + (b * 0x01)b * 0x0b = b * (0x08 + 0x02 + 0x01) = (b * 0x02 * 0x02 * 0x02) + (b * 0x02) + (b * 0x01)b * 0x0e = b * (0x08 + 0x04 + 0x02) = (b * 0x02 * 0x02 * 0x02) + (b * 0x02 * 0x02) + (b * 0x02)to summarize, addition in gf(28) is the xor operation. multiplication in gf(28) reduces to additions and multiplications by 0x02, where multiplication by 0x02 is a conditional 1-bit left shift. the aes specification contains a lot of additional information about operations in gf(28).key expansionthe aes encryption and decryption algorithms use a key schedule generated from the seed key array of bytes. the aes specification refers to this as the keyexpansion routine. generating, in essence, multiple keys from an initial key instead of using a single key greatly increases the diffusion of bits. although not overwhelmingly difficult, understanding keyexpansion is one of the trickier parts of the aes algorithm. in high-level pseudocode, the keyexpansion routine looks like the following:keyexpansion(byte key, byte4 w) copy the seed key into the first rows of w for each remaining row of w use two of the previous rows to create a new row the use two of the previous rows to create a new row routine makes use of two subroutines, rotword and subword, and a table of constants named rcon (for round constants). lets look at each of these three items and then come back to the keyexpansion routine as a whole.the rotword routine is simple. it accepts an array of 4 bytes and rotates them 1 position left. because the round schedule table w has four columns, rotword rotates a row of w to the left. notice that the rotword function used by keyexpansion is very similar to the shiftrows routine used by the encryption algorithm except that it works on a single row of the key schedule w instead of the entire encryption state table state.the subword routine performs a byte-by-byte substitution on a given row of the key schedule table w using the substitution table sbox. the substitutions in keyexpansion operate exactly like those in the encryption algorithm. the input byte to be substituted is separated into an (x,y) pair which are used as indexes into the substitution table sbox. for example, substitution for 0x27 results in x = 2 and y = 7, and sbox2,7 returns 0xcc.the keyexpansion routine uses an array rcon, called the round constant table. these constants are 4 bytes each to match with a row of the key schedule table. the aes keyexpansion routine requires 11 round constants. you can see these constants listed in figure 7.figure 7 initializing rconthe leftmost byte of each round constant is a power of 2 in the gf(28) field. another way of looking at it is to observe that each value is the previous value times 0x02, as described in the previous section discussing multiplication in gf(28). notice that 0x80 0x02 = 0x1b is 0x80 left-shifted 1 bit followed by an xor with 0x1b, as described earlier.now lets take a closer look at the loop inside keyexpansion. in more detailed pseudocode than before, the loop is:for (row = nk; row (4 * nr+1); +row) temp = wrow-1 if (row % nk = 0) temp = subword(rotword(temp) xor rconrow/nk else if (nk = 8 and row % nk = 4) temp = subword(temp) wrow = wrow-nk xor tempignoring the if clause for a moment, youll see that each row of the key schedule table w is the result of xoring the previous row with the row nk (4, 6, or 8 depending on the key size) rows before. the first part of the if conditional modifies every fourth, sixth, or eighth row of the key schedule with subword, rotword, and xoring with a round constant, depending on whether the key size is 128, 192, or 256 bits. the second part of the conditional will modify rows 12, 20, 28 and so onevery eighth rowfor a 256-bit key to add additional variability to the key schedule.lets see how keyexpansion gets started with the example presented at the beginning of this article. the seed key is the 192-bit / 6-word value:00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17the key schedule byte table w has the dimensions 4 columns and nb (nr + 1) equals 4 (12 + 1), or 52 rows. the keyexpansion routine copies the values in the seed key into the first rows of the key schedule byte table w. because my seed key is 192 bits (24 bytes), and the w table always has 4 columns, in this case keyexapansion copies the seed key into the first 6 rows of w. now lets see how the keyexpansion routine fills the rest of the key schedule table. in my example, the first calculated row is row 6 because rows 0 to 5 were filled with the seed key values:temp = wrow-1 = 14 15 16 17the condition (row % nk = 0) is true, so first the rotword subroutine is applied:temp = 15 16 17 14then subword is applied:temp = 59 47 f0 fathen xored with rconrow / nk = rcon6 / 6 = 01 00 00 00:temp = 58 47 f0 fathis is then xored with wrow-nk = w6-6 = 00 01 02 03, yielding the following result:w6 = 58 46 f2 f9the process repeats itself for all of the remaining rows in key schedule table w.to summarize, an important part of aes encryption and decryption is the generation of multiple round keys from the initial seed key. this keyexpansion algorithm generates a key schedule and uses substitution and permutation in a way that is similar in most respects to the encryption and decryption algorithms.conclusionthe new aes will certainly become the de facto standard for encrypting all forms of electronic information, replacing des. aes-encrypted data is unbreakable in the sense that no known cryptanalysis attack can decrypt the aes cipher text without using a brute-force search through all possible 256-bit keys.aes is an important advance and using and understanding it will greatly increase the reliability and safety of your software systems. 用新的高级加密标准(aes)保持你的数据安全james mccaffrey 摘要 aes(the advanced encryption standard)是美国国家标准与技术研究所用于加密电子数据的规范。它被预期能成为人们公认的加密包括金融、电信和政府数字信息的方法。本文展示了aes的概貌并解析了它使用的算法。在读完本文后你将能用aes加密、测试 基于aes的软件并能在你的系统中使用aes加密。aes 是一个新的可以用于保护电子数据的加密算法。明确地说,aes 是一个迭代的、对称密钥分组的密码,它可以使用128、192 和 256 位密钥,并且用 128 位(16字节)分组加密和解密数据。与公共密钥密码使用密钥对不同,对称密钥密码使用相同的密钥加密和解密数据。通过分组密码返回的加密数据 的位数与输入数据相同。迭代加密使用一个循环结构,在该循环中重复置换(permutations )和替换(substitutions)输入数据。figure 1 显示了 aes 用192位密钥对一个16位字节数据块进行加密和解密的情形。aes算法概述 aes 算法是基于置换和代替的。置换是数据的重新排列,而代替是用一个单元数据替换另一个。aes 使用了几种不同的技术来实现置换和替换。为了阐明这些技术,让我们用 figure 1 所示的数据讨论一个具体的 aes 加密例子。下面是你要加密的128位值以及它们对应的索引数组:00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15192位密钥的值是:00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 170 1 2 3 4 5 6 7 8 9 10 1112 13 14 15 16 17 18 19 20 21 22 23figure 2 s-盒( sbox )当 aes 的构造函数(constructor)被调用时,用于加密方法的两个表被初始化。第一个表是代替盒称为s-盒。它是一个1616的矩阵。s-盒的前五行和前五列如 figure 2 所示。在幕后,加密例程获取该密钥数组并用它来生成一个名为w的密钥调度表,figure 3 所示。figure 3 密钥调度表(key s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 酒楼行政总厨聘用协议5篇
- 商场复工复产安全培训课件
- 国家事业单位招聘2025中国人民大学书院建设与管理中心招聘1人笔试历年参考题库附带答案详解
- 南部县2025上半年四川南充市南部县事业单位考调10人笔试历年参考题库附带答案详解
- 北海市2025广西互联网舆情中心招(实名编制)8人(截止5月27日)笔试历年参考题库附带答案详解
- 包河区2025年合肥包河区事业单位招聘劳务派遣人员29名笔试历年参考题库附带答案详解
- 云南省2025云南省教育后勤协会招聘1人笔试历年参考题库附带答案详解
- 上海市2025上海申康医疗卫生建设工程公共服务中心工作人员招聘1人笔试历年参考题库附带答案详解
- 2025重庆紫光国际化工有限责任公司招聘16人笔试参考题库附带答案详解
- 2025贵州茅台酒股份有限公司招聘158人笔试参考题库附带答案详解
- 农产品跨境电商运营实战指南
- DB53∕T 1269-2024 改性磷石膏用于矿山废弃地生态修复回填技术规范
- 2024-2025学年北京市西城区三年级数学第一学期期末学业水平测试试题含解析
- 2024年版教育培训机构加盟合同范本
- DL∕T 976-2017 带电作业工具、装置和设备预防性试验规程
- 新突破大学英语综合教程1全套教学课件
- 历年中华人民共和国宪法知识竞赛试题真题【含答案】
- 光伏电站的运维项目方案
- CJJ-T134-2019建筑垃圾处理技术标准
- 广东省智慧高速公路建设指南(2023年版)
- 水泥混凝土路面施工方案 (详细)
评论
0/150
提交评论