• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
An Example of RSA Encryption
An Example of the RSA Algorithm
P = 61 <- first prime number (destroy this after computing E and D)Q = 53 <- second prime number (destroy this after computing E and D)PQ = 3233 <- modulus (give this to others)E = 17 <- public exponent (give this to others)D = 2753 <- private exponent (keep this secret!)Your public key is (E,PQ).Your private key is D.The encryption function is:encrypt(T) = (T^E) mod PQ= (T^17) mod 3233The decryption function is:decrypt(C) = (C^D) mod PQ= (C^2753) mod 3233To encrypt the plaintext value 123, do this:encrypt(123) = (123^17) mod 3233= 337587917446653715596592958817679803 mod 3233= 855To decrypt the ciphertext value 855, do this:decrypt(855) = (855^2753) mod 3233= 123One way to compute the value of 855^2753 mod 3233 is like this:2753 = 101011000001 base 2, therefore2753 = 1 + 2^6 + 2^7 + 2^9 + 2^11= 1 + 64 + 128 + 512 + 2048Consider this table of powers of 855:855^1 = 855 (mod 3233)855^2 = 367 (mod 3233)855^4 = 367^2 (mod 3233) = 2136 (mod 3233)855^8 = 2136^2 (mod 3233) = 733 (mod 3233)855^16 = 733^2 (mod 3233) = 611 (mod 3233)855^32 = 611^2 (mod 3233) = 1526 (mod 3233)
file:///C|/Documents%20and%20Settings/mwood/Deskto...aphy/An%20Example%20of%20the%20RSA%20Algorithm.htm (1 of 4)8/1/2006 1:53:25 AM
 
An Example of RSA Encryption
855^64 = 1526^2 (mod 3233) = 916 (mod 3233)855^128 = 916^2 (mod 3233) = 1709 (mod 3233)855^256 = 1709^2 (mod 3233) = 1282 (mod 3233)855^512 = 1282^2 (mod 3233) = 1160 (mod 3233)855^1024 = 1160^2 (mod 3233) = 672 (mod 3233)855^2048 = 672^2 (mod 3233) = 2197 (mod 3233)Given the above, we know this:855^2753 (mod 3233)= 855^(1 + 64 + 128 + 512 + 2048) (mod 3233)= 855^1 * 855^64 * 855^128 * 855^512 * 855^2048 (mod 3233)= 855 * 916 * 1709 * 1160 * 2197 (mod 3233)= 794 * 1709 * 1160 * 2197 (mod 3233)= 2319 * 1160 * 2197 (mod 3233)= 184 * 2197 (mod 3233)= 123 (mod 3233)= 123If you have a computer program (such as the "bc" utility that comes with Linux),you can compute 855^2753 mod 3233 directly, like this:855^2753 mod 3233= 5043288895841606873442289912739446663145387836003550931555496756450105562861208255997874424542811005438349865428933638493024645144150785172091796654782635307099638035387326500896686074771829745822950342950407903581845940956377938586598936883808360284013250976862076697739667533250542826093475735137988063256482639334453092594385562429233017519771900169249169128091505960191787601713497254392792156967017899021343071464689712796102771813783945869677289869342365240311693217089269617643726521315665833158712459759803042503144006837883246101784830717585474547252069688925995892544366701432205469543174002285500923863694244485597333306305160738530286321930291350374547194675777671357954965202919790505781532871558392070303159585937493663283548602090830635507044556588963193180119341220178269233441013301164806963340240750469525886698765866900622402410208846650753026395387052663193358473481094876156227126037327597360375237388364148088948438096157757045380081079469800667348777958837582899851327930703533551275090439948178979054899338121732945853544741326805698108726334828546381688504882434658897839333466254454006619645218766694795528023088412465948239275105770491133290256843065052292561427303898320890070515110552506189941712317779515797942971179547529630183784386291397787766129820738907279676720235011399271581964273076407418989190486860748124549315795374377124416014387650691458681964022760277668695309039513149683190973245054523459447725658788769269335391869235481851854242092306499640682218449011913571088542442852112077371223831105455431265307394075927890822606043171133395752266034451645259763161842774590432019134528932993216130744053222747057289481214358683197841559727649635709090121513130415756920979851832104115596935784883366531595132734467524394087576977
file:///C|/Documents%20and%20Settings/mwood/Deskto...aphy/An%20Example%20of%20the%20RSA%20Algorithm.htm (2 of 4)8/1/2006 1:53:25 AM
 
An Example of RSA Encryption
78908490126915322842080949630792972471304422194243906590308142893930291584830873687450789770869218452967411463211556678655283381648067954559418910069509196589908545679807239237084630255354568691923554629957157358790622745861957217211107882865756385970941907763205097832395713464119025004702084856040821750949107716553117652974738031767658205876731402889103288343185088447211644271939037404131556498699591373651621084511374022433518599576657753969362812542539006855262454561419258809437402128886669744109721845342218171980899119537075455420339119645393664617929681653426522346399367423309701835339046236776936703805342644821735823842192515904381485247388968642443703186654199615377913969649003039587606549152449450436001359392771339521012519285720925978875116019596296156902711643189463734265002363100455571800369358605526491000090724518378668956441716490727835628100970854524135469660844811613387806548545151761673086051080657829365241087232636672280540038794108643482267500907782651210137281958316531396983090887317417474535988684298559807185192215970046508106068445595364808922494405427663296745923088984848684358654798505115428440164623526969317993778443021785701919709875162965466513027800996658005217820813931723237901323249468260920081998103768484716787498919369499791482471634506093712565412250195379516689760185508759931336779779395278222732333752958026312266535894820556651528946636903208328768043239061154935095459093406676402258670848337605369986794102620470905715674470565311124286290735488849298998356099963609214112849774586146960402870296707014781794902482829074841600836804586668550760461922520943498047157452688181318508591501948527635965034581536416565493160130613304074344579651083803040622402788980428251890947162922668980166844809636451980905109057965130757037924595807447975237126676101147387874214414915481359174392799496956415653866883891715446305611805369728343470219206348999531917640161103924904391798033989754917653959236085118076531847064733180157820741276478759273908749295571685366518591266637383123594589126787095838000224515094244575648744840868775308453955217306366938917023940371847803627746431714708558304919598951467762943921431002456130611142993700055775133971728254911005600894089841967131970911816554290876109008324997831338240786961578492341986299168008677495934077593066022078149438078549967989453993640636857226974223618584114250483724512446558027085917979559108652309975651983827795294575699657424557868838354442368572236813990212613637440821314784832035636156113462870198514239018429097416386202320510397121849833552863086851842826346150274418735863950404228151239950599598365379222728584742207167783667945134363807086579774219853595393166279988789721695963455346336497949221130176613162074772661131070123214037138822702217232330854726795330150799806225383545894802482004314472619159619052603406906193093929072410284948700167172969517703467909979440975063764929635675558007116218277276031829217903502904860909762662853966270243925368902563371014716832740450458306022867631421581599007916426277000546123229192192997169907690169025946468104141214204472402661658275680524166861473393322659591270064563044741608529167218700704514464979322666873214634674904118588676083684030619069578699009652139067520501974407677651043885151941619318479919134924388152822038464729269446084915299958818598855
file:///C|/Documents%20and%20Settings/mwood/Deskto...aphy/An%20Example%20of%20the%20RSA%20Algorithm.htm (3 of 4)8/1/2006 1:53:25 AM
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...