Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RSA decryption using only n e and c

Tags:

rsa

encryption

I need to decrypt c and I was given only n, e and c and computing p and q or phi(n) would be close to impossible so what other alternatives do I have? I tried calculating p and q but I made very little progress with the search in the last 24 hours of continuous running the program.
These are the values I was given:
n: 58900433780152059829684181006276669633073820320761216330291745734792546625247
e: 65537
c: 56191946659070299323432594589209132754159316947267240359739328886944131258862

Also, in another challenge only c and n were given and the values were a lot bigger. Do you have any suggestions for that too?

like image 823
Teodor Vecerdi Avatar asked Apr 17 '18 12:04

Teodor Vecerdi


People also ask

How do I decrypt RSA ciphertext?

To decrypt a ciphertext C using an RSA public key we simply compute the plaintext M as: M = Cd mod N. Note that both RSA encryption and RSA decryption involve a modular exponentiation and so we would be well advised to use the Repeated Squares Algorithm if we want to make these processes reasonably efficient.

What is C n e in RSA?

For RSA encryption, the numbers n and e are called public keys. The (numeric) message is decomposed into numbers (less than n ), for each number M the encrypted (numeric) message C is C≡Me(modn)

What is the decryption formula in RSA algorithm?

RSA algorithm uses the following procedure to generate public and private keys: Select two large prime numbers, p and q. Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption. If n = p x q, then the public key is <e, n>.


2 Answers

Well, seems the questions are CTF related because the patterns of n, e, and c are weak numbers.

You can solved it with RsaCtfTool

python RsaCtfTool -n 58900433780152059829684181006276669633073820320761216330291745734792546625247 -e 65537 --uncipher 56191946659070299323432594589209132754159316947267240359739328886944131258862

timctf{CENSORED}

like image 58
Dwi Mulia Mokoginta Avatar answered Sep 22 '22 10:09

Dwi Mulia Mokoginta


https://www.dcode.fr/rsa-cipher Try this one but it need p and q. So I use the hand calculator to find p and q. Using Fact(n), ex: Fact(91)= 7x13, so p=7, q=13

like image 37
Lê Thị Quỳnh Hương Avatar answered Sep 22 '22 10:09

Lê Thị Quỳnh Hương