{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {MPLTEXT 0 21 307 "If we want to use RS A, the first thing we should do is create our keys. So we'll need to c hoose our n = p*q. This is accomplished by the getKBitStrongPrime(k) p rocedure. Here k is a lower bound on the # of digits in the prime. Sin ce we want p and q to be far apart, we'll make p 512 digits and q 550 \+ digits." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "p := getKBitStrongPrime(512)[5];\nq := getKBitStrongP rime(550)[5];\nn := p*q;\nphi := (p-1)*(q-1);\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"pG\"[uB[1#oqTCf=-d\"pa5fen*QnzB$*)HN,W_XqBi4&f))[() 3d5olJ%zseU$4+Ay\"[1ef/aN:8^5u*Q(e;$4p>%G.RGKA" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"qG\"fu(Hi:KM2Trr!)[%*GVY)\\/=\\,q=X.#)=mc\"\\^ ^;Y6H#3=(Q4/I))[<(R4fb!\\w+'Q@%>@vpNJu&3-%e)\\N+)Q$*o^HX#)H" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"nG\"e_lJ%yn=.\\Ra\"Rze)*3r:Bds$R\"ytOB. \"yAu,(y2k4K3?\"HO\"[y*epS&=XSfY^6kW.]E[TqicHqMaehR'>&Hk4;hrUh(>R#)*o! *y*z0Fknlr*>3V/3t$)zZ7td7m_2?L3^W()zt&H(p]5r&o04N8jRRl^N#QK?X-7vGes1g? ()*3!)zr:bejr\"odm" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%$phiG\"e_l78:$ =)**RP75@)*R@'>Z^[1d,FA+4D5oCvh$z(H7V+3unTM^bO.%f>e$[&H%oD[bUTtO`Np')z omvyL53V/3t$)zZ7td7m_2?L3^W()zt&H(p]5r&o04 N8jRRl^N#QK?X-7vGes1g?()*3!)zr:bejr\"odm" }}}{EXCHG {PARA 0 "" 0 "" {MPLTEXT 0 21 205 "One suggestion that the original authors make is th at gcd(p-1,q-1) should be fairly small. At this point we're not sure w hy, but we can check that this is the case and choose different primes if necessary." }{TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "gcd(p-1,q-1);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}} {EXCHG {PARA 0 "" 0 "" {MPLTEXT 0 21 227 "Now that we have strong prim es, we can set up our public key (e,n) and private key (d,n) where ed= 1 (mod phi). Our algorithm works by searching for a number e such that gcd(e,phi)=1. We must first pick a random place to start.\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 156 "start:= rand((phi/2)+1..(ph i-1))(): \nif (type(start, even)) then start:=start+1; end if: start:= start:\n\nkey:= getRSA_e_d(phi,start):\ne:= key[1];\nd:=key[2];\n" }} {PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"eG\"e_ll/RI\"pJ'R)['y!>qP>'fFd2.@j RxV_;u<,2uD!p#eS[d^#4Q3&QII-ErRQ%>N5Hd^B+oy1NBjLj1i>'>(zW;\")4h*f\"oyh %y*e)f)f\\yz0[;HS[y(er<_D*30t!ROJH\"QU`?B.k@I$zuEyY#=WOPn8H_,O!oC%o\"[ ay`1l_hMUM7us`'*p\"=F&" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"dG\"d_ll Kr,M)\\$eaD\"3BF7Yc$Q8>=\">_Qm:3P!G64U1pWT1wi?kHE&pzc$3\\R&>EFx'*>n36T *otM#R'zf@h(\\YY#\\(\\s5kf&R?J#R(\\$H'GG(z#3+&))pmw[L^`1I&yp*>XqFQ#R=s \\Q&R(>H]yLDs!f)**G&zp,3Hz)Hz " 0 "" {MPLTEXT 1 0 168 "message:=\"Hi guys. RSA is so very awesome...isn't it? I just wanted to say good job on your project and keep up the excellent work. Your's Truly, Ronald Linn Rivest.\";\n" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(messageGQftHi~guys.~RSA~is~so~very ~awesome...isn't~it?~I~just~wanted~to~say~good~job~on~your~project~and ~keep~up~the~excellent~work.~Your's~Truly,~Ronald~Linn~Rivest.6\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "encodeResult := encodeRSA(e, n,message): \ncodeBlocks:= encodeResult[2]:\nencodeResult[1];" }} {PARA 12 "" 1 "" {XPPMATH 20 "6#%]t|2A|ju5|ax|cu*|dvsy|cus|gu|evh|iz|` y|/|dw|4]RiI<|#u|fz|^s^|`t|cy|[sP|$|azz.V|[x|iu6|]vm|du|7|fw=|gz|]x|_z |1|^s|ix|exS?|`x|_yG|gx)|bw|`w|_v|cu)|@|_t|gy|cs1uS|jy=|\\uN|]t|_s|cy| `v|gv|ay^4|\\v|& " 0 "" {MPLTEXT 1 0 42 "decodeResult := decodeRSA(codeBlocks,d,n);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%-decodeResultG%dwHi~guys.~RSA~is~so~very~a wesome...isn't~it?~I~just~wanted~to~say~good~job~on~your~project~and~k eep~up~the~excellent~work.~Your's~Truly,~Ronald~Linn~Rivest.~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "1 0 0" 96 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }