1 00:00:00,560 --> 00:00:07,610 Welcome to the next session in our python hacking course that is encrypting with the transposition cipher. 2 00:00:08,120 --> 00:00:13,940 Now, we have seen Cesar Saiful and we have also seen that it is not more secure or the most secure 3 00:00:13,940 --> 00:00:14,270 one. 4 00:00:14,570 --> 00:00:19,280 It doesn't take much of a computer to brute force through all the possible keys. 5 00:00:19,970 --> 00:00:26,270 The transposition cipher, on the other hand, is more difficult to brute force because the number of 6 00:00:26,270 --> 00:00:29,300 possible keys depends on the message length. 7 00:00:29,810 --> 00:00:33,520 Now there are many different types of transposition cipher. 8 00:00:33,530 --> 00:00:42,290 If you look at it now, those different types basically includes the real fanciful, your Saiful, the 9 00:00:42,680 --> 00:00:44,750 disruptive transposition cipher. 10 00:00:45,080 --> 00:00:51,920 Now this particular session will be covering a simple transposition cipher, all the columnar transposition 11 00:00:51,920 --> 00:00:52,400 cipher. 12 00:00:52,930 --> 00:00:58,600 OK, so in this particular session we would be covering the topics like creating functions with def 13 00:00:58,610 --> 00:01:03,410 statements, arguments and parameters, variables in global and the local scoop's. 14 00:01:03,740 --> 00:01:05,000 What is main function? 15 00:01:05,000 --> 00:01:12,020 The list data types, similarities in the list and strings list of list coming to argument and assignment 16 00:01:12,020 --> 00:01:17,410 operators using the joint string matau return values and the written statement. 17 00:01:17,420 --> 00:01:19,470 And finally, the name variable. 18 00:01:20,030 --> 00:01:23,990 Now we will first of all look at how the transposition cipher will. 19 00:01:24,560 --> 00:01:31,510 Now, instead of substituting characters with other characters, the transposition cipher rearranges 20 00:01:31,520 --> 00:01:37,270 the messages symbols into an order that makes the original message unreadable. 21 00:01:37,670 --> 00:01:45,480 Now, because each GUI creates a different ordering or permutation of the characters and script analyst 22 00:01:45,500 --> 00:01:50,720 doesn't know how to rearrange these ciphertext back into the original message. 23 00:01:51,080 --> 00:01:58,580 Now, some steps for encrypting with the transposition cipher are Faustus count the number of characters 24 00:01:58,580 --> 00:02:04,430 in a message and the key second is you will draw a roll off a number of boxes equal to the key. 25 00:02:04,430 --> 00:02:07,740 For example, eight boxes for key of eight or something like that. 26 00:02:08,330 --> 00:02:12,200 Next is start filling in the boxes from left to right and wrong. 27 00:02:12,200 --> 00:02:13,700 One character PO box. 28 00:02:14,090 --> 00:02:18,170 Fourth is when you run out of boxes but still have more characters. 29 00:02:18,170 --> 00:02:25,430 Add another roll of the boxes next year when you reach the last character shared in the unused boxes 30 00:02:25,430 --> 00:02:31,600 in the last row and starting from the top left and going down each column, write out characters. 31 00:02:31,760 --> 00:02:39,110 When you get to the bottom of a column, move to the next column in the right, skip any boxes of any, 32 00:02:39,380 --> 00:02:42,680 and this will be your ciphertext, which is encrypted. 33 00:02:42,950 --> 00:02:50,240 Now, just to show you how this basically steps work in practice, we will encrypt the message by manually 34 00:02:50,240 --> 00:02:56,220 and then we will translate the process into a particular program, not encrypting a message manually. 35 00:02:56,480 --> 00:03:03,350 Now, before we start writing, the code will first walk out on a simple paper or your will you will 36 00:03:03,350 --> 00:03:06,010 say, for example, a notepad for doing that. 37 00:03:07,070 --> 00:03:11,510 Now, instead of a notepad, we will use your Excel, which would be easy for us because we already 38 00:03:11,510 --> 00:03:13,010 have the column in a format that. 39 00:03:13,490 --> 00:03:16,970 Now, let us take one particular example, for example. 40 00:03:17,810 --> 00:03:25,880 So now let us take the text, something like Biton hacking Paul's message. 41 00:03:26,540 --> 00:03:32,210 Now, over here, we will take, for example, the key as the aid in this case. 42 00:03:32,420 --> 00:03:37,970 Now, the range of the possible keys for this type of cipher is from two the half of the message. 43 00:03:38,510 --> 00:03:39,900 Now, what is the message size? 44 00:03:39,920 --> 00:03:46,610 If you just look at this, one, two, three, four, five, six, seven, eight, nine, 10, 11, 45 00:03:46,610 --> 00:03:56,990 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 to 23, 24, 25, 26, 27, 28, 29, 30, including 46 00:03:56,990 --> 00:03:57,800 all the characters. 47 00:03:58,040 --> 00:04:02,780 So the range of the possible keys would be over your from to fill half of the messages. 48 00:04:02,780 --> 00:04:03,660 That is still 15. 49 00:04:03,680 --> 00:04:06,260 So we have used over your digits eight. 50 00:04:06,470 --> 00:04:10,070 But the longer the message you have, the more keys are possible. 51 00:04:10,640 --> 00:04:17,090 Now encrypting the entire particular paragraph, you can say using the column in a strong position would 52 00:04:17,090 --> 00:04:19,880 allow you to use thousands of possible keys. 53 00:04:20,300 --> 00:04:25,640 OK, now what we'll do is first thing will create an eight boxes in a particular room. 54 00:04:26,060 --> 00:04:30,590 Now let's take four, five, six, seven, eight, eight, OK? 55 00:04:30,890 --> 00:04:37,040 We'll just make it in a border type so that, you know, it is easy for us to understand and let us 56 00:04:37,040 --> 00:04:40,250 increase the size of the boxes. 57 00:04:41,370 --> 00:04:42,480 Each boxer's. 58 00:04:50,040 --> 00:04:55,960 Let's remove this that's not required, even this one not required. 59 00:04:57,740 --> 00:05:04,630 We can decrease this, so now we have three, four, five, six, seven, eight, OK, fine. 60 00:05:08,860 --> 00:05:10,270 All should be visible enough. 61 00:05:11,500 --> 00:05:17,590 Properly, let's cut and we pasted here so that even this could be removed. 62 00:05:18,130 --> 00:05:18,730 So now. 63 00:05:20,600 --> 00:05:28,790 Let's make this trip and even all these boxes also will make it refixed now after we have done this, 64 00:05:28,790 --> 00:05:31,580 we have the eight boxes which we have created. 65 00:05:31,820 --> 00:05:37,700 Now, the second step is to start writing the message you want to encrypt into the boxes, placing one 66 00:05:37,700 --> 00:05:39,260 character into each box. 67 00:05:39,470 --> 00:05:43,490 So, for example, now you start writing one, one character, 68 00:05:47,570 --> 00:05:50,510 not even a space that you have. 69 00:05:50,750 --> 00:05:53,820 We are indicating over here with the particular symbol. 70 00:05:54,020 --> 00:05:56,990 So let's insert here a particular symbol. 71 00:06:01,250 --> 00:06:05,570 Let's unleash some special characters. 72 00:06:12,120 --> 00:06:13,870 OK, so here we have the symbol. 73 00:06:14,280 --> 00:06:21,350 Now let's place that symbol over here and again, we will continue for one more has been done. 74 00:06:22,510 --> 00:06:26,710 Now, this particular rule has ended, so now we want another rule below. 75 00:06:27,130 --> 00:06:28,390 So let's take this. 76 00:06:28,570 --> 00:06:30,640 And again. 77 00:06:32,120 --> 00:06:36,360 Let's make it the same formatting and again, start writing here. 78 00:06:36,440 --> 00:06:47,200 So we had reached in H, e, c, g, i, n, g and again here, let's cooperate it on the same symbol 79 00:06:47,600 --> 00:06:48,020 C. 80 00:06:49,120 --> 00:06:58,000 Now, again, we require another rule below, let's take down and do the same thing nowadays, fool, 81 00:06:58,270 --> 00:07:01,780 you are s e again. 82 00:07:01,780 --> 00:07:08,500 We require all space and then M e and the last one we will require. 83 00:07:10,090 --> 00:07:14,870 S s e g, e and dot. 84 00:07:15,340 --> 00:07:16,990 So let's take a little less. 85 00:07:18,370 --> 00:07:19,180 And. 86 00:07:20,360 --> 00:07:21,740 Let's call it on the floor. 87 00:07:22,180 --> 00:07:29,490 OK, so after this, let's write down here, so we have written this particular way. 88 00:07:29,930 --> 00:07:32,870 OK, and last thing that we have is a dot. 89 00:07:32,870 --> 00:07:39,680 So we have even written that the only space is we have stimulated that with a particular symbol. 90 00:07:39,870 --> 00:07:41,390 OK, now. 91 00:07:43,030 --> 00:07:46,810 Just to make it more meaningful, we will increase the. 92 00:07:48,050 --> 00:07:48,820 Foreign sites. 93 00:07:48,860 --> 00:07:54,440 OK, so this is all we have basically arranged it now, this store are not used. 94 00:07:54,450 --> 00:08:00,320 So over here, let us give some different background color just to highlight that we are not using this 95 00:08:00,320 --> 00:08:06,440 particular two boxes because 88 rows or columns would automatically be created. 96 00:08:06,470 --> 00:08:11,480 So we have created the last two boxes in the last row as a reminder to ignore them.