WEBVTT

1
00:00.000 --> 00:00.550 align:middle line:84%


2
00:00.550 --> 00:03.580 align:middle line:90%
Have you ever downloaded
a file from the internet.

3
00:03.580 --> 00:05.500 align:middle line:90%
Maybe it was a file
for a router update,

4
00:05.500 --> 00:08.140 align:middle line:90%
or a file for your
computer or an application.

5
00:08.140 --> 00:11.680 align:middle line:90%
And wondered is this file
really from the vendor

6
00:11.680 --> 00:15.790 align:middle line:90%
or is this a file that an
attacker or a hacker got,

7
00:15.790 --> 00:17.890 align:middle line:90%
manipulated, included
some malware,

8
00:17.890 --> 00:19.737 align:middle line:90%
and now I have it
on my computer?

9
00:19.737 --> 00:21.570 align:middle line:90%
That's actually a very
good question to ask.

10
00:21.570 --> 00:23.860 align:middle line:90%
That's why we should download
from reputable sources,

11
00:23.860 --> 00:26.980 align:middle line:90%
but beyond just hoping
the files are OK.

12
00:26.980 --> 00:29.770 align:middle line:90%
Another method we can use
for verifying data integrity

13
00:29.770 --> 00:34.330 align:middle line:90%
in the world of cryptography
is the concept of using a hash.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

13
00:29.770 --> 00:34.330 align:middle line:90%
in the world of cryptography
is the concept of using a hash.

14
00:34.330 --> 00:35.570 align:middle line:84%
And here's how a hash works.

15
00:35.570 --> 00:37.390 align:middle line:90%
So we're sitting
here at our computer

16
00:37.390 --> 00:39.530 align:middle line:84%
and we download the file.

17
00:39.530 --> 00:41.600 align:middle line:90%
And what we can do is
we can have that file.

18
00:41.600 --> 00:43.235 align:middle line:84%
It's on our hard disk.

19
00:43.235 --> 00:44.860 align:middle line:90%
And instead of just
trusting, Oh, yeah.

20
00:44.860 --> 00:46.340 align:middle line:84%
That's the official file.

21
00:46.340 --> 00:49.078 align:middle line:90%
We can go ahead and
verify the hash.

22
00:49.078 --> 00:51.620 align:middle line:90%
And then we can go up to-- if
it's a Cisco file, for example,

23
00:51.620 --> 00:53.590 align:middle line:84%
we Cisco.com.

24
00:53.590 --> 00:56.950 align:middle line:90%
And on their website, they
would publish the hash.

25
00:56.950 --> 00:59.240 align:middle line:90%
So a hash is like a little
string of data source.

26
00:59.240 --> 01:03.310 align:middle line:90%
If the file is 200
megabytes, or 50 megabytes,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

26
00:59.240 --> 01:03.310 align:middle line:90%
If the file is 200
megabytes, or 50 megabytes,

27
01:03.310 --> 01:05.950 align:middle line:90%
or 1 megabyte based on the
hash that they're using,

28
01:05.950 --> 01:08.710 align:middle line:90%
it'll create this little,
teeny string of text

29
01:08.710 --> 01:11.880 align:middle line:90%
that is created as a
result of creating a hash.

30
01:11.880 --> 01:14.320 align:middle line:90%
And so what we can do is
we can download the file.

31
01:14.320 --> 01:16.540 align:middle line:90%
We can take a look on
Cisco's official site

32
01:16.540 --> 01:18.070 align:middle line:84%
and see what the hash is.

33
01:18.070 --> 01:20.890 align:middle line:90%
We can run that same
hashing algorithm again.

34
01:20.890 --> 01:23.620 align:middle line:90%
And if the hash we
generate matches the hash

35
01:23.620 --> 01:25.180 align:middle line:84%
they published, guess what?

36
01:25.180 --> 01:26.770 align:middle line:84%
We have data integrity.

37
01:26.770 --> 01:29.260 align:middle line:90%
And that way we can
validate that it is indeed

38
01:29.260 --> 01:31.210 align:middle line:84%
the file that we think it is.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

38
01:29.260 --> 01:31.210 align:middle line:84%
the file that we think it is.

39
01:31.210 --> 01:33.450 align:middle line:90%
Or if it's on a Cisco
iOS image, you can--

40
01:33.450 --> 01:34.690 align:middle line:84%
let's go on the top here.

41
01:34.690 --> 01:38.080 align:middle line:90%
You can write this command
right here, verify slash MD5.

42
01:38.080 --> 01:39.880 align:middle line:84%
That's verifying the MD5 hash.

43
01:39.880 --> 01:42.220 align:middle line:90%
It'll generate the
hash, and then we'd

44
01:42.220 --> 01:44.590 align:middle line:90%
compare that hash
generated to the hash

45
01:44.590 --> 01:46.220 align:middle line:84%
that Cisco publishes for.

46
01:46.220 --> 01:48.070 align:middle line:90%
So this is an example
of using a hash

47
01:48.070 --> 01:50.470 align:middle line:90%
to verify the data
integrity of a file,

48
01:50.470 --> 01:53.230 align:middle line:90%
but the same concept
can be used to verify

49
01:53.230 --> 01:55.360 align:middle line:90%
the data integrity
of packets as they're

50
01:55.360 --> 01:57.220 align:middle line:84%
being sent over a network.

51
01:57.220 --> 01:58.720 align:middle line:90%
So in the event of
sending a packet,

52
01:58.720 --> 02:01.090 align:middle line:90%
if R1 is sending a
packet over to R2,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

52
01:58.720 --> 02:01.090 align:middle line:90%
if R1 is sending a
packet over to R2,

53
02:01.090 --> 02:03.640 align:middle line:90%
if we're using some kind
of a hashing function.

54
02:03.640 --> 02:07.400 align:middle line:90%
R1 and R2 can validate, based on
the hash, each and every packet

55
02:07.400 --> 02:10.157 align:middle line:90%
that's being sent to make
sure the hashes match up,

56
02:10.157 --> 02:11.740 align:middle line:90%
which is going to
help verify the data

57
02:11.740 --> 02:13.657 align:middle line:90%
integrity of those
packets-- that they haven't

58
02:13.657 --> 02:16.690 align:middle line:90%
been manipulated or changed
in transit by some third party

59
02:16.690 --> 02:17.630 align:middle line:84%
device.

60
02:17.630 --> 02:21.010 align:middle line:90%
So let me give you a very
vivid example of how a hash can

61
02:21.010 --> 02:23.060 align:middle line:84%
help us verify data integrity.

62
02:23.060 --> 02:25.270 align:middle line:84%
This is a Passwordgenerator.net.

63
02:25.270 --> 02:26.650 align:middle line:84%
I just found it online.

64
02:26.650 --> 02:28.330 align:middle line:90%
And I'm going to
paste in-- right click

65
02:28.330 --> 02:31.090 align:middle line:90%
and paste the Declaration
of Independence.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

65
02:28.330 --> 02:31.090 align:middle line:90%
and paste the Declaration
of Independence.

66
02:31.090 --> 02:33.640 align:middle line:90%
And I'm also including
the unanimous declaration,

67
02:33.640 --> 02:35.300 align:middle line:84%
the first few words there.

68
02:35.300 --> 02:38.320 align:middle line:90%
So if we have this document
with all these words,

69
02:38.320 --> 02:39.850 align:middle line:84%
all the syntax.

70
02:39.850 --> 02:41.920 align:middle line:90%
If we want to generate
a hash based on that,

71
02:41.920 --> 02:44.560 align:middle line:90%
we'd paste that text
in, click on Generate.

72
02:44.560 --> 02:46.450 align:middle line:90%
This little string
right here is the hash

73
02:46.450 --> 02:48.760 align:middle line:90%
that's now being generated
based on all that text.

74
02:48.760 --> 02:50.090 align:middle line:84%
Now check this out.

75
02:50.090 --> 02:55.090 align:middle line:90%
If we change one character or
anything else in that document,

76
02:55.090 --> 02:56.350 align:middle line:84%
it's going to modify the hash.

77
02:56.350 --> 02:57.910 align:middle line:90%
So you can take a
look at the first,

78
02:57.910 --> 03:01.740 align:middle line:84%
like 1C5F, or at the end, 5850.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

78
02:57.910 --> 03:01.740 align:middle line:84%
like 1C5F, or at the end, 5850.

79
03:01.740 --> 03:03.490 align:middle line:90%
Either way is fine
because the entire hash

80
03:03.490 --> 03:05.407 align:middle line:90%
is going to change if
we change one character.

81
03:05.407 --> 03:08.020 align:middle line:90%
So going to change
instead of a capital T,

82
03:08.020 --> 03:10.480 align:middle line:90%
I'm going to go ahead
and put a lowercase t.

83
03:10.480 --> 03:13.760 align:middle line:90%
And you'll notice the
entire hash changes.

84
03:13.760 --> 03:16.530 align:middle line:90%
And so if I generate a hash
on the original document,

85
03:16.530 --> 03:18.213 align:middle line:90%
you're on the same
hashing algorithm.

86
03:18.213 --> 03:19.630 align:middle line:90%
When you receive
the document, you

87
03:19.630 --> 03:22.555 align:middle line:90%
can know if the hashes match,
that the data has integrity.

88
03:22.555 --> 03:27.080 align:middle line:90%
It hasn't been manipulated
or modified since I sent it.

89
03:27.080 --> 03:28.373 align:middle line:84%
So hashing is pretty cool.

90
03:28.373 --> 03:30.290 align:middle line:90%
Now one of the challenges
with hashing though,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

90
03:28.373 --> 03:30.290 align:middle line:90%
Now one of the challenges
with hashing though,

91
03:30.290 --> 03:33.190 align:middle line:90%
is that what if an
attacker takes packets

92
03:33.190 --> 03:36.160 align:middle line:90%
and they modify the data, and
then they generate a new hash?

93
03:36.160 --> 03:40.887 align:middle line:90%
Because the hashing algorithms
like SHA512, SHA256, SHA1,

94
03:40.887 --> 03:42.220 align:middle line:84%
those are not secret algorithms.

95
03:42.220 --> 03:45.310 align:middle line:90%
So a hacker could
theoretically take a packet,

96
03:45.310 --> 03:48.057 align:middle line:90%
modify the contents, create a
new hash, send it on it's way.

97
03:48.057 --> 03:49.390 align:middle line:84%
And the receivers say, Oh, yeah.

98
03:49.390 --> 03:50.140 align:middle line:84%
The hash matches.

99
03:50.140 --> 03:50.932 align:middle line:84%
That's the problem.

100
03:50.932 --> 03:53.500 align:middle line:90%
So another aspect
regarding hashing

101
03:53.500 --> 03:56.770 align:middle line:90%
is instead of just using the
hashing algorithm by itself,

102
03:56.770 --> 03:59.710 align:middle line:90%
why not also include in the
formula, in the equation,

103
03:59.710 --> 04:01.270 align:middle line:84%
include some secret key.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

103
03:59.710 --> 04:01.270 align:middle line:84%
include some secret key.

104
04:01.270 --> 04:05.025 align:middle line:90%
Some secret that's only known
by the sender and the receiver.

105
04:05.025 --> 04:06.980 align:middle line:90%
So if we're on a
hashing algorithm

106
04:06.980 --> 04:10.240 align:middle line:90%
and we include a secret as
part of the calculation,

107
04:10.240 --> 04:12.190 align:middle line:90%
that way only the
sender and receiver

108
04:12.190 --> 04:15.220 align:middle line:90%
can correctly create new
hashes and verify the hashes

109
04:15.220 --> 04:16.190 align:middle line:84%
on that data.

110
04:16.190 --> 04:18.040 align:middle line:90%
So when we do that
in IP networking

111
04:18.040 --> 04:19.690 align:middle line:90%
to protect the traffic,
that's referred

112
04:19.690 --> 04:22.300 align:middle line:90%
to as hashed message
authentication

113
04:22.300 --> 04:24.388 align:middle line:84%
code, or HMAC for short.

114
04:24.388 --> 04:25.930 align:middle line:90%
And let me give you
an example of how

115
04:25.930 --> 04:28.120 align:middle line:90%
adding that additional
component of some secret

116
04:28.120 --> 04:31.340 align:middle line:90%
that both party knows, how
that changes the equation.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

116
04:28.120 --> 04:31.340 align:middle line:90%
that both party knows, how
that changes the equation.

117
04:31.340 --> 04:32.650 align:middle line:84%
So here is yet another site.

118
04:32.650 --> 04:33.900 align:middle line:84%
It's called Freeformatter.com.

119
04:33.900 --> 04:36.610 align:middle line:90%
And I will go ahead and
paste the Declaration

120
04:36.610 --> 04:38.260 align:middle line:84%
of Independence in there again.

121
04:38.260 --> 04:40.270 align:middle line:84%
And we can choose our algorithm.

122
04:40.270 --> 04:41.530 align:middle line:84%
So bigger is better.

123
04:41.530 --> 04:44.170 align:middle line:90%
MD5, we're not using too much
anymore because it's not too

124
04:44.170 --> 04:46.510 align:middle line:84%
secure, but let's do SHA512.

125
04:46.510 --> 04:47.620 align:middle line:84%
That's pretty hefty.

126
04:47.620 --> 04:49.820 align:middle line:90%
Now it's also asking
us for a secret key.

127
04:49.820 --> 04:51.640 align:middle line:90%
So the secret is
the element that's

128
04:51.640 --> 04:56.290 align:middle line:90%
going to make this hash only
calculatable by the devices who

129
04:56.290 --> 04:57.770 align:middle line:84%
both have that key.

130
04:57.770 --> 05:01.200 align:middle line:84%
So let's use our secret here.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

130
04:57.770 --> 05:01.200 align:middle line:84%
So let's use our secret here.

131
05:01.200 --> 05:03.930 align:middle line:90%
And we'll click on Compute HMAC,
which is the hashed message

132
05:03.930 --> 05:05.350 align:middle line:84%
authentication code.

133
05:05.350 --> 05:06.660 align:middle line:84%
And there it is.

134
05:06.660 --> 05:10.110 align:middle line:90%
There is the SHA512 HMAC
for the entire document.

135
05:10.110 --> 05:12.630 align:middle line:90%
If we change one
character of the text,

136
05:12.630 --> 05:15.960 align:middle line:90%
or we change any aspect of our
key, which I will go and just

137
05:15.960 --> 05:20.010 align:middle line:90%
call it our SEC and
click on Compute HMAC

138
05:20.010 --> 05:22.140 align:middle line:90%
is going to modify
that entire string.

139
05:22.140 --> 05:23.640 align:middle line:90%
Again, a different
secret is going

140
05:23.640 --> 05:26.820 align:middle line:90%
to affect the outcome
of the calculation.

141
05:26.820 --> 05:28.320 align:middle line:90%
So in this video,
we've taken a look

142
05:28.320 --> 05:32.220 align:middle line:90%
at the concept of hashing
to validate data integrity,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

142
05:28.320 --> 05:32.220 align:middle line:90%
at the concept of hashing
to validate data integrity,

143
05:32.220 --> 05:34.980 align:middle line:90%
whether it's on a file or
whether it's on a packet that's

144
05:34.980 --> 05:36.210 align:middle line:84%
being sent over a network.

145
05:36.210 --> 05:38.640 align:middle line:90%
Hashing and its
bigger brother, HMAC,

146
05:38.640 --> 05:42.060 align:middle line:90%
are important tools to have
in our cryptography tool belt.

147
05:42.060 --> 05:44.700 align:middle line:90%
Now hashing and data integrity
are pretty darn important,

148
05:44.700 --> 05:46.920 align:middle line:90%
but also in the world
of cryptography,

149
05:46.920 --> 05:49.020 align:middle line:90%
we have tools to help
keep the data private

150
05:49.020 --> 05:51.360 align:middle line:90%
and hidden from
unauthorized eyes.

151
05:51.360 --> 05:53.420 align:middle line:90%
And we'll take a look at
that in the next video.

152
05:53.420 --> 05:55.150 align:middle line:90%
So I'll see you there
in just a moment.

153
05:55.150 --> 05:57.690 align:middle line:90%
Meanwhile, I hope this has
been informative for you.

154
05:57.690 --> 06:01.010 align:middle line:90%
And I'd like to thank
you for viewing.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

154
05:57.690 --> 06:01.010 align:middle line:90%
And I'd like to thank
you for viewing.
