Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- c = 1956942023526523970744423255238565279953053537849892520263120007678542974096205611303496959200283784731226548363856727940831238900629946949747803165191977
- n = 17126318245090514703429558427647141783523669569239864041729162482128718579429837594937854393266151037934555893558192379253079897636569420534481085270271271
- def isPrintable(num):
- global posTexts
- global e
- #print(e)
- pairs = []
- strRes = ""
- while num > 0:
- pairs.append(num % 100)
- num //= 100
- if 33 <= pairs[-1] <= 127:
- return False
- strRes = "".join([chr(ch) for ch in pairs[::-1]])
- print(strRes, e)
- posTexts.append(strRes)
- return True
- posTexts = []
- t = math.ceil(math.sqrt(n))
- for e in range(2, t):
- m = c ** e % n
- isPrintable(m)
- fout = open("RSA_res.txt", 'w')
- for raw in posTexts:
- fout.write(raw)
- fout.close()
Advertisement
Add Comment
Please, Sign In to add comment