0> run RSA.calc > # create an RSA key > 65537 = e # public exponent > 1024 probablePrime = p # should check that gcd(p-1,e) == 1 > 1024 probablePrime = q # should check that gcd(q-1,e) == 1 > p q * = n # public modulus > p 1 - q 1 - * = phi > e phi modInverse = d # private exponent > # > # a random message: > 64 BigInteger Computers/are/useless//They/can/only/give/you/answers//Pablo/Picasso = m > m e n modPow = c # encrypt > who --- e 65537 p 173234394010745809424038585788813149891688604079991222370913344310650295657303274146812717278387070684628958106595356417739702861910472758192405452146556946569396277794939131642106005741654425522870196477879534220340371212069855297035402830651579190603818132820079565273485817201238602796069750891794998328051 q 142469592251935002459728172548400677569379803818655974498363056048522319399468027823119874642715336793577716272699780577095255420897023030519521393539378366032381321927218264677677416571571397547640667793394621986198445517905915911841545040623947822563037000906838177128253975693885367581127821421045493877591 n 24680633478722006565559297209415765965073076451608941535445936506519811977566071450314274905050888143730104706979938225597602278894323179424287640980105643983951366558395473014019166897611635111836493831146206949725774617868670712096234253414532802252003822174931217628861780039915054305439969060891793484778125288353439264028656920733866449494094621467315195375421856793256351957525368601633767573029904549912992936640992247802818793322673159491599476996821621021035739657135856837154473643587924505537104604011576923261887631277140663014395006672056152904093997445474722761245684465242079824584287720673401855605141 phi 24680633478722006565559297209415765965073076451608941535445936506519811977566071450314274905050888143730104706979938225597602278894323179424287640980105643983951366558395473014019166897611635111836493831146206949725774617868670712096234253414532802252003822174931217628861780039915054305439969060891793484777809584367176583216773153975529235666633553059416548178552580392897179342468597299663834981108802142434786262261697110807983835039865663702887550151135685708433962057413699440834690221274698682466593739740302767055348814547164891805518058800780625890927142311747805018843944672346955854207090148360561363399500 d 7811623666770382870582976059552790536849578479877386427052734500430908644744999314797274888314548617809688602421301838863101211088468280678059699663553891285214507782181016780288990630592766637545575652524005840336935515791840282298734869136177333675836783547837072909585118381493781702820411038498534755248883900827446234427354403358627995413781219633359437552340146407218307079982698533453269588372062847559771906527524652783771132188411637123899422506141683761082223399864692730842638193080261146686674000082901266414835901248940924221765736815914560063101785449022456314843217485366936315116921295564995717853973 m 27211093638923386328518447955397274452187459354906155701098866589486574866802094339746427690969870286464181194021692689192 c 22908047945482122239012779174702288845904097638667318451316468970416778271949319226208407573113561038847976078462359806284765070593397087115957643280271864122679330701898757829249074220928942976151019068715394994538806631520298771660496255816712922029016048108798148116475818915507998408480884771400241195287860813462664142003017984577773562498893044620113782580353905998374341054436251671110752706940035615255412934043795754341039154654525976315544736486842320713228026158118592505067376000332161866040476133382801547470475659566502107780030376580263457926311694879814247759083741041367763371345024777556454079500270 > c d n modPow 64 toString # decrypt toString = Computers/are/useless//They/can/only/give/you/answers//Pablo/Picasso --- 27211093638923386328518447955397274452187459354906155701098866589486574866802094339746427690969870286464181194021692689192