Saturday, February 18, 2017

Pwnerrank : RSA - Basic

Task : Challenge : Recover the original message M, use  www.factordb.com  to get p and q,  p =  15100118367560938297 q =   18238... thumbnail 1 summary
Task :
Challenge : Recover the original message M,
use www.factordb.com to get p and q, 

p = 15100118367560938297
q =  18238194893394268367

ok lets start to recover..

#! /usr/bin/env python
# Johan Wahyudi
import gmpy
p = 15100118367560938297
q = 18238194893394268367
e = 5
c = 170841202002112185870598344402287193795
n = p*q
phi = (p-1)*(q-1)
d = gmpy.invert(e,phi)
pesan = hex(pow(c,d,n))[2:]
#pesan_asli = pesan.decode("hex")
print pesan
#print pesan_asli
view raw RSA_Basic.py hosted with ❤ by GitHub

No comments

Post a Comment