-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDES.drawio
178 lines (178 loc) · 14.4 KB
/
DES.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<mxfile host="app.diagrams.net" modified="2022-03-24T02:27:20.479Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36" etag="qfoVDK26xBUdq1-U-Y4r" version="17.1.0" type="github">
<diagram id="d-9lN3E3b-7A1qJQFk1q" name="Page-1">
<mxGraphModel dx="926" dy="537" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="XsJQiSFJp8W32oPpOZ8I-12" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-1" target="XsJQiSFJp8W32oPpOZ8I-2" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-1" value="64bit plainText" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="160" y="100" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-2" target="XsJQiSFJp8W32oPpOZ8I-3" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-2" value="IP置换64bit-&gt;64bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="160" y="200" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-14" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-3" target="XsJQiSFJp8W32oPpOZ8I-4" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-3" value="16轮的轮置换" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="160" y="300" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-15" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-4" target="XsJQiSFJp8W32oPpOZ8I-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-4" value="IPI置换64bit-&gt;64bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="160" y="400" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-5" value="64bit cipherText" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="160" y="500" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-6" value="F函数" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="360" y="230" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-7" value="XOR<br>新得到的L0'与R0做异或得到新的R1,<br>R0成为新的L1" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="360" y="360" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-8" value="选取L0做E扩展置换,32bit-&gt;48bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="560" y="100" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-9" value="XOR与子密钥异或<br>48bit-&gt;48bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="560" y="200" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-10" value="S盒非线性置换<br>每六个 0,5决定行 1-4决定列<br>48bit-&gt;32bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="560" y="300" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-11" value="P盒置换<br>32bit-&gt;32bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="560" y="400" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-18" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-3" target="XsJQiSFJp8W32oPpOZ8I-6" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="340" as="sourcePoint" />
<mxPoint x="450" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-19" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-3" target="XsJQiSFJp8W32oPpOZ8I-7" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="340" as="sourcePoint" />
<mxPoint x="450" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-20" value="" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-6" target="XsJQiSFJp8W32oPpOZ8I-8" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="340" as="sourcePoint" />
<mxPoint x="450" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-21" value="" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-6" target="XsJQiSFJp8W32oPpOZ8I-9" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="340" as="sourcePoint" />
<mxPoint x="450" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-22" value="" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-6" target="XsJQiSFJp8W32oPpOZ8I-10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="340" as="sourcePoint" />
<mxPoint x="450" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-23" value="" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-6" target="XsJQiSFJp8W32oPpOZ8I-11" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="340" as="sourcePoint" />
<mxPoint x="450" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-24" value="加密过程" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="190" y="60" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-35" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-25" target="XsJQiSFJp8W32oPpOZ8I-26" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-25" value="64bit密钥" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1010" y="100" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-26" value="PC-1置换<br>即将每8bit的最后1bit去掉<br>64bit-&gt;56bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1010" y="200" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-27" value="(L0)分组循环左移nbit<br>28bit-&gt;28bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="890" y="300" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-28" value="(R0)分组循环左移nbit<br>28bit-&gt;28bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1130" y="300" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-29" value="PC-2置换<br>56bit-&gt;48bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1350" y="300" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-30" value="L1接着循环左移mbit<br>28bit-&gt;28bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="890" y="400" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-31" value="R1接着循环循环左移mbit<br>28bit-&gt;28bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1130" y="400" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-32" value="PC-2置换<br>56bit-&gt;48bit" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1350" y="400" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-33" value="形成第二轮密钥" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1550" y="300" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-34" value="形成第三轮密钥" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1550" y="400" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-36" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-27" target="XsJQiSFJp8W32oPpOZ8I-26" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1030" y="330" as="sourcePoint" />
<mxPoint x="1080" y="280" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-37" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-28" target="XsJQiSFJp8W32oPpOZ8I-26" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1240" y="370" as="sourcePoint" />
<mxPoint x="1290" y="320" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-38" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-27" target="XsJQiSFJp8W32oPpOZ8I-28" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1240" y="370" as="sourcePoint" />
<mxPoint x="1290" y="320" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-39" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1070" y="330" as="sourcePoint" />
<mxPoint x="1070" y="370" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-40" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1070" y="370" as="sourcePoint" />
<mxPoint x="1300" y="370" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-41" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1300" y="370" as="sourcePoint" />
<mxPoint x="1300" y="330" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-42" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" target="XsJQiSFJp8W32oPpOZ8I-29" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1300" y="330" as="sourcePoint" />
<mxPoint x="1330" y="270" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="XsJQiSFJp8W32oPpOZ8I-43" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="XsJQiSFJp8W32oPpOZ8I-29" target="XsJQiSFJp8W32oPpOZ8I-33" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1240" y="370" as="sourcePoint" />
<mxPoint x="1290" y="320" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="pOI4aVwGCnHXTkQfYsa2-1" value="<h1>解密过程</h1><p>解密过程有两个地方不同,</p><p>1. 解密密文时候,子密钥使用顺序是k15-&gt;k1。(加密时子密钥使用顺序是k1-&gt;k15)</p><p>2. 生成子密钥时候,是循环右移得到子密钥。(加密时是循环左移)</p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="160" y="630" width="180" height="270" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>