DES补充材料

作为参考,本文提供了数据加密标准DES)块密码中提到的各种查找表的细节。

本文档中的数据都是以大端序排列的,也即首位为MSB。

初始置换(IP, Initial permutation)

IP置换过程
IP
585042342618102
605244362820124
625446383022146
645648403224168
57494133251791
595143352719113
615345372921135
635547393123157

该表显示了对64位块的初始置换,其意义如下:输出的首位为输入的第58位,第二位为50位,依此类推,输出的最后位为输入的第7位。

以上信息为了方便表示被写成表格形式,但它实际上是一个矢量,而非矩阵

最终置换 (IP-1)

IP-1的过程
IP−1
408481656246432
397471555236331
386461454226230
375451353216129
364441252206028
353431151195927
342421050185826
33141949175725

IP-1(亦被称为FP)是IP的逆过程,上表的含义与IP的相似。

扩张函数 (E函数)

E函数
E
3212345
456789
8910111213
121314151617
161718192021
202122232425
242526272829
28293031321

扩张函数被作为最初和最终的置换。注意输入中的某些位在输出中被用到了不止一次,例如输入的第5位出现在输出的第6和8位。因此,32位的半块输入被扩张到了48位。

P置换

P permutation
P
1672021
29122817
1152326
5183110
282414
322739
1913306
2211425

P置换将32位的半块数据重新排列。

选择置换1(PC-1)

PC-1
PC-1
5749413325179
1585042342618
1025951433527
1911360524436
63554739312315
7625446383022
1466153453729
211352820124

上表的“左”和“右”两部分表现了输入密钥组成密钥调度状态中左右两部分的过程。主要输入的64位数据中只用到了56位,剩余的8位可以用于奇偶校验

选择置换2(PC-2)

PC-2
PC-2
1417112415
3281562110
2319124268
1672720132
415231374755
304051453348
444939563453
464250362932

该置换从56位的密钥调度状态中取出48位的子密钥。

置换盒 (S盒)

S盒
S1
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1441312151183106125907
0yyyy1 0157414213110612119538
1yyyy0 4114813621115129731050
1yyyy1 1512824917511314100613
S2
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1518146113497213120510
0yyyy1 3134715281412011069115
1yyyy0 0147111041315812693215
1yyyy1 1381013154211671205149
S3
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1009146315511312711428
0yyyy1 1370934610285141211151
1yyyy0 1364981530111212510147
1yyyy1 1101306987415143115212
S4
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 7131430691012851112415
0yyyy1 1381156150347212110149
1yyyy0 1069012117131513145284
1yyyy1 3150610113894511127214
S5
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 2124171011685315130149
0yyyy1 1411212471315015103986
1yyyy0 4211110137815912563014
1yyyy1 1181271142136150910453
S6
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1211015926801334147511
0yyyy1 1015427129561131401138
1yyyy0 9141552812370410113116
1yyyy1 4321295151011141760813
S7
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 4112141508133129751061
0yyyy1 1301174911014351221586
1yyyy0 1411131237141015680592
1yyyy1 6111381410795015142312
S8
x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1328461511110931450127
0yyyy1 1151381037412561101492
1yyyy0 7114191214206101315358
1yyyy1 2114741081315129035611

上表列出了DES中使用的8个S盒。每个S盒将6位输入变为4位输出。给定输入后,输出行由外侧两位确定,列由内侧的4位确定,例如“011011”的输入的外侧位为“01”,内侧位为“1101”,而每张表的第一行为“00”,第一列为“0000”因此在S5中的对应输出为“1001”(十进制的9),即第2行,第14列(参见S盒)。

密钥调度过程中的移位

移位
回次 左移位数
11
21
32
42
52
62
72
82
91
102
112
122
132
142
152
161

在子密钥生成完成前,密钥调度状态的每个半块都要向左循环移动特定的位,上表显示了移位的数量。

参考文献

    • (PDF). NIST. 1999-10-25 [2010-09-22]. FIPS PUB 46-3. (原始内容存档 (PDF)于2012-04-07).
    This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.