用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc

上传人:文库蛋蛋多 文档编号:3988605 上传时间:2023-03-30 格式:DOC 页数:15 大小:136.50KB
返回 下载 相关 举报
用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc_第1页
第1页 / 共15页
用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc_第2页
第2页 / 共15页
用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc_第3页
第3页 / 共15页
用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc_第4页
第4页 / 共15页
用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc_第5页
第5页 / 共15页
点击查看更多>>
资源描述

《用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc》由会员分享,可在线阅读,更多相关《用新的高级加密标准(AES)保持你的数据安全毕业论文外文翻译.doc(15页珍藏版)》请在三一办公上搜索。

1、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 infor

2、mation, 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

3、 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.

4、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. Encrypt

5、ed 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-bi

6、t 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

7、 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 propos

8、al 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 incl

9、uding 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

10、 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 in

11、dexes 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

12、, 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

13、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 g

14、enerated 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

15、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

16、-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 va

17、lue 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 spec

18、ification. 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 determine

19、d 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 sho

20、wn 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 position

21、s 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 de

22、tails 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) +(Sta

23、te3,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

24、 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 t

25、imes. 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

26、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

27、 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 m

28、athematical 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 characte

29、ristics 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 youl

30、l 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 ca

31、ses.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 va

32、lue 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

33、 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 arb

34、itrary 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 + 0x

35、04 + 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 * 0

36、x02 * 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) reduce

37、s 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 k

38、ey 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 tricki

39、er 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 creat

40、e 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

41、 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

42、 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

43、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 ea

44、ch 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 observ

45、e 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 mor

46、e 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 o

47、f 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, depend

48、ing 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 colum

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号