 What is going on, everybody? My name is John Hammond. Welcome back from the YouTube video. We're looking at boot to root CTF. Moving into the cryptography category, this is the challenge because RSA is love. And it just gives us this prompt for RSA.txt. So I would copy link and download it if I had W get accessible to me, except it's a stupid Google doc. So we're just going to work with that. We can go ahead and actually create a.py for this. I'm going to crank this up in some blind text. You can see a little bit better. User bin, environment, Python, et cetera, et cetera. We'll paste these in because we have the variables that we need here. So I have done many videos on RSA. You can track another one, especially when we cover it in Pico. There's a little bit more there that actually discusses how it's happening, how it happens behind the scenes. You look at the Wikipedia article, you look at the math, et cetera. But in this case, we know what we're going to do and I'm just going to run through the process of doing it because that's what RSA practically is. Once you know it, it's like, okay, there are a couple of variations, there are a couple of tricks, but the classic RSA is quick and easy to run through. So we have N and if we can check out factor DB, if we have that accessible, I'm trying to actually F11 there and move out of this page, but it's taking some time. Hang on. So factor DB will paste in that N and we've got PNQ there. If that didn't have it, which I think originally when we tried this challenge, the PNQ weren't present, you can run the RSA CTF tool on it and that's available on GitHub and around. So I don't know why that's not giving me the full value. That's kind of annoying. Three to the power of 178 times 22. Let's put that in there and see if it goes. And this one also that will give me the value. That's very weird, whatever, Q. Okay, so now I've got PNQ and we can determine fee, right, or the totem. So because PNQ are both primes, the property allows us to find fee as just P minus one times Q minus one, and that's simple and easy. So now we can go ahead and do the modular inverse to determine D. So I'm going to do this with from crypto, util dot number, import inverse, and I believe it's D equals inverse E phi. I'm pretty sure I might have that the other way around. But do we have D? Does that work for us? We do have D. All right. So we can now go ahead and try and calculate M because now that we have the private key D, we should be able to raise C to the power of D all mod N. And that should be M. So we can go ahead and say M as a number. Now let's go ahead and make that hex. So let's hex, hex that. Okay, and that looks like regular readable characters, hopefully, to negative one. So that's all cut off. And then we can go ahead and decode that. So let's decode hex. And no, if we print needs to work, maybe I had print, heck, yeah, let's just remove our parentheses, because that's annoying. And I forgot to put hex in that in strings. There we go, boot to root RSA can be vulnerable. So that should be the flag. And that's very, very simple. Just know the procedure classic RSA and you can crank out the flag. No, I had to do that off top. Your head is pretty good. I don't think there are too many steps in RSA. And oftentimes, once you've got it down pat, you can just kind of hit the I believe button there. So boot to root RSA can be vulnerable. That is the flag. Let's go ahead and submit it. And 50 points on the table. Great. Thank you guys so much for watching. If you like this video, please do like comment and subscribe. Join the discord server. There is a link in the description. It is a really cool place because it has a ton of smart people way smarter than me. And we're all willing to tackle a capital flag challenge. We're all about learning. It's all about cybersecurity. It's cool. It's cool. And classic shout out to R4J because he tackled this before I did. It's just original RSA challenge, but I know he just jumps in and I'm grateful for those that are willing to kind of tackle these with you. You're all part of the community. You're all part of the family. And thank you. See you later, everybody.