1 00:00:06,569 --> 00:00:09,423 - Encryption has been part of signals intelligence 2 00:00:09,423 --> 00:00:11,196 for quite some time. 3 00:00:11,196 --> 00:00:15,196 Caesar cipher, vigenere cipher, ROT13 et cetera. 4 00:00:16,119 --> 00:00:19,994 If there is a secret you want protected, encrypt it. 5 00:00:19,994 --> 00:00:22,626 One way hashing is not encryption 6 00:00:22,626 --> 00:00:25,626 but it is used to protect passwords. 7 00:00:26,768 --> 00:00:28,224 While not reversible, 8 00:00:28,224 --> 00:00:31,890 hashing algorithms were designed to be computed quickly. 9 00:00:31,890 --> 00:00:35,460 So you can compute many hashes from a dynamic source 10 00:00:35,460 --> 00:00:39,488 like a Word list or permutations, brute force 11 00:00:39,488 --> 00:00:42,738 and compare the result to find a match. 12 00:00:44,393 --> 00:00:47,603 Lets take a look at how hashing works. 13 00:00:47,603 --> 00:00:51,501 We first start with clear text like "pearson". 14 00:00:51,501 --> 00:00:53,777 We send it through a hash function. 15 00:00:53,777 --> 00:00:56,862 In this case we are using MD5. 16 00:00:56,862 --> 00:01:01,297 As the hash function applies a one way hashing algorithm, 17 00:01:01,297 --> 00:01:05,064 the output of the function is a string of characters 18 00:01:05,064 --> 00:01:09,231 that is unique to that specific clear text that we input. 19 00:01:10,379 --> 00:01:13,275 Now this string can be used in different ways 20 00:01:13,275 --> 00:01:17,446 to verify the integrity of clear text that was provided. 21 00:01:17,446 --> 00:01:19,846 For instance, if a clear text email 22 00:01:19,846 --> 00:01:24,359 is sent through a hash function by the sender 23 00:01:24,359 --> 00:01:27,598 and the hash was provided to the recipient, 24 00:01:27,598 --> 00:01:29,710 they can use it to verify that the email 25 00:01:29,710 --> 00:01:31,960 was not changed in transit. 26 00:01:33,423 --> 00:01:34,697 So in this demo, 27 00:01:34,697 --> 00:01:37,805 I want to just show you a really quick and easy way 28 00:01:37,805 --> 00:01:40,555 to generate a hash of clear text. 29 00:01:41,566 --> 00:01:44,959 Just like we did in the previous slides. 30 00:01:44,959 --> 00:01:47,513 Of course we are not gonna use MD5 31 00:01:47,513 --> 00:01:50,061 because today we have better algorithms 32 00:01:50,061 --> 00:01:52,978 for hashing like SHA256. 33 00:01:53,983 --> 00:01:55,837 So what I am gonna show here is 34 00:01:55,837 --> 00:01:58,911 how to do this from a Kali commandline. 35 00:01:58,911 --> 00:02:01,494 What you will do is type "echo" 36 00:02:04,785 --> 00:02:07,281 then type in your clear text 37 00:02:07,281 --> 00:02:08,606 and simply pipe it over 38 00:02:08,606 --> 00:02:12,773 to the SHA256SUM command. 39 00:02:14,849 --> 00:02:16,595 And we can see here 40 00:02:16,595 --> 00:02:20,552 it spits out a long set of characters 41 00:02:20,552 --> 00:02:25,080 that are hash of the clear text word "pearson". 42 00:02:25,080 --> 00:02:28,830 If we run it again, we see its the same hash. 43 00:02:29,787 --> 00:02:32,889 This is the way that hashing algorithm works. 44 00:02:32,889 --> 00:02:36,244 It should always be the same unless it was modified. 45 00:02:36,244 --> 00:02:38,327 So if we were to, 46 00:02:39,313 --> 00:02:42,313 say, add a "1" to "pearson", 47 00:02:43,175 --> 00:02:46,274 and run it through again, the hash should change. 48 00:02:46,274 --> 00:02:49,711 As you can imagine, this is how hashing can be used 49 00:02:49,711 --> 00:02:53,878 for things like email integrity validation.