 Hello YouTube, this is a video write-up for the challenge baby crypto from the cryptography category of seesaw 2018 So the challenge prompt here is yeet Single yeet yeeted with single yeet is equal to zero yeet. What is yeet? Yeet is yeet. Yeet date yeeted yeet at yeet 942 p.m. I hope you guys like that sound bite Maybe you could just have a a loop of me saying yeets or whatever. So This is weird, right? We were given a file to download here, which you can copy the link and wget if you particularly want I do have it already downloaded. So it's just in my current directory here We can just cat it out and it looks like base 64 So we'll have to decode that and work with whatever ciphertext that we're dealing with But this challenge prompt is stupid and cryptic crypto whatever It says single yeet yeeted with single yeet is equal to zero That's the only kind of footing that I had here and the inkling that maybe this is x or Maybe that's okay like typical crypto challenge baby crypto Maybe that's just a simple simplistic solution that we may go or yield to is is x or Exclusive or and we've covered this in the tour of x86 and that if you x or something with itself or single yeet Yeeted with single yeet x or single something x or with single something is going to equal zero Maybe this is a single byte x or so let's go ahead and play with it and work with it What I'm gonna end up doing is just several ape dot pi. I'm gonna put this in a Script here user bin environment Python We can go ahead and use a context manager because people tell me that I should do that with ciphertext dot text as Handle we can say cipher can equal handle read and we can print out that cipher cool So if we wanted to we could go ahead and decode this with base 64 64 not three and We have all this information here. So this is our real cipher now, but it's raw bytes So what are we gonna do with it? Well, let's try and do a single byte x or so what I did was I ended up using a The poem library because that's awesome and you can just say let's do for I in range And when I did this originally I went for I in range of 255 you may notice my mistake in this But I want to just showcase my thought process and where I was going with this So the obvious if you know the solution to this This is a bad thing going from 255, but I'll show you let's go ahead and check it out Let's go ahead and poem dot x or the cipher with the current I or the byte that we're looking at And let's just go ahead and print that out I'm gonna do this in the command line. So we don't just explode sublime Let's run Python 8 and then we get a bunch of stuff. That's very not okay to read So let's pipe this to strings and see if we get anything worthwhile I'm gonna less through this so I can work through some things and you can scroll through There's a lot of garbage data in here, right? Eventually we get to what looks like English letters and if we keep scrolling down we can find something particularly here eventually I Promise okay cool. It says Leon programmer aspires create programs that help people less once so we know we're getting English Or we know we potentially have a hit as to what this could be so what I did at this point is I tested if programs is in Let's say like message can equal this if it's in message. Let's go ahead and print out The eye that we're working on and then the message that we have to work with and let's just return break out of the program so immediately we can go ahead and Ape pie we will just go ahead and run exit not return. So now it says This happened all with two two three That was the index that was a bite that we worked with it says Leon is a programmer who aspires But we have a lot of null bites in here and you can see the flag is the very very end But it says Diffie Hellman crap Blah blah blah with more random bites at the very very end. So for a little bit of time I genuinely thought this was the flag. I genuinely tried to Correct those strange bites and munch something that I could submit But I asked around the IRC and they told me like no, that's it's actually in the real flag format So I'm an idiot whatever figured I'd play with it for a little bit But then what I thought was that oh I can assume this is supposed to be in regular English So what I'm going to do is I'm actually just gonna go ahead and cipher or take take an X or of our cipher with Pwn dot X or Cypher with what we know the first part of the Actual I'm sorry. Yeah, the actual message should be so we know that should be Leon in Capital L and then lowercase space is following that let's just let's just see what we have here It looks like at the very start of it. We have X FF X FF. So the last bite or 255 In when we're counting from zero to 255 in ASCII or again bites hexadecimal zero X FF That was a horrible realization and epiphany for me and that when I went through this for loop for ion range of 255 Range is non-inclusive. So I went up to 254 I did not touch 255 so if I wanted to fix this loop I could go ahead and say for range 256 and then I could go ahead and print the message each iteration and Then you will go ahead and see when I run this at the very very end If I run strings at the very very end will have the original plain text Leon is a programmer who aspires great programs that help people blah blah blah real flag real flag in the correct format And that's what we would submit So if you wanted to you could carve that out in Python make it a real get flags or put whatever you wanted to But we could track down that zero X FF or 255 is the single byte key for this XOR So interesting thing I went through a stupid rabbit hole some hurdle that I was not smart about and didn't even realize But I thought I had a little bit of intuition where I could figure out that okay I know the text is supposed to start with Leon like Presumably in like what should look like English with regular Regular cases uppercase lowercase letters and spaces not null bytes So figured I'd go for it with the properties of XOR and we got the flag out of that cool Quick shout out to the people that support me on patreon. Thank you guys so much I cannot say this enough this list is getting longer and I have to split it up into two columns and that's crazy So please keep rocking. I it's just Blows my mind All right One dollar a month on patreon will give you a special shout out just like this at the end of every video five dollars or more Patreon will give you early access to everything that are released on YouTube before it goes live If you did like this video, please you'll like comment subscribe join our discord server link in description It's a community of CTO players programs and hackers you want to hang out with me or other cool people That's the place to do it. We'll be jamming together for seesaw red this weekend Pico CTF and other upcoming competitions and games Thanks again guys. Hope to see you on patreon. Hope to see you in the next video. Love you. Bye