Jarvis OJ Crypto RSA Series

Jarvis OJ

veryeasyRSA (RSA Decryption Algorithm)

Solution

Since pp and qq are given, we could decrypt the message directly with the RSA decryption algorithm.

Implementation

Easy RSA (Small Modulus)

Solution

The prime factors of modulus NN can be easily found with FactorDB . To simplify this process, we could use the factordb-python module.

Implementation

Medium RSA (Wiener's Attack)

Solution

Note that the ee is really large. This is an indication for Wiener's Attack. However, this challenge is even simpler than that: FactorDB knows the prime factors of NN.

Implementation

hard RSA (Rabin Cryptosystem)

Solution

We got e=2e = 2 in this challenge. There are two possibilities here:

  1. The message is much smaller than the modulus, so we can simply compute m = sympy.root(c, 2).

  2. This is a Rabin cryptosystem.

This challenge falls into category 2.

Implementation

very hard RSA (Common Modulus)

Code Review

Solution

Take a look at this snippet:

Note that same modulus NN is used twice. Moreover, e1e_1 and e2e_2 are coprime, so this challenge falls into the "common modulus attack" category.

Implementation

Extremely hard RSA (Low Public Exponent Brute-forcing)

Solution

We have e=3e = 3 this time. Since the public exponent is small, brute-force attack is possible. We can try all c+kNc + k * N (where kk is an natural number) until we find a perfect cube. Then the cubic root of c+kNc + k * N is exactly the plaintext mm.

Implementation

God Like RSA

Todo!

Last updated