WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.200 --> 00:00:11.100
In the previous video we discussed block ciphers and

1
00:00:10.100 --> 00:00:13.400
 how we can use padding and modes of

2
00:00:13.400 --> 00:00:16.700
 operation to encrypt data of arbitrary length.

3
00:00:17.800 --> 00:00:20.100
This video will Deep dive into the

4
00:00:20.100 --> 00:00:24.000
 widely used block Cipher a yes and

5
00:00:23.200 --> 00:00:25.700
 look at its specification.

6
00:00:28.200 --> 00:00:31.500
Is the specification for the encryption method

7
00:00:31.500 --> 00:00:35.200
 established by the US National Institute of

8
00:00:35.200 --> 00:00:39.300
 Standards and Technology East in 2001?

9
00:00:40.300 --> 00:00:44.400
Yes was chosen using a selection process that lasted

10
00:00:43.400 --> 00:00:46.900
 from 1997 to

11
00:00:46.900 --> 00:00:47.800
 2000.

12
00:00:48.900 --> 00:00:51.800
The selection of Alias was more open and transparent

13
00:00:51.800 --> 00:00:54.700
 than its predecessor the data

14
00:00:54.700 --> 00:00:56.300
 encryption standard this.

15
00:00:57.400 --> 00:01:00.700
For a selection 15 designs were submitted

16
00:01:00.700 --> 00:01:03.500
 from several cryptographers coming from

17
00:01:03.500 --> 00:01:04.300
 different countries.

18
00:01:05.500 --> 00:01:08.800
The designs were studied and assessed by

19
00:01:08.800 --> 00:01:11.500
 cryptographers not only for security

20
00:01:11.500 --> 00:01:14.500
 but also on performance in

21
00:01:14.500 --> 00:01:15.500
 a variety of settings.

22
00:01:16.700 --> 00:01:19.900
So not only for PCs but also for Hardware

23
00:01:19.900 --> 00:01:20.600
 implementations.

24
00:01:21.500 --> 00:01:25.300
And also on their feasibility in limited environments like

25
00:01:24.300 --> 00:01:28.000
 smart cards or fpgas.

26
00:01:29.700 --> 00:01:32.500
The design invented by the two Belgian

27
00:01:32.500 --> 00:01:35.800
 cryptographers, Vincent Richmond and

28
00:01:35.800 --> 00:01:36.800
 Juan Damon.

29
00:01:37.400 --> 00:01:40.800
Was the winner and it was adapted for the AES

30
00:01:40.800 --> 00:01:41.300
 standard.

31
00:01:42.300 --> 00:01:46.400
That's why if you look at documentation or Publications about

32
00:01:45.400 --> 00:01:48.700
 as you also

33
00:01:48.700 --> 00:01:52.100
 find the name region dial block Cipher.

34
00:01:52.800 --> 00:01:55.200
Region dial was the original name used by

35
00:01:55.200 --> 00:01:57.300
 the inventors during the competition.

36
00:01:58.100 --> 00:02:01.600
The name merging the L refers to the family names

37
00:02:01.600 --> 00:02:03.100
 of the two cryptographers.

38
00:02:05.300 --> 00:02:08.900
AES uses a block of 128 bits

39
00:02:08.900 --> 00:02:11.200
 for the plain text and the ciphertext

40
00:02:13.100 --> 00:02:15.700
a yes is an iterative block Cipher.

41
00:02:16.300 --> 00:02:19.800
With encryption or decryption algorithms are composed

42
00:02:19.800 --> 00:02:20.800
 of iterations.

43
00:02:22.200 --> 00:02:25.900
In each iteration a sequence of operations is executed.

44
00:02:26.800 --> 00:02:29.500
Will also use the name round to refer

45
00:02:29.500 --> 00:02:30.600
 to the iteration.

46
00:02:32.400 --> 00:02:35.300
As allows keys of different sizes.

47
00:02:36.200 --> 00:02:40.500
128 192 and 256

48
00:02:42.100 --> 00:02:45.600
obviously the larger the key the harder it

49
00:02:45.600 --> 00:02:46.500
 is to break the system.

50
00:02:47.600 --> 00:02:50.500
but even for the least secure mode

51
00:02:50.500 --> 00:02:52.100
 as 128

52
00:02:52.900 --> 00:02:55.300
It is quite secure and it's

53
00:02:55.300 --> 00:02:58.900
 considered to be unbreakable with today's Computing

54
00:02:58.900 --> 00:02:59.700
 capabilities.

55
00:03:01.800 --> 00:03:04.200
There is a link between the key length and the number of

56
00:03:04.200 --> 00:03:04.800
 routes.

57
00:03:05.700 --> 00:03:08.300
in fact on each round of areas

58
00:03:09.300 --> 00:03:12.600
We use a round key derived from the main key.

59
00:03:13.600 --> 00:03:17.400
So the longer the main key is the more

60
00:03:17.400 --> 00:03:19.500
 round Keys we can derive.

61
00:03:20.300 --> 00:03:23.400
and the more rounds we get the

62
00:03:23.400 --> 00:03:25.100
 block Cipher can have

63
00:03:26.400 --> 00:03:29.700
That's why for a yes 192.

64
00:03:31.200 --> 00:03:34.300
The key length is 192 bits. We can

65
00:03:34.300 --> 00:03:35.600
 have 12 routes.

66
00:03:36.600 --> 00:03:39.200
while for AES 128

67
00:03:40.800 --> 00:03:42.900
We can only have 10 Rounds.

68
00:03:44.200 --> 00:03:48.400
and for a yes 256 with

69
00:03:47.400 --> 00:03:49.300
 a key length of

70
00:03:50.200 --> 00:03:53.400
256 we can have 14 rounds.

71
00:03:55.600 --> 00:03:59.400
In terms of security AES was extensively studied

72
00:03:58.400 --> 00:04:02.000
 and today no vulnerability

73
00:04:01.400 --> 00:04:03.000
 have been discovered.

74
00:04:06.400 --> 00:04:08.100
Let's see how AES works.

75
00:04:09.300 --> 00:04:12.200
the 128-bit plain text

76
00:04:12.200 --> 00:04:12.500
 block

77
00:04:13.300 --> 00:04:16.400
is arranged as four by four array of

78
00:04:16.400 --> 00:04:16.900
 bytes.

79
00:04:17.500 --> 00:04:19.800
As you can see in the right side of the slide.

80
00:04:20.400 --> 00:04:23.900
So 128 by a bit correspond to

81
00:04:23.900 --> 00:04:25.700
 16 bytes.

82
00:04:27.100 --> 00:04:29.200
We call this array the state.

83
00:04:29.900 --> 00:04:32.600
the state is modified in place in

84
00:04:32.600 --> 00:04:34.100
 each round of as

85
00:04:36.400 --> 00:04:39.500
we mentioned in the previous slide. We do

86
00:04:39.500 --> 00:04:41.900
 not directly use the original main key.

87
00:04:42.700 --> 00:04:45.500
But rather round Keys derived from

88
00:04:45.500 --> 00:04:46.300
 the main key.

89
00:04:47.300 --> 00:04:50.700
On each route. We use one round key except on

90
00:04:50.700 --> 00:04:52.600
 the last round we use two round keys.

91
00:04:53.600 --> 00:04:56.500
That's why if R represents the number

92
00:04:56.500 --> 00:04:58.600
 of rounds we have.

93
00:04:59.700 --> 00:05:02.300
Then we derive R plus 1.

94
00:05:03.100 --> 00:05:05.400
Round keys from the original key.

95
00:05:06.400 --> 00:05:09.000
So for example for as 128.

96
00:05:09.800 --> 00:05:12.700
We have 10 rounds and thus 11

97
00:05:12.700 --> 00:05:16.300
 round keys while for as 192.

98
00:05:15.300 --> 00:05:19.400
 We have 12 rounds and

99
00:05:18.400 --> 00:05:20.700
 13 round keys.

100
00:05:21.400 --> 00:05:23.500
for a yes 256

101
00:05:24.400 --> 00:05:27.500
we have 14 rounds and 15

102
00:05:27.500 --> 00:05:28.300
 round keys.

103
00:05:30.200 --> 00:05:33.200
Each round key has the same length as the state.

104
00:05:34.200 --> 00:05:37.500
And it is also represented as a 4

105
00:05:37.500 --> 00:05:40.100
 by 4 array of bytes like you see

106
00:05:40.100 --> 00:05:42.100
 on the right side of the slide.

107
00:05:44.400 --> 00:05:47.700
each a yes round consists of four steps

108
00:05:48.800 --> 00:05:49.700
subbytes

109
00:05:50.600 --> 00:05:51.500
shift rows

110
00:05:52.100 --> 00:05:53.000
mixed columns

111
00:05:53.700 --> 00:05:55.300
and add round key.

112
00:05:56.500 --> 00:05:59.700
In the first three steps only the state

113
00:05:59.700 --> 00:06:00.700
 is transformed.

114
00:06:01.900 --> 00:06:04.200
on the last step at Round key

115
00:06:04.800 --> 00:06:06.300
as its name suggests

116
00:06:07.200 --> 00:06:10.300
the bytes of the state are mixed with the bytes of

117
00:06:10.300 --> 00:06:11.100
 the round key.

118
00:06:12.700 --> 00:06:15.400
Let's now see which type of operations we have

119
00:06:15.400 --> 00:06:16.900
 in each of these steps.

120
00:06:19.400 --> 00:06:21.000
in some bite step

121
00:06:22.400 --> 00:06:24.100
each byte of the array

122
00:06:24.600 --> 00:06:27.300
Is replaced again according to

123
00:06:27.300 --> 00:06:30.500
 lookup table represented by the letter s

124
00:06:30.500 --> 00:06:31.500
 in the slide.

125
00:06:33.200 --> 00:06:36.900
This lookup table has 256 entries which

126
00:06:36.900 --> 00:06:39.900
 correspond to the 256 possible

127
00:06:39.900 --> 00:06:42.000
 values that byte can have.

128
00:06:43.200 --> 00:06:46.200
for example for the byte 00

129
00:06:46.200 --> 00:06:49.600
 is corresponding value in the lookup table is

130
00:06:49.600 --> 00:06:51.300
 the byte 63

131
00:06:52.300 --> 00:06:54.500
while for the value

132
00:06:55.500 --> 00:06:57.900
zero one is corresponding value.

133
00:06:58.700 --> 00:07:00.000
Is the byte 7?

134
00:07:00.800 --> 00:07:01.000
C

135
00:07:01.800 --> 00:07:05.000
Wine all the way to the last value FF

136
00:07:05.900 --> 00:07:08.400
Who score spending value in the vocab table is

137
00:07:08.400 --> 00:07:10.000
 the byte 16.

138
00:07:11.800 --> 00:07:14.900
Sub bytes lookup table is public and

139
00:07:14.900 --> 00:07:17.900
 it was chosen by the Alias

140
00:07:17.900 --> 00:07:18.200
 inventors.

141
00:07:18.800 --> 00:07:21.500
However, they described how this lookup

142
00:07:21.500 --> 00:07:22.500
 table was constructed.

143
00:07:23.300 --> 00:07:26.400
And they specified the process to construct a new

144
00:07:26.400 --> 00:07:29.000
 lookup table if you are worried if there is

145
00:07:29.200 --> 00:07:31.000
 a trapdoor in this lookup table.

146
00:07:32.200 --> 00:07:35.400
Obviously if we change the lookup table, we completely changed the

147
00:07:35.400 --> 00:07:36.600
 cipher.

148
00:07:37.400 --> 00:07:40.800
and it will be equivalent to obtaining new

149
00:07:40.800 --> 00:07:41.400
 as

150
00:07:42.400 --> 00:07:45.700
However, this new areas should have the same security

151
00:07:45.700 --> 00:07:47.200
 as the original is.

152
00:07:48.400 --> 00:07:50.200
Let's now return to our Ace.

153
00:07:51.100 --> 00:07:52.800
So we explained subbytes.

154
00:07:53.500 --> 00:07:56.600
So bytes is just a simple operation of changing the

155
00:07:56.600 --> 00:07:59.800
 value of each byte based on lookup table.

156
00:08:01.300 --> 00:08:04.500
This operation acts on each byte separately.

157
00:08:07.400 --> 00:08:10.400
In next step is shiftro.

158
00:08:11.400 --> 00:08:13.700
shift rows as its name suggests

159
00:08:14.500 --> 00:08:18.000
shifts each row using a certain number of positions

160
00:08:19.500 --> 00:08:23.000
In the figure, you can see the state before and

161
00:08:22.400 --> 00:08:24.700
 after applying shift rows.

162
00:08:25.400 --> 00:08:27.700
Let's look at the rows one by one.

163
00:08:28.800 --> 00:08:29.700
For the first row.

164
00:08:30.500 --> 00:08:32.000
We didn't do any shift.

165
00:08:33.600 --> 00:08:37.400
As you see all the bytes P1 p2p3p4

166
00:08:36.400 --> 00:08:38.500
 stayed in the same position.

167
00:08:40.300 --> 00:08:41.000
For the second row.

168
00:08:41.800 --> 00:08:44.600
We shifted with one position

169
00:08:44.600 --> 00:08:45.800
 to the left.

170
00:08:46.800 --> 00:08:49.700
You can look at the byte P6,

171
00:08:49.700 --> 00:08:52.900
 for example that was shifted by one

172
00:08:52.900 --> 00:08:53.800
 position to the left.

173
00:08:55.400 --> 00:08:57.300
For the third row.

174
00:08:58.100 --> 00:09:00.100
We shift with two positions.

175
00:09:01.100 --> 00:09:04.600
You can see that for the byte P11 that

176
00:09:04.600 --> 00:09:07.900
 now arrives to the first column.

177
00:09:08.400 --> 00:09:11.700
And for the last row the shift

178
00:09:11.700 --> 00:09:14.100
 is with three positions to the left.

179
00:09:15.300 --> 00:09:19.400
That's why the byte p16 is now at

180
00:09:18.400 --> 00:09:20.400
 the first column.

181
00:09:22.800 --> 00:09:25.500
So to summarize shift rows

182
00:09:25.500 --> 00:09:28.400
 is an operation that acts on

183
00:09:28.400 --> 00:09:29.700
 one row at a time.

184
00:09:32.400 --> 00:09:34.300
now mix column steps

185
00:09:34.900 --> 00:09:37.300
mix columns combines the bytes of every

186
00:09:37.300 --> 00:09:37.700
 column

187
00:09:38.800 --> 00:09:41.800
the four bytes of the colon are multiplied by

188
00:09:41.800 --> 00:09:44.300
 fixed four by four Matrix of

189
00:09:44.300 --> 00:09:44.800
 bytes.

190
00:09:45.400 --> 00:09:48.100
As Illustrated below for the first

191
00:09:48.100 --> 00:09:48.900
 column.

192
00:09:49.400 --> 00:09:52.100
p15 P9 p13

193
00:09:52.800 --> 00:09:55.500
we multiply them with this Matrix that

194
00:09:55.500 --> 00:09:55.800
 you see.

195
00:09:56.800 --> 00:10:00.100
To obtain the new column P1

196
00:09:59.100 --> 00:10:02.700
 Prime P5 Prime P9 prime p13

197
00:10:02.700 --> 00:10:02.900
 prime.

198
00:10:04.400 --> 00:10:07.600
By the way, we use the same Matrix for all the columns.

199
00:10:09.600 --> 00:10:12.500
This multiplication might look ambiguous to

200
00:10:12.500 --> 00:10:13.400
 you. That's fine.

201
00:10:14.100 --> 00:10:18.300
in the next video we'll discuss the mathematics uses

202
00:10:17.300 --> 00:10:19.200
 used in as

203
00:10:19.800 --> 00:10:23.500
And will clarify what does it mean to multiply a

204
00:10:22.500 --> 00:10:25.800
 colon of bytes by metrics

205
00:10:25.800 --> 00:10:26.300
 of bytes?

206
00:10:27.400 --> 00:10:30.600
Okay, so while subtites acts on

207
00:10:30.600 --> 00:10:33.200
 a byte at a time and shift rows acts on

208
00:10:33.200 --> 00:10:36.500
 row at a time mixed columns processes one

209
00:10:36.500 --> 00:10:37.400
 column at a time.

210
00:10:39.800 --> 00:10:42.200
The last step is probably the most

211
00:10:42.200 --> 00:10:43.700
 straightforward to understand.

212
00:10:45.300 --> 00:10:48.900
We exhort each byte of the state with

213
00:10:48.900 --> 00:10:50.200
 a byte of the round key.

214
00:10:50.700 --> 00:10:54.100
So we use these operator the sum

215
00:10:53.100 --> 00:10:56.900
 operator in a circle to denote

216
00:10:56.900 --> 00:10:58.300
 the xor operation.

217
00:10:59.900 --> 00:11:02.700
So similar to some bytes.

218
00:11:03.200 --> 00:11:06.200
At Round key acts on one byte at

219
00:11:06.200 --> 00:11:06.500
 a time.

220
00:11:08.900 --> 00:11:12.100
In this video we described as and

221
00:11:11.100 --> 00:11:14.900
 the steps that compose its route.

222
00:11:15.800 --> 00:11:18.300
Steps involve some arithmetic that we

223
00:11:18.300 --> 00:11:19.500
 did not explain yet.

224
00:11:20.900 --> 00:11:23.600
So see you in the next video to understand

225
00:11:23.600 --> 00:11:25.700
 how aesrithmetic works.
