1
00:00:00,000 --> 00:00:01,589
Part of the CIA triad

2
00:00:01,589 --> 00:00:04,230
when it comes to cyber security, is integrity.

3
00:00:04,230 --> 00:00:05,910
So that means that we're going to have to make sure

4
00:00:05,910 --> 00:00:07,920
that the information that we stored

5
00:00:07,920 --> 00:00:09,600
is the same when we retrieve it,

6
00:00:09,600 --> 00:00:11,190
because there's situations where

7
00:00:11,190 --> 00:00:14,130
there's attacks happen, or there's just disruptions,

8
00:00:14,130 --> 00:00:16,890
restarts, reboots that messes up data.

9
00:00:16,890 --> 00:00:18,840
So sometimes we might think we're getting

10
00:00:18,840 --> 00:00:21,690
what we originally set, but that's not actually the case.

11
00:00:21,690 --> 00:00:23,880
So there's a way to check to make sure we have

12
00:00:23,880 --> 00:00:26,370
the right integrity and that's through hashes.

13
00:00:26,370 --> 00:00:28,530
And one of the most used hashes today,

14
00:00:28,530 --> 00:00:30,270
is going to be the SHA-256 standard.

15
00:00:30,270 --> 00:00:33,060
So we're going to use the SHA-256 sum command

16
00:00:33,060 --> 00:00:33,930
and we're going to go through

17
00:00:33,930 --> 00:00:36,480
and we're going to create hashes of a directory,

18
00:00:36,480 --> 00:00:38,700
and then we're going to do a hash sum check

19
00:00:38,700 --> 00:00:41,610
on the directory just to verify that it works,

20
00:00:41,610 --> 00:00:43,590
make some changes, and see what happens

21
00:00:43,590 --> 00:00:44,763
when it does not match.

22
00:00:45,930 --> 00:00:46,763
So first thing we're going to do,

23
00:00:46,763 --> 00:00:48,460
we're going to run this batch command.

24
00:00:51,870 --> 00:00:56,163
SHA256sum on our SensitiveData folder,

25
00:01:01,500 --> 00:01:03,243
I'm going to use it on every file,

26
00:01:05,580 --> 00:01:06,843
put it into our hash.

27
00:01:10,080 --> 00:01:12,210
All right, let's see if they went through there.

28
00:01:12,210 --> 00:01:14,100
Okay, so we can see the hashes created.

29
00:01:14,100 --> 00:01:15,713
Let's check out what that looks like.

30
00:01:18,060 --> 00:01:19,170
All right.

31
00:01:19,170 --> 00:01:21,660
We see we have two hashes of these files.

32
00:01:21,660 --> 00:01:22,590
Next we're going to go through

33
00:01:22,590 --> 00:01:25,653
and compare the hashes to the hashes of the current file.

34
00:01:26,700 --> 00:01:31,700
sudo sha256sum check hashes.

35
00:01:35,430 --> 00:01:38,640
All right, so we can see that it ran hash on the files

36
00:01:38,640 --> 00:01:40,470
and then compared them to what the list was

37
00:01:40,470 --> 00:01:43,290
that we created earlier, with the hashes that text

38
00:01:43,290 --> 00:01:44,400
and the show that they match.

39
00:01:44,400 --> 00:01:46,170
Now let's make some modifications

40
00:01:46,170 --> 00:01:48,120
and we'll see what happened when we do that.

41
00:01:48,120 --> 00:01:49,530
So that's going to make change to the files

42
00:01:49,530 --> 00:01:52,050
and verify that they failed the integrity check.

43
00:01:52,050 --> 00:01:57,050
sudo bash .c echo random data.

44
00:02:20,070 --> 00:02:22,313
and then we're going to remove one of the files.

45
00:02:32,620 --> 00:02:35,353
Okay, so now we're going to run the command on it.

46
00:02:44,020 --> 00:02:48,060
Okay, so we see it lets us know that the list one fail

47
00:02:48,060 --> 00:02:49,860
because that's the one we modified when we added

48
00:02:49,860 --> 00:02:52,260
the new random information,

49
00:02:52,260 --> 00:02:55,770
list three, we removed it, so it's not even present.

50
00:02:55,770 --> 00:02:57,780
So it lets us know exactly what was wrong,

51
00:02:57,780 --> 00:02:59,910
let us know that it didn't match,

52
00:02:59,910 --> 00:03:01,920
and that's because it compared the hash values

53
00:03:01,920 --> 00:03:04,380
that it runs instantly on the files,

54
00:03:04,380 --> 00:03:05,733
to the ones in the text.

55
00:03:06,600 --> 00:03:07,860
All right, that was just a quick example

56
00:03:07,860 --> 00:03:09,030
and a quick walkthrough of how to use

57
00:03:09,030 --> 00:03:12,030
the SHA-256 sum to create hashes

58
00:03:12,030 --> 00:03:14,310
and to compare them for later views.

59
00:03:14,310 --> 00:03:15,480
Thank you for sticking with this walkthrough

60
00:03:15,480 --> 00:03:17,280
and I'll see you in the next lesson.

