[system32.kr] RSA104
[system32.kr] RSA104
2020.09.28import flag p=random_prime(2**1024,2**2048) q=random_prime(2**1024,2**2048) m=int("".join(map(lambda x: "%x"%ord(x),flag.RSA104)),16) d=2 n=p*q ph=lcm(p-1,q-1) while True: if gcd(d,ph) == 1: if gcd(inverse_mod(d,ph),ph) == 1: break d=random_prime(2**32,(2**196)//3) e = inverse_mod(d,ph) c=power_mod(m,e,n) print("n : %d"%n) print("e : %d"%e) print("c : %d"%c) ''' n : 30324775617121599690386242476..