WEBVTT - This file was automatically generated by VIMEO

0
00:00:06.700 --> 00:00:09.400
In the previous video we discussed our first

1
00:00:09.400 --> 00:00:12.900
 family of symmetry key cryptociphers, which

2
00:00:12.900 --> 00:00:14.800
 are the stream Cyprus.

3
00:00:15.600 --> 00:00:18.600
In this video would introduce the second family

4
00:00:18.600 --> 00:00:21.600
 of symmetric key cryptociphers, which are

5
00:00:21.600 --> 00:00:23.100
 the block ciphers.

6
00:00:25.200 --> 00:00:28.700
We have seen in the previous video that stream ciphers applying

7
00:00:28.700 --> 00:00:32.200
 encryption mechanisms over bits bytes

8
00:00:31.200 --> 00:00:32.800
 or characters.

9
00:00:34.400 --> 00:00:38.000
Blocks, I first have rather large granularity the

10
00:00:37.600 --> 00:00:40.700
 encrypt larger block of bits. For example,

11
00:00:40.700 --> 00:00:44.200
 a block of 64 or 128 bits.

12
00:00:46.500 --> 00:00:49.100
While stream ciphers process the bits or

13
00:00:49.100 --> 00:00:52.600
 bytes independently block ciphers combine all

14
00:00:52.600 --> 00:00:53.400
 the bits of the block.

15
00:00:54.200 --> 00:00:57.200
This approach is very interesting from security point of view.

16
00:00:57.900 --> 00:01:00.200
As the information from one plain text

17
00:01:00.200 --> 00:01:03.300
 bit is diffused into several ciphertext bits.

18
00:01:04.100 --> 00:01:07.000
This makes the work of an attacker who is trying to

19
00:01:07.300 --> 00:01:08.500
 break the system much harder.

20
00:01:09.700 --> 00:01:11.700
This property is called diffusion.

21
00:01:12.600 --> 00:01:15.400
Block ciphers have other advantages compared with

22
00:01:15.400 --> 00:01:16.300
 stream ciphers.

23
00:01:17.200 --> 00:01:20.200
In addition to the confidentiality service that we expect from

24
00:01:20.200 --> 00:01:21.200
 an encryption method.

25
00:01:21.900 --> 00:01:24.900
Block ciphers can be used to provide Integrity service.

26
00:01:26.400 --> 00:01:29.500
when it comes to implementation, even that the

27
00:01:29.500 --> 00:01:32.400
 involve some complex operations, they are

28
00:01:32.400 --> 00:01:35.400
 less difficult to implement correctly and less prone

29
00:01:35.400 --> 00:01:38.300
 to weaknesses because they don't need the key stream

30
00:01:38.300 --> 00:01:40.600
 setup that stream ciphers have

31
00:01:42.600 --> 00:01:43.900
let's see their limitations.

32
00:01:45.100 --> 00:01:48.200
Because they involve more complex operations compared with

33
00:01:48.200 --> 00:01:51.700
 the stream ciphers their encryption and decryption

34
00:01:51.700 --> 00:01:53.800
 methods are slow.

35
00:01:55.100 --> 00:01:58.600
Another limitation is somehow the downside of

36
00:01:58.600 --> 00:01:59.200
 the diffusion.

37
00:02:01.100 --> 00:02:04.900
Block ciphers are more susceptible to noise because the

38
00:02:04.900 --> 00:02:07.400
 bits of single block are processed together

39
00:02:07.400 --> 00:02:10.100
 a narrow in one bit corrupts the entire

40
00:02:10.100 --> 00:02:10.400
 block.

41
00:02:13.200 --> 00:02:15.400
because of their advantages and their security

42
00:02:16.100 --> 00:02:19.300
most symmetric key cryptociphers are

43
00:02:19.300 --> 00:02:20.200
 block ciphers.

44
00:02:20.800 --> 00:02:24.400
We have in particular this triple disc

45
00:02:24.400 --> 00:02:25.600
 and AES.

46
00:02:26.800 --> 00:02:29.200
In our focus in our course, we'll focus

47
00:02:29.200 --> 00:02:32.700
 on as because that's a more recent Cipher

48
00:02:32.700 --> 00:02:33.500
 compared to this.

49
00:02:34.200 --> 00:02:36.700
It is more used and has better security.

50
00:02:39.900 --> 00:02:42.900
Let's return to our setting with Alice

51
00:02:42.900 --> 00:02:43.300
 and Bob.

52
00:02:44.100 --> 00:02:47.700
This time I listen Bob would like to use a block

53
00:02:47.700 --> 00:02:50.400
 Cipher that has some block sites.

54
00:02:51.400 --> 00:02:53.800
Let's refer to that size as B.

55
00:02:54.700 --> 00:02:57.700
example if Alice and verb use

56
00:02:57.700 --> 00:02:58.300
 this

57
00:02:59.300 --> 00:03:01.800
B is equal to 64 bits

58
00:03:02.600 --> 00:03:05.800
if they go with a yes B is

59
00:03:05.800 --> 00:03:07.700
 equal to 128 bits.

60
00:03:09.500 --> 00:03:12.800
We'll use the notation e to refer to the encryption algorithm

61
00:03:12.800 --> 00:03:14.600
 that at least applies.

62
00:03:15.500 --> 00:03:18.500
And D refer to the description algorithm that

63
00:03:18.500 --> 00:03:19.300
 Bob applies.

64
00:03:20.100 --> 00:03:22.900
We said that block Cipher works on units of fixed size.

65
00:03:23.800 --> 00:03:26.200
But messages come in a variety of

66
00:03:26.200 --> 00:03:26.700
 lamps.

67
00:03:28.500 --> 00:03:31.400
If Alice has a plain text that is strictly

68
00:03:31.400 --> 00:03:34.300
 shorter than the block size. How can she use the

69
00:03:34.300 --> 00:03:35.200
 block Cipher?

70
00:03:36.200 --> 00:03:37.900
She has to rely on padding.

71
00:03:38.400 --> 00:03:41.400
So she adds additional bytes to make

72
00:03:41.400 --> 00:03:44.200
 it the length of her plain text equal to B.

73
00:03:44.700 --> 00:03:45.300
quite simple

74
00:03:46.400 --> 00:03:49.500
Several padding schemes exist the simplest is

75
00:03:49.500 --> 00:03:52.500
 to add rule bytes to her plane

76
00:03:52.500 --> 00:03:52.700
 text.

77
00:03:54.100 --> 00:03:57.300
What happens if the length of airplane text is strictly larger than

78
00:03:57.300 --> 00:03:57.600
 b.

79
00:03:58.500 --> 00:04:01.900
In that case she has to add the additional bytes

80
00:04:01.900 --> 00:04:03.100
 to the last block.

81
00:04:03.900 --> 00:04:06.600
To make the total length of her plain text a

82
00:04:06.600 --> 00:04:08.000
 multiple of the block size.

83
00:04:10.500 --> 00:04:13.600
In the previous slide, we will discussing what a

84
00:04:13.600 --> 00:04:17.800
 list has to do to make her plain text fit exactly

85
00:04:17.800 --> 00:04:20.600
 in a certain number of blocks. Let's say n

86
00:04:20.600 --> 00:04:20.900
 blocks.

87
00:04:22.400 --> 00:04:25.300
The next question is how is she

88
00:04:25.300 --> 00:04:28.300
 going to apply the block operation on the different blocks?

89
00:04:29.400 --> 00:04:32.300
She will use what we call mode of operation.

90
00:04:34.200 --> 00:04:37.600
The most straightforward model of operation is called

91
00:04:37.600 --> 00:04:41.200
 electronic code book ECB.

92
00:04:42.400 --> 00:04:45.400
With ECB Alice applies the block

93
00:04:45.400 --> 00:04:48.400
 operation represented in e in parallel and

94
00:04:48.400 --> 00:04:51.400
 independently on her plain text blocks.

95
00:04:52.600 --> 00:04:55.700
similarly purpose has to apply the decryption

96
00:04:55.700 --> 00:04:56.500
 operation d

97
00:04:57.200 --> 00:04:59.600
independently on the ciphertext blocks

98
00:05:01.500 --> 00:05:03.700
don't be surprised that the key disappeared from the figure.

99
00:05:04.500 --> 00:05:07.700
I omit to represent it to keep the slide neat

100
00:05:07.700 --> 00:05:10.300
 but obviously the key is still there

101
00:05:10.300 --> 00:05:13.200
 and it is the same for all the block operations.

102
00:05:14.200 --> 00:05:15.500
for encryption or decryption

103
00:05:17.200 --> 00:05:20.200
ECB mode of operation is quite simple to implement.

104
00:05:21.500 --> 00:05:24.500
It also provides high level of parallelism, which

105
00:05:24.500 --> 00:05:26.900
 is excellent to have high throughput.

106
00:05:28.100 --> 00:05:31.000
However, It suffers from some security issues.

107
00:05:32.700 --> 00:05:35.600
If Alice has two plain text blocks that

108
00:05:35.600 --> 00:05:36.200
 are equal.

109
00:05:37.100 --> 00:05:39.500
Then the two corresponding ciphertext blocks.

110
00:05:40.300 --> 00:05:41.200
Are also equal.

111
00:05:42.300 --> 00:05:45.300
an adversary that intercepts the ciphertext blocks

112
00:05:46.100 --> 00:05:49.000
We'll see that the plain text blocks were equal.

113
00:05:50.300 --> 00:05:53.300
In real life applications. It is possible to have

114
00:05:53.300 --> 00:05:55.200
 some redundancy in the plaintext.

115
00:05:56.100 --> 00:05:58.600
We will see an interesting example in the next slide.

116
00:05:59.800 --> 00:06:02.700
Another problem of this mode of operation is

117
00:06:02.700 --> 00:06:05.400
 that there is no cross block diffusion.

118
00:06:06.800 --> 00:06:10.000
Many in the middle can intercept the ciphertext blocks.

119
00:06:10.800 --> 00:06:11.900
permute two blocks

120
00:06:12.700 --> 00:06:14.300
and send them to to Bob.

121
00:06:14.800 --> 00:06:18.100
Bob will decrypt the message correctly and obtain

122
00:06:17.100 --> 00:06:20.200
 a plain text with two

123
00:06:20.200 --> 00:06:21.100
 permuted blocks.

124
00:06:21.900 --> 00:06:25.700
Bob has no way to detect that the men

125
00:06:24.700 --> 00:06:26.100
 in the middle.

126
00:06:26.700 --> 00:06:29.900
Did some changes to the plaintext?

127
00:06:30.700 --> 00:06:33.900
Of course unless there is some external Integrity mechanism.

128
00:06:35.500 --> 00:06:38.300
Not only permutation is possible the men in

129
00:06:38.300 --> 00:06:41.300
 the middle can delete a block or replace it with

130
00:06:41.300 --> 00:06:41.900
 another one.

131
00:06:42.600 --> 00:06:45.900
So ECB does not guarantee any integrity.

132
00:06:46.600 --> 00:06:49.300
Generally ECB is not recommended to

133
00:06:49.300 --> 00:06:51.400
 be used in real world applications.

134
00:06:52.400 --> 00:06:55.300
However, it is really a good mode of operation

135
00:06:55.300 --> 00:06:57.200
 for educational purposes.

136
00:06:57.900 --> 00:07:00.300
And to understand what are the

137
00:07:00.300 --> 00:07:03.000
 security values of the other modes of operation?

138
00:07:04.200 --> 00:07:06.400
Now, let's look at the better mode of operation.

139
00:07:09.100 --> 00:07:12.400
In this example of an encrypted image you can

140
00:07:12.400 --> 00:07:15.600
 visualize how in the second image

141
00:07:15.600 --> 00:07:18.700
 ECB can leave the plain

142
00:07:18.700 --> 00:07:20.700
 text patterns in the ciphertext.

143
00:07:21.800 --> 00:07:24.800
So while the color of each pixel

144
00:07:24.800 --> 00:07:27.600
 was encrypted we can clearly discern the

145
00:07:27.600 --> 00:07:29.200
 penguin in the second image.

146
00:07:30.100 --> 00:07:33.200
Because the pattern of the identically colored pixels in the

147
00:07:33.200 --> 00:07:37.000
 plaintext image remains in the ciphertext image.

148
00:07:38.800 --> 00:07:40.500
The third image is when we use.

149
00:07:41.400 --> 00:07:43.300
another secure mode of operation

150
00:07:44.500 --> 00:07:44.600
in this case

151
00:07:45.500 --> 00:07:48.600
The encrypted image is undistinguishable from

152
00:07:48.600 --> 00:07:51.500
 random noise, which is what we expect from

153
00:07:51.500 --> 00:07:52.400
 encryption method.

154
00:07:54.800 --> 00:07:58.100
The next mode of operation is CBC mode

155
00:07:57.100 --> 00:08:02.300
 CBC stands for Cipher blockchaining.

156
00:08:03.100 --> 00:08:06.200
In CBC model operation each block of

157
00:08:06.200 --> 00:08:09.100
 the plaintext is exalt with the

158
00:08:09.100 --> 00:08:12.600
 previous ciphertext block before being encrypted.

159
00:08:13.900 --> 00:08:16.400
This way each ciphertext block

160
00:08:16.400 --> 00:08:20.100
 depends on all plaintext blocks processed

161
00:08:19.100 --> 00:08:20.800
 up to that point.

162
00:08:22.500 --> 00:08:26.300
As the first block does not have the previous block. We will

163
00:08:26.300 --> 00:08:30.100
 use what we call initialization Vector IV.

164
00:08:31.800 --> 00:08:32.200
Al

165
00:08:32.700 --> 00:08:35.600
Starts by applying the xor operation

166
00:08:35.600 --> 00:08:38.600
 followed by the encryption operation

167
00:08:38.600 --> 00:08:41.000
 while Bob has to do the inverse.

168
00:08:42.400 --> 00:08:45.900
It starts with the decryption operation then applies

169
00:08:45.900 --> 00:08:46.600
 the xor.

170
00:08:48.200 --> 00:08:52.300
CBC solves the issue that information that

171
00:08:51.300 --> 00:08:53.100
 ECB

172
00:08:53.900 --> 00:08:57.100
was suffering from which is the information leakage.

173
00:08:58.300 --> 00:09:01.500
CBC mode ensures that if the block of

174
00:09:01.500 --> 00:09:05.300
 the plaintext is repeated in the original message. It

175
00:09:04.300 --> 00:09:07.700
 will produce a different ciphertext for

176
00:09:07.700 --> 00:09:08.700
 corresponding blocks.

177
00:09:11.200 --> 00:09:14.100
From security point of view there is no need to

178
00:09:14.100 --> 00:09:17.500
 protect the secrecy of IV unlikely.

179
00:09:18.800 --> 00:09:23.100
Because we use the IV just to instantiate the

180
00:09:22.100 --> 00:09:25.600
 chaining so it can be for example sent

181
00:09:25.600 --> 00:09:26.700
 with a ciphertext.

182
00:09:28.300 --> 00:09:31.100
However, it is recommended to change the IV each

183
00:09:31.100 --> 00:09:31.300
 time.

184
00:09:32.300 --> 00:09:34.600
Because they could be some information leakage.

185
00:09:35.700 --> 00:09:38.300
You can stop the video and take the time to

186
00:09:38.300 --> 00:09:39.200
 think why.

187
00:09:41.800 --> 00:09:44.400
The answer is that we can have a similar

188
00:09:44.400 --> 00:09:45.500
 information leakage.

189
00:09:46.400 --> 00:09:47.700
Like we had with ECB.

190
00:09:48.900 --> 00:09:51.900
If for two different plaintexts the

191
00:09:51.900 --> 00:09:55.000
 first blocks P1 are the

192
00:09:54.000 --> 00:09:55.000
 same.

193
00:09:56.200 --> 00:09:59.900
And the IV was fixed we reused IV.

194
00:10:00.600 --> 00:10:03.300
Then the adversary can still notice the quality of

195
00:10:03.300 --> 00:10:05.500
 these blocks on the ciphertext.

196
00:10:07.400 --> 00:10:09.300
That's why we prefer to have a random ID.

197
00:10:10.600 --> 00:10:13.700
CBC has been the most commonly used

198
00:10:13.700 --> 00:10:15.100
 motive operation.

199
00:10:16.200 --> 00:10:19.400
Its main drawback is that the encryption is sequential?

200
00:10:20.300 --> 00:10:23.700
It cannot be parallelized so we cannot achieve High

201
00:10:23.700 --> 00:10:25.400
 throughputs using CPC.

202
00:10:28.200 --> 00:10:31.800
We reach the end of our video about block ciphers and

203
00:10:31.800 --> 00:10:34.100
 the useful modes of operation.

204
00:10:35.100 --> 00:10:38.200
We have seen ECB and CBC modes.

205
00:10:39.100 --> 00:10:40.100
There are many others.

206
00:10:40.800 --> 00:10:43.800
We see them again in this course, for example,

207
00:10:43.800 --> 00:10:47.100
 when we will discuss message authentication codes.

208
00:10:48.400 --> 00:10:51.700
At the time you will discover how a block Cipher that

209
00:10:51.700 --> 00:10:55.200
 was invented to provide confidentiality can

210
00:10:54.200 --> 00:10:57.700
 also provide integrity and

211
00:10:57.700 --> 00:10:58.700
 Authentication.

212
00:11:00.300 --> 00:11:03.700
In the next video we will see more detail.

213
00:11:04.400 --> 00:11:07.900
the most deployed block Cipher AES

214
00:11:08.700 --> 00:11:10.400
So see you in the next video.
