import gmpy2 as gp import binascii p = 149127170073611271968182576751290331559018441805725310426095412837589227670757540743929865853650399839102838431507200744724939659463200158012469676979987696419050900842798225665861812331113632892438742724202916416060266581590169063867688299288985734104127632232175657352697898383441323477450658179727728908669 q = 116122992714670915381309916967490436489020001172880644167179915467021794892927977272080596641785569119134259037522388335198043152206150259103485574558816424740204736215551933482583941959994625356581201054534529395781744338631021423703171146456663432955843598548122593308782245220792018716508538497402576709461 e = 0x10001 c = 10529481867532520034258056773864074017027019578041866245400647840230251661652999709715919620810933437191661180003295923273655675729588558899592524235622728816065501918076120812236580344991140980991532347991252705288633014913479970610056845543523591324177567061948922552275235486615514913932125436543991642607028689762693617305246716492783116813070355512606971626645594961850567586340389705821314842096465631886812281289843132258131809773797777049358789182212570606252509790830994263132020094153646296793522975632191912463919898988349282284972919932761952603379733234575351624039162440021940592552768579639977713099971
n = p*q phi = (p-1)*(q-1) d = gp.invert(e,phi) m = pow(c,d,n) print(m) print(bytes.fromhex(hex(m)[2:]))
ezMath
attachment.py
from Crypto.Util.number import * from Crypto.Cipher import AES import random,string x = 3058389164815894335086675882217709431950420307140756009821362546111334285928768064662409120517323199 y = 9037815138660369922198555785216162916412331641365948545459353586895717702576049626533527779108680 enc=b"\xce\xf1\x94\x84\xe9m\x88\x04\xcb\x9ad\x9e\x08b\xbf\x8b\xd3\r\xe2\x81\x17g\x9c\xd7\x10\x19\x1a\xa6\xc3\x9d\xde\xe7\xe0h\xed/\x00\x95tz)1\\\t8:\xb1,U\xfe\xdec\xf2h\xab`\xe5'\x93\xf8\xde\xb2\x9a\x9a"
defpell_minimum_solution(n): a = [] m = floor(sqrt(n)) sq = sqrt(n) a.append(m) b = m c = 1 i = 1 while a[i-1] != 2 * a[0]: c = (n - b * b) / c tmp = (sq + b) / c a.append(floor(tmp)) i += 1 b = a[i-1] * c - b p = 1 q = 0 for j inrange(i-2,-1,-1): t = p p = q + p * a[j] q = t if (i-1) % 2 == 0: x0 = p y0 = q else: x0 = 2 * p ** 2 + 1 y0 = 2 * p * q return x0,y0
print(pell_minimum_solution(114514))
from Crypto.Util.number import * from Crypto.Cipher import AES import random,string x = 3058389164815894335086675882217709431950420307140756009821362546111334285928768064662409120517323199 y = 9037815138660369922198555785216162916412331641365948545459353586895717702576049626533527779108680 enc=b"\xce\xf1\x94\x84\xe9m\x88\x04\xcb\x9ad\x9e\x08b\xbf\x8b\xd3\r\xe2\x81\x17g\x9c\xd7\x10\x19\x1a\xa6\xc3\x9d\xde\xe7\xe0h\xed/\x00\x95tz)1\\\t8:\xb1,U\xfe\xdec\xf2h\xab`\xe5'\x93\xf8\xde\xb2\x9a\x9a"