1 00:00:00,570 --> 00:00:08,470 Now, let us try and execute this Virginia hacker first, and then we would understand the program that 2 00:00:08,470 --> 00:00:09,320 we have written. 3 00:00:09,730 --> 00:00:15,910 So if we run this particular module, we get the results checked by multiple keys. 4 00:00:15,910 --> 00:00:21,460 And which is what you think that this is the other thing that you have the encrypted text would be looking 5 00:00:21,460 --> 00:00:24,850 like after decryption, you can trace their. 6 00:00:26,210 --> 00:00:29,340 And so we'll have to run this again. 7 00:00:30,290 --> 00:00:37,840 We have made some error in entering the details, so this is all we get decrypted message. 8 00:00:38,180 --> 00:00:44,180 Now, if we understand this particular demo, the first thing that we are doing is importing modules 9 00:00:44,180 --> 00:00:45,790 and setting up the main function. 10 00:00:46,070 --> 00:00:51,830 So the source code in our VIGENIN hacking program, we import many different modules, including a new 11 00:00:51,830 --> 00:00:58,850 module that is named ITER Tools here, which we will see just about after we complete this particular 12 00:00:58,850 --> 00:00:59,240 session. 13 00:00:59,690 --> 00:01:07,490 Now, in addition to this, we have set up several constants on this particular program, which we would 14 00:01:07,490 --> 00:01:10,430 be learning about those in a few moment. 15 00:01:10,910 --> 00:01:15,560 And in the main function of the hacking program, which is similar to our previous hacking programs 16 00:01:15,560 --> 00:01:16,310 that we have done. 17 00:01:17,030 --> 00:01:25,280 Now, if you'll see this ciphertext is passed on to the hack Virginia function over here, which either 18 00:01:25,290 --> 00:01:30,740 returns the decrypted string if they had successful or non-value if the hack fails. 19 00:01:31,100 --> 00:01:36,660 So if successful, the program princi hacked message to the screen and copies it to the clipboard. 20 00:01:37,280 --> 00:01:40,810 Now we move on to finding the repeater sequences. 21 00:01:41,150 --> 00:01:47,270 So we have here the next function that is find repeat sequences space's function. 22 00:01:47,930 --> 00:01:54,950 Now, this accomplishes the fourth step of our kazatsky examination by locating all the repeater sequences 23 00:01:54,950 --> 00:01:59,930 of letters in the message string and counting the spaces between the sequences. 24 00:02:00,560 --> 00:02:10,370 And then we convert the given message to uppercase using this method here and remove any known little 25 00:02:10,370 --> 00:02:16,070 characters from message using the sub function, which is a regular expression method. 26 00:02:16,160 --> 00:02:23,540 Then we have this Acuil Space's, which is a dictionary that holds repeated sequence string as its key 27 00:02:23,540 --> 00:02:29,630 and the list with integers representing the number of letters between all the occurrences of that sequence 28 00:02:29,630 --> 00:02:30,680 and its values. 29 00:02:31,130 --> 00:02:39,560 So the for loop after which checks whether each sequence repeats by finding the sequences in the message. 30 00:02:39,560 --> 00:02:44,600 That is the length of the message and calculating the spaces between the repeated sequences. 31 00:02:45,200 --> 00:02:52,010 That is all about our default loop that we have in this particular function, not on the first iteration 32 00:02:52,460 --> 00:02:53,030 of the loop. 33 00:02:53,030 --> 00:02:59,510 The Goldfine sequences that are exactly three characters long and on the next iteration it finds the 34 00:02:59,510 --> 00:03:03,240 sequences exactly four letters long and then five letters long. 35 00:03:03,560 --> 00:03:10,520 So you can change what sequence length the code searches by modifying the range, say three comma six. 36 00:03:11,100 --> 00:03:17,380 However, finding repeated sequences of letters three, four, five seems to work for most of the ciphertext. 37 00:03:17,810 --> 00:03:24,600 The reason is that these are long enough that repeats are unlikely to be found and the sequence length 38 00:03:24,600 --> 00:03:28,970 of the for loop is currently checking a stone in situ alien variable. 39 00:03:29,570 --> 00:03:37,580 Now if we go ahead, we see we have here the for loop inside the another for loop, then set the variable 40 00:03:37,580 --> 00:03:41,660 AI to be the index of every possible sequence of length. 41 00:03:41,660 --> 00:03:43,430 That is a secure line in the message. 42 00:03:43,850 --> 00:03:52,880 And these indexes start at these Ezekial Start plus the length, which is the last index where the sequence 43 00:03:52,880 --> 00:03:54,330 of length can be found. 44 00:03:54,650 --> 00:04:01,520 So for example, if the message was particularly found, I'd say the sequence was 11 and the sequence 45 00:04:01,520 --> 00:04:02,430 length was three. 46 00:04:02,660 --> 00:04:05,440 Then you would have the execute to survive. 47 00:04:05,450 --> 00:04:10,730 And for example, the follow up would begin looking at the message starting from, again, index number 48 00:04:10,730 --> 00:04:11,150 fourteen. 49 00:04:11,660 --> 00:04:15,320 Now, if we just move ahead, we have the next step. 50 00:04:15,320 --> 00:04:16,850 That is we are checking over here. 51 00:04:16,850 --> 00:04:22,580 If sequence, not in the sequence spacing, then sequence spacing at the index of sequence is equal 52 00:04:22,580 --> 00:04:27,140 to blank and saying sequence spacing and the next subsequent start up. 53 00:04:27,170 --> 00:04:33,320 And so over here we basically check whether the sequence variable exists as a key in the sequence missing. 54 00:04:33,350 --> 00:04:39,260 And if not, then sequence spacing sequence is the set as the key with the blacklist and its values 55 00:04:39,440 --> 00:04:45,890 and number of letters between the sequences and the message I call Michael and I plus sequence length 56 00:04:45,890 --> 00:04:47,090 and the original sequence. 57 00:04:47,090 --> 00:04:50,240 That message is simply ie minus the sequence start. 58 00:04:50,600 --> 00:04:56,570 So notice that I am the sequence start at the beginning in the axis before the call is so the integer 59 00:04:56,570 --> 00:05:02,180 that I'm minus sequence starts evaluate two is the number of letters between the two sequences which 60 00:05:02,180 --> 00:05:06,900 we open to the list stored in sequence spacing at the index of sequence. 61 00:05:07,310 --> 00:05:14,000 Now when all these four loops have finished, the sequence spacing dictionary should contain every repeat 62 00:05:14,000 --> 00:05:20,000 the sequence of the length of three, four and five, as well as number of letters between the repeated 63 00:05:20,000 --> 00:05:20,720 sequences. 64 00:05:21,020 --> 00:05:25,180 So the sequence spacing dictionary is written from the particular function find. 65 00:05:25,250 --> 00:05:26,970 Repeat sequence, specific function. 66 00:05:27,470 --> 00:05:33,260 So once we do this written statement, we end this function and now that we have seen how the program 67 00:05:33,260 --> 00:05:39,410 performs the full step of the Kosofsky examination by finding the repeated sequences in the ciphertext 68 00:05:39,590 --> 00:05:42,080 and then counting the number of letters between them.