1 00:00:00,450 --> 00:00:06,060 Now, when the full time the program execution goes through the particular loop, the key is still set 2 00:00:06,060 --> 00:00:06,580 to zero. 3 00:00:06,960 --> 00:00:15,490 And over here, if you look at the program initially, OK, now after this, the ciphertext in the messages 4 00:00:15,490 --> 00:00:17,830 still is decrypted with the key zero. 5 00:00:18,330 --> 00:00:24,330 Now, of course, is zero, is not really your messages are just decrypts to anything else apart from 6 00:00:24,330 --> 00:00:25,590 the exact text. 7 00:00:26,100 --> 00:00:30,090 Now, the code inside the fallout of after this. 8 00:00:30,240 --> 00:00:38,280 OK, now over here is basically similar to over see the cipher program that we have done now over here 9 00:00:38,280 --> 00:00:43,350 after the next iteration, the set to one for the decryption. 10 00:00:44,280 --> 00:00:51,180 So in the first argument where the range should start, the second argument is where the range can end 11 00:00:51,180 --> 00:00:51,360 up. 12 00:00:51,600 --> 00:00:57,770 So over here, you can also give two arguments in the particular range, which will be separated by 13 00:00:57,780 --> 00:00:58,260 comma. 14 00:00:58,470 --> 00:01:05,040 Now, for example, if you want to try it out, you can go back here and let's try it out in the interactive, 15 00:01:05,040 --> 00:01:14,190 shall we say, for Iven in C range, we give your from Poolesville seven and for that we would put in 16 00:01:14,190 --> 00:01:16,240 the value of Iven. 17 00:01:17,630 --> 00:01:23,450 So we get the value from that starting point as to when it is ending at 6:00 because we have given to 18 00:01:23,450 --> 00:01:29,210 Tacoma seven, so the variable, Ivan, over here will be the value from two, which is including two 19 00:01:29,450 --> 00:01:32,870 up to the value seven, but not including seven. 20 00:01:33,650 --> 00:01:40,300 So if we move on to the decrypting the message, but again, we'll go back to our program, not over 21 00:01:40,300 --> 00:01:46,190 here, the next for Loop, where we are creating the translator D'Astier variable, which is attached 22 00:01:46,190 --> 00:01:52,920 to blank langstrom because we would want to add the values which is decrypted in the translated STF. 23 00:01:52,970 --> 00:02:00,320 OK, so over here, the currency will be added to the decrypted text in the translated Ostia from the 24 00:02:00,320 --> 00:02:08,240 last iteration in the loop, after which we have the next that is before SVM in our message. 25 00:02:08,280 --> 00:02:14,040 Still, if the symbols or if I may never see Monastir, we are finding the particular symbol values 26 00:02:14,120 --> 00:02:14,860 over here. 27 00:02:15,320 --> 00:02:20,990 We are basically looping through every symbol in this ciphertext, the string that is stored in the 28 00:02:21,000 --> 00:02:22,010 particular messages. 29 00:02:22,490 --> 00:02:28,130 So on each iteration of this loop, we are checking whether this symbol exists in December last year, 30 00:02:28,130 --> 00:02:31,580 constant variable and if so, we are decrypting it. 31 00:02:31,880 --> 00:02:39,230 OK, so then basically we subtract the USDA from our symbol indexed to decrypt it. 32 00:02:40,040 --> 00:02:46,910 Now, after this, if we just see the next call with the subtraction operation because your translated 33 00:02:47,270 --> 00:02:50,930 X to become less than zero and require us to wrap around. 34 00:02:51,200 --> 00:02:56,930 So the symbol constant when we find the position to the characters in our SYMBOLISTIC to decrypt, we 35 00:02:56,930 --> 00:02:58,070 check for this case. 36 00:02:58,380 --> 00:03:04,670 OK, and if translated is the index is less than zero over here, then it can be modified. 37 00:03:04,670 --> 00:03:12,440 So we see the translated into X is equal to the index value plus the length of over symbolistic basically 38 00:03:12,470 --> 00:03:16,610 upending the values at the end of the translated into X. 39 00:03:17,640 --> 00:03:25,500 So moving to the next one where we are seeing here that translated Asgeir is equal to translated estar 40 00:03:25,500 --> 00:03:29,130 plus the value of symbol that is a spy. 41 00:03:29,520 --> 00:03:35,670 OK, so here we are, just adding the unmodified symbol to the end of the translated Istria. 42 00:03:35,940 --> 00:03:44,580 If the value was not found by in the Stajcic, after which we are basically using the formatting or 43 00:03:44,580 --> 00:03:47,590 string formatting to display the key and the decrypted message. 44 00:03:47,850 --> 00:03:54,930 So when we are seeing your putting key value hash percentage, one percent is percentages and the value 45 00:03:54,930 --> 00:04:02,520 of the value of translated FTA, the argument over during the print function calls is a string value 46 00:04:02,790 --> 00:04:04,080 that uses this string. 47 00:04:04,080 --> 00:04:06,920 Formatting also calls your string interpolation. 48 00:04:07,380 --> 00:04:12,990 So the string formatting with percent is text places one string inside, another one. 49 00:04:13,350 --> 00:04:19,470 The forced percentages is a string gets replaced by default value in the parentheses at the end of the 50 00:04:19,470 --> 00:04:19,810 string. 51 00:04:20,100 --> 00:04:26,990 So for example, so now we can try out some string interpolation examples in the interactive shell. 52 00:04:27,420 --> 00:04:36,530 For example, if we write down over here, say hello, placenta's exclamation mark percent. 53 00:04:37,370 --> 00:04:44,690 So close this, then we write down here, see Biton and we present there. 54 00:04:44,700 --> 00:04:45,770 Hello, Python printer. 55 00:04:46,320 --> 00:04:52,290 So after Python we get the exclamation mark because here we are saying that the string should be printed. 56 00:04:52,680 --> 00:05:05,000 Similarly, if we try out something like say hello, a space, then A plus C python, then again, a 57 00:05:05,010 --> 00:05:07,150 plus an exclamation mark. 58 00:05:08,040 --> 00:05:12,370 So we are going to get the same output, but in a different way without using percentages. 59 00:05:12,750 --> 00:05:17,070 Similarly, if we see no percentage as. 60 00:05:18,320 --> 00:05:32,690 Eight, the percentage is that it the percentage is close this, then he'll be right down the values 61 00:05:32,690 --> 00:05:41,580 which we want to substitute, that is see dog got that. 62 00:05:43,110 --> 00:05:47,820 So will get the dog eat the cat that ate the rat. 63 00:05:48,080 --> 00:05:51,790 So everywhere the walls automatically get substitutive. 64 00:05:52,310 --> 00:05:52,720 Right. 65 00:05:52,850 --> 00:06:00,950 So in the first example that we have seen here, the whole spring, that is the python is inserted into 66 00:06:00,950 --> 00:06:01,480 the string. 67 00:06:01,640 --> 00:06:02,080 Hello. 68 00:06:02,690 --> 00:06:06,680 OK, it looks as though you had concatenated be part of the string. 69 00:06:06,680 --> 00:06:13,310 The four percent is with the interpolated string and the part of the string after placenta's. 70 00:06:13,520 --> 00:06:18,350 So when you interpolate multiple strings, they replace each other in the particular order. 71 00:06:18,740 --> 00:06:25,430 String formatting is often easier to type than the string concatenation using a plus operator, especially 72 00:06:25,430 --> 00:06:26,630 for large strings. 73 00:06:26,930 --> 00:06:33,710 And unlike with the string concatenation, you can also insert the long string values such as individuals 74 00:06:33,710 --> 00:06:34,510 into the string. 75 00:06:34,880 --> 00:06:43,810 For example, if you want to try it out, something like say percentage F higher percent. 76 00:06:43,820 --> 00:06:44,210 S. 77 00:06:45,580 --> 00:06:48,780 Highs and lows this year. 78 00:06:49,150 --> 00:06:59,110 I don't see John and say fifty to fifty three, so we're inserting that integer value as a spring. 79 00:06:59,720 --> 00:07:12,640 OK, or for that example we say Jon Plus C had concatenated say fifty three again concatenate. 80 00:07:14,550 --> 00:07:23,590 And end it here, you will get an error because you cannot convert an integer object to string implicitly. 81 00:07:23,970 --> 00:07:31,850 So in the first one, the 53 integer got inserted easily in the end to the string without any issues 82 00:07:31,860 --> 00:07:33,550 when we were using the interpolation. 83 00:07:33,610 --> 00:07:38,040 But what when you tried to concatenate the integer, it will give you an error. 84 00:07:38,580 --> 00:07:46,980 OK, so now if we move on to the print value that we had in our particular program of hacking through 85 00:07:46,980 --> 00:07:47,650 the cipher. 86 00:07:48,030 --> 00:07:54,820 OK, here we have used this string formatting to create a string that has values in both the key and 87 00:07:54,820 --> 00:07:56,280 the translated variables. 88 00:07:56,550 --> 00:08:02,010 OK, because the key stores and in better value, we'll string formatting to put it in a string value 89 00:08:02,280 --> 00:08:04,630 that is passed to the print command. 90 00:08:04,860 --> 00:08:11,430 Hence we will get the key value also printed as a normal string value without any errors. 91 00:08:11,890 --> 00:08:12,720 OK, that is all. 92 00:08:12,720 --> 00:08:16,170 We have created a hacking program for the cipher. 93 00:08:17,340 --> 00:08:20,740 So in this way we have seen one example of hacking losses. 94 00:08:20,790 --> 00:08:21,360 A cipher.