Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: RSAEncryption
Views: 64
def ASCIIDepad(Number): n = Number.ndigits() % 3; if (n > 0): print("This is not a padded ASCII string\n"); else: L = [((Number - (Number % (1000^i)))/1000^i)%1000 - 100 for i in range(Number.ndigits()/3)]; N = ""; for i in range(Number.ndigits()/3): N = chr(L[i]) + N; return(N);
def decrypt(encr,decrexp,encrmod): D = power_mod(encr,decrexp,encrmod); N = ASCIIDepad(D); return(N);
N = 1482760822483005142781116293890610327291726025044543235669647945741530109971726574457552857304224921443513064111613981873609998778320098691623156630155332649925032521458438419998872039380369; d = 532642237202632915367973814310219243784406436181049511842494893130452563776251293737179181748679106526065681459952847088227602345995022950272976556734037511907028690595634030197610786772787; E = 924867268501755906319811358042791176148156640028726779804063801260107063522282458112018667121990281042052995856352143510265672958018043298812945072311407921230139742687610115617023962997759; S = decrypt(E,d,N);
print(S);
Crypto is used everywhere.