import base64 f = open("What1s7his.txt","r") data = f.readlines() f.close() printord('N'),ord('C'),ord('T')
for i in data: str='' for j in i: str+=j if j=='=': break a=0 for j in base64.b64decode(str): iford(j)<=126andord(j)>=32: a+=1 if a==32: print base64.b64decode(str)
Crypto
Keyboard
ooo yyy ii w uuu ee uuuu yyy uuuu y w uuu i i rr w i i rr rrr uuuu rrr uuuu t ii uuuu i w u rrr ee www ee yyy eee www w tt ee
都是26键第一行字母,和上面数字对应
q-1 w-2 e-3 r-4 t-5 y-6 u-7 i-8 o-9 p-0
9键对应过去
y 999 o 666 u 88 a 2 r 777 e 33 s 7777 o 666 s 7777
m 6 a 2 r 777 t 8 t 8 h 44 a 2 t 8 t 8 h 44 i 444
s 7777 i 444 s 7777 j 5 u 88 s 7777 t 8 a 2 p 7 i 444
from Crypto.Util.number import * import gmpy2 import binascii a = 0 b=[] f=[2,2,2,2,2,2,3,5,7,7,29,31,61,101,33871,91781,112939] e = 0x10001 d = 19275778946037899718035455438175509175723911466127462154506916564101519923603308900331427601983476886255849200332374081996442976307058597390881168155862238533018621944733299208108185814179466844504468163200369996564265921022888670062554504758512453217434777820468049494313818291727050400752551716550403647148197148884408264686846693842118387217753516963449753809860354047619256787869400297858568139700396567519469825398575103885487624463424429913017729585620877168171603444111464692841379661112075123399343270610272287865200880398193573260848268633461983435015031227070217852728240847398084414687146397303110709214913 c = 5382723168073828110696168558294206681757991149022777821127563301413483223874527233300721180839298617076705685041174247415826157096583055069337393987892262764211225227035880754417457056723909135525244957935906902665679777101130111392780237502928656225705262431431953003520093932924375902111280077255205118217436744112064069429678632923259898627997145803892753989255615273140300021040654505901442787810653626524305706316663169341797205752938755590056568986738227803487467274114398257187962140796551136220532809687606867385639367743705527511680719955380746377631156468689844150878381460560990755652899449340045313521804
defdfs(i,s): if(i==16): global a if(s<120000): b.append(s) a +=1 if(s*f[i]<120000): b.append(s*f[i]) a +=1 else: dfs(i+1,s) dfs(i+1,s*f[i])
defnextPrime(n): n += 2if n & 1else1 whilenot isPrime(n): n += 2 return n
x = e * d - 1 dfs(0,1) for j inrange(a): xx = x // b[j] for i inrange(0,2000): xxx = xx + i * i if(gmpy2.iroot(xxx,2)[1]==1): p=gmpy2.iroot(xxx,2)[0] - i + 1 q = nextPrime(p) n=p*q m = pow(c,d,n) m_hex = hex(m)[2:] print((binascii.a2b_hex(m_hex)))
from Crypto.Util.number import * import gmpy2 import binascii import fractions
n = 32849718197337581823002243717057659218502519004386996660885100592872201948834155543125924395614928962750579667346279456710633774501407292473006312537723894221717638059058796679686953564471994009285384798450493756900459225040360430847240975678450171551048783818642467506711424027848778367427338647282428667393241157151675410661015044633282064056800913282016363415202171926089293431012379261585078566301060173689328363696699811123592090204578098276704877408688525618732848817623879899628629300385790344366046641825507767709276622692835393219811283244303899850483748651722336996164724553364097066493953127153066970594638491950199605713033004684970381605908909693802373826516622872100822213645899846325022476318425889580091613323747640467299866189070780620292627043349618839126919699862580579994887507733838561768581933029077488033326056066378869170169389819542928899483936705521710423905128732013121538495096959944889076705471928490092476616709838980562233255542325528398956185421193665359897664110835645928646616337700617883946369110702443135980068553511927115723157704586595844927607636003501038871748639417378062348085980873502535098755568810971926925447913858894180171498580131088992227637341857123607600275137768132347158657063692388249513 c = 26308018356739853895382240109968894175166731283702927002165268998773708335216338997058314157717147131083296551313334042509806229853341488461087009955203854253313827608275460592785607739091992591431080342664081962030557042784864074533380701014585315663218783130162376176094773010478159362434331787279303302718098735574605469803801873109982473258207444342330633191849040553550708886593340770753064322410889048135425025715982196600650740987076486540674090923181664281515197679745907830107684777248532278645343716263686014941081417914622724906314960249945105011301731247324601620886782967217339340393853616450077105125391982689986178342417223392217085276465471102737594719932347242482670320801063191869471318313514407997326350065187904154229557706351355052446027159972546737213451422978211055778164578782156428466626894026103053360431281644645515155471301826844754338802352846095293421718249819728205538534652212984831283642472071669494851823123552827380737798609829706225744376667082534026874483482483127491533474306552210039386256062116345785870668331513725792053302188276682550672663353937781055621860101624242216671635824311412793495965628876036344731733142759495348248970313655381407241457118743532311394697763283681852908564387282605279108 e = 0x10001 a = 2 sqr=int(gmpy2.iroot(n,2)[0])
for p in sieve_base: i = 1 for j inrange(1): i *=p if(i>sqr): break a = a*i
p=fractions.gcd(pow(3,a,n)-1,n) q=n//p phi_n = (p-1)*(q-1) d = gmpy2.invert(e, phi_n) m = pow(c,d,n) m_hex = hex(m)[2:]