Cryptography · CTF · picoCTF

Mind your Ps and Qs

Link To Solve the Labs:- https://play.picoctf.org/practice/challenge/162?category=2&page=1

If you don’t know about RSA then Below is the link to the Short and Sweet tutorial you can refer to understand RSA

https://www.tutorialspoint.com/cryptography_with_python/cryptography_with_python_understanding_rsa_algorithm.htm

Hello Everyone,

So Today we are Solving the Lab in the ‘Cryptography’ Category

All the things we are doing are in Kali Linux.

As you can see in the Screenshot of the Description

Description

In RSA, a small e value can be problematic, but what about N? Can you decrypt this? values

Thus, it is clear from the description that we have to decrypt the cypher that is provided in the “Values” file.

Let’s examine the “Values” first.

As seen in the screenshot up top, we’ve provided the three values.

C :- Cipher(Encrypted Message) 

n  :- Product of Two Prime Numbers used to Calculate Modules

e  :-  Public Exponent

Now that we know of that, we can focus on finding M(Decrypted Message) Means to Decrpt Cypher.

So Let’s Start

https://github.com/RsaCtfTool/RsaCtfTool

So, in this case, we’ll use the Python-written RsaCtfTool.

Python Must Be Installed on Your Computer or Laptop in Order to Run this tool

Command to Clone The Repository

git clone https://github.com/RsaCtfTool/RsaCtfTool.git

You can see from the List Directory that the “RsaCtfTool” Directory is present.

Let’s use the “CD RsaCtfTool” command to change directories to that directory.

We’re going to use a Python file called “RsaCtfTool.py” to decipher the cypher, as you can see in the screenshot up top.

Let’s learn how to use this tool, then. So let’s check out the Tool’s Help Menu.

Command to Display Help menu

Python RsaCtfTool.py –help

The Help Menu is shown in the screenshot above. So now Look into it

--uncipher :- uncipher a cipher

-n :- Specify the modulus.

-e :- Specify the public exponent

The three flags mentioned above can help us solve this CTF.

Let’s issue a command to finish this lab.

python RsaCtfTool.py --uncipher 861270243527190895777142537838333832920579264010533029282104230006461420086153423 -n 1311097532562595991877980619849724606784164430105441327897358800116889057763413423 -e 65537

We finally executed the above command and located the flag.

picoCTF{sma11_N_n0_g0od_13686679}

Leave a Reply

Your email address will not be published. Required fields are marked *