 What's up, everyone? This is another video write-up for the challenge classic for 40 points in the cryptography category on TJCTF, the recent capture-to-flag competition. So this says, my primes might be close in size, but they're big enough that it shouldn't matter, right? And we're given an RSA text file, which we can check out. It gives us E, the exponent, and the modulus, and C, the ciphertext. So I'm assuming this is called classic in that it is classic RSA. We're given just an N, so we will have to try and factor that modulus to determine P and Q. So let's get started with just a script. Actually, I will go ahead and just call this ape.py. Get a shebangline moving along. So we have a script we can work with. Let's paste in these variables here. And now let's try and figure out how we can factor N. So my go-to was to go to just factoredb.com. And when I had tried this, I was not able to actually get any factors here. They literally didn't exist when I solved this challenge. It looks like they are visible now, so we can go ahead and snag them. Let's put them in there as P equals this, and then Q equals this. So when I found these and they weren't in factoredb, I was actually trying to poke around and props to the people that was working on this challenge with in the Discord server. So if you aren't in our Discord server, you should totally check it out. But props to Vic Frank who had passed along this link, and that actually was able to track down the factorization of N. So if I actually just peel that back from the source code here, we can paste this in, and it will factor that out, and it'll give us all of these numbers that we could just go ahead and escape, remove all the spaces, and you can see that is just simply P right there. Oh, actually, after I... Did I just take that N? I forget where I grabbed. Yeah. Okay, so the factor starts here because N is over there. It displays that out first, so not entirely needed, but we can cut those out, and then if we pasted that along, okay, you can see that right below that line is P. So that was the factor that I had found and props to, again, Vic Frank for finding that for us. Now that we have P and Q, we can calculate phi just by simply P minus one times Q minus one, and then we can go through our typical RSA, the classic RSA process here to decrypt. Holy cow, I can't type, holy cow. Let's get the inverse function so we can figure out D as the inverse of E phi, and now we can get M as C raised to D all mod N, and we can print out M. Great. So let's get that as X to the negative one. Oh, I don't know why P minus one was pasted in there, but now we can decode that as X, and we have our flag just like that. Cool. Thank you guys for watching. Hope you enjoyed this. We can save this as a get flag script. Go ahead and save that output to a new flag dot text if you particularly wanted to, and we can go ahead and mark that challenge as solved. So classic RSA, just going through the steps that I should have covered in another video, but that is simply once you have the factor of N, P and Q, you are awesome and can go through to tack down the modular inverse, get phi, get D, and then go ahead and decrypt that. So, all right. Hey, I want to give a special shout out to the people that support me on Patreon. You guys are fantastic. I say it every time because there's no other way I could say thank you enough. One dollar a month on Patreon will give you a special shout out just like this. Five dollars or more on Patreon will give you early access to every video that I release on YouTube before it is gone live and deployed. Hey, if you like this video, you want to see more capture the flag video write ups, other program tutorials and stuff that I do, please do like, comment, and subscribe. Join our Discord server if you haven't already. Again, that is an awesome community full of CTF players, programmers, hackers. So if you want to join me or some other cool people in an upcoming game is going on, please do check that out. Also, it'd be fantastic to see you on Patreon, but I hope to see you in another video. Thanks.