 Hello everyone! This is the recitation for assignment 3. I'm going to go through a brief explanation of the homework and then answer your questions if you have any. So I assume the first two part is straightforward and most of you have gone through the process of solving these two questions. But I'm going to talk a few minutes about some of the things that came to my attention that might confuse some of you. The first thing is that you should consider A is shift 0 and so B is shift 1 and so on. Another thing here is that you need to be careful about direction of your shift. For example, a shift of 3, which is represented by D, means that an A in the plain text will be shifted to D in the cipher text. Now for the process of decrypting or deciphering, it's going to be done in the reverse, which means you should do three shifts to the left. For the submission of this part, you need to consider the format that's given to you and represent the letter that shows the number of the shifts. For part two, Professor Dupay has gone through this visioner cipher and gave you an extent explanation. But what you should simply do is that you can look for repeated patterns in the cipher text and find the distance between the repeated patterns. Then you can find the factor of each distance and the one that's repeated the most is going to be probably your key size. You can validate your assumption using index of coincidence. And again for the submission, it would be the same as the previous part. The first two part was somehow our mobs, the part three. In the part three, you will have one byte key. It's somehow similar to scissor cipher, but instead of shift, Zor is used to do the encryption. It confused some of you how using Zor for encryption is done. I'm going to give you a simple example that's provided here. Imagine you have the plain text wiki, the representation of this is provided here. And here this is your one byte key that's going to use to do the encryption and decryption. Having the plain text in 8-bit s key and one bit key, you do the Zor and the final result of the encryption would be something like that. And for the decryption part, you have exactly what the output here which you do the Zor with the key that's provided to you and the result is the plain text that you have here and here. So it's pretty straightforward what's done for the encryption. The code is given to you. Here is the encrypts function that's used to encrypt each byte of plain text with a key with a one byte key. The thing is, the output of this encrypts function might not always be printable. So at base 64, encode function is used to make the result printable. Here in this example that's provided to you, you can see the test is the plain text that you have. In this example, the key is 8-0. First, the encryption function is done and as we say, because the output might not be printable, the encode function is used at the end. And the final result is this base 64 text. So for the decryption process, the first thing that you should consider to do is decoding this base 64 string. So that it gives you the actual cipher. And then having the key in this example, you can decrypt it. And here because the function was zore, the process of encryption and decryption is done with the same function. So when you get the cipher text for this part from gradest code, the thing that it gives you is exactly the base 64 encoded version of cipher text. And so you should consider decoding that to base 64 first, something that you should consider. So the definition of the key for this part, you should submit a head representation of the key, which starts with zero or something. I think the example here was clear. The key for this part is in general the same as previous part. The only difference is that in here, instead of having just one byte of the one byte key, you have longer key, the key length is longer than one. So the first step should be finding the key leg. One of the things that you should be careful about is the first step that we already talked about, which was decoding the cipher text that you get so that it gives you the actual cipher. And then you can look for repeated patterns in this cipher text. In order to do so, you can write your own program to find these patterns for you. Another method that's provided for you by the undergrads here is in a really good video was this site. You can use this site, which helps you to find the patterns. And for all of the four part of the homework, especially for additional some people who are confused, if you go through the process of decryption correctly, then you're going to get a reasonable English text. This is how you can understand you find the right key. For the submission of part four, you need to submit the SQ representation of your key. Questions? Any? Which part are you talking about so that I can answer your question? The B that's written before both the text and key, it means byte. It converts strings to byte. Let me know if I answered your question because, for example, here, one, two, one is the first byte of your key, two is second byte of your key. Yes, it's typecasting, exactly. Yeah, you can do that. Because when you decode the ciphertext that you get from Gradescope, decoded with base 64, you should try to do brute force to find the key. It could be anything like the IG that you said. So the answer was yes. But the first step for you would be finding the key link because here in part four, the key link is not one anymore. We have a key link longer than one. So in order to start, you should probably consider finding the key link and then move forward to do the brute force. You mean for finding repeated patterns? Are you talking about finding repeated patterns? How you do that? Yeah, in order to find the key link, you should look for repeated patterns and there are different methods to find repeated patterns. Like, for example, you can write your own code or if you study undergrad TA, they introduced a website, which is this one. I can copy and paste it here. You can use this one to find repeated patterns of your cipher and each hex value in the cipher is one character. For example, backslash x01 is one character. I think I'm not sure if we have an example here. This one is the key that's provided as an example in part three is one character. Yeah, you can do it in hex, but also you can do it in ASCII format or using UTF-8 as your encoding. To the best of my knowledge, it doesn't matter which way you do it. I think you can do it with hex format. I saw some question in Piazza, which people discussed doing it in ASCII or UTF-8, but you should be able to do it in hex as well. Was that clear? Yes. You're right. No problem. So you did the right thing by passing the cipher text from gradoscope to the decode function. Yeah, that's exactly what you need to do. But here in these texts, it's two characters. Yeah, it's three, but the backslash t, the j backslash t, the first character is j. The second one is backslash and the third one is t. And after that, in the string that you sent is backslash x and something, it's a hex character. I'm not sure if I get your question. If I didn't answer your question, could you try rephrasing me? Okay, because this first session is going to end in a few minutes. But if you have any questions, feel free to email me or post it on Piazza. There are a lot of people that can answer your question on Piazza. Good luck and thank you for your homework.