Crypto -Truly Symmetric RSA

I just realized that it doesn't make sense for people without the key to be able to encrypt messages, so I fixed that. -w0152

Challenge

#!/usr/bin/env python3
from Crypto.Util.number import long_to_bytes as ltb, bytes_to_long as btl, getPrime

p = getPrime(1536)
q = getPrime(1024)

n = p*q

e = p
with open("flag.txt", "rb") as f:
	PT = f.read()
CT = pow(btl(PT), e, n)
print(f"{len(PT) = }")
print(f"{CT = }")
print(f"{n = }")

I felt that this part was harder than the previous one, yet it had 4 more solves. factordb :(

We are given the length of the plaintext, CT and the modulus. I initially wasted a lot of time thinking its an unbalanced primes question.

From Fermat's Little Theorem, we have

ap=a(modp)a^{p} = a \pmod p

Let

f(x)=x CTf(x) = x \ - CT

Then can use coppersmith's theorem to find the roots of the equation mod p

We set the bounds to be 8*len(PT) and beta to be approximately log(n,p)

Last updated