Home
Writeups Misc About
Marin's Secret

Marin's secret

The primes used for the modulus N is of the form 2 ^ x - 1. Such primes are called Mersenne's primes, named after French mathematician Marin Mersenne.

A quick hack for factorisation is to lookup FactorDB, as I assume the primes are studied extensively. The result from FactorDB shows two primes 222031 and 222811

Another solution involves a bit of math. Suppose the two primes used are 2a1 and 2b1, and ab. We thus have:

n=(2a1)(2b1)=2a+b2a2b+1=2a(2b2ba1)+1

Thus, we have:

n1=2a(2b2ba1)

We thus can divide n1 by 2 until the result is odd. We can divide n1 by that odd result to obtain 2a. Recovering p,q should be trivial after this.

Python Implementation: