hms2010

aaa

Feb 1st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import math
  2.  
  3. c = 1956942023526523970744423255238565279953053537849892520263120007678542974096205611303496959200283784731226548363856727940831238900629946949747803165191977
  4.  
  5. n = 17126318245090514703429558427647141783523669569239864041729162482128718579429837594937854393266151037934555893558192379253079897636569420534481085270271271
  6.  
  7. def isPrintable(num):
  8.     global posTexts
  9.     global e
  10.     #print(e)
  11.  
  12.     pairs = []
  13.     strRes = ""
  14.     while num > 0:
  15.         pairs.append(num % 100)
  16.         num //= 100
  17.         if 33 <= pairs[-1] <= 127:
  18.             return False
  19.     strRes = "".join([chr(ch) for ch in pairs[::-1]])
  20.     print(strRes, e)
  21.     posTexts.append(strRes)
  22.     return True
  23.  
  24. posTexts = []
  25. t = math.ceil(math.sqrt(n))
  26. for e in range(2, t):
  27.     m = c ** e % n
  28.     isPrintable(m)
  29.  
  30. fout = open("RSA_res.txt", 'w')
  31. for raw in posTexts:
  32.     fout.write(raw)
  33. fout.close()
Advertisement
Add Comment
Please, Sign In to add comment