{VERSION 4 0 "APPLE_PPC_MAC" "4.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 Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 25 "Courier" 0 1 0 0 0 1 2 2 0 0 0 0 0 0 0 1 }{CSTYLE " " -1 35 "" 0 1 104 64 92 1 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 36 "" 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 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1 351 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 352 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 353 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 354 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 355 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Tim es" 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 "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 }{PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "T imes" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 14 5 } {PSTYLE "Bullet Item" -1 15 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 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Author" -1 19 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 8 8 1 0 1 0 2 2 0 1 }{PSTYLE "Author" -1 256 1 {CSTYLE "" -1 -1 "Tim es" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 8 8 1 0 1 0 2 2 0 1 } {PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 259 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 } {PSTYLE "Title" -1 260 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }} {SECT 0 {EXCHG {PARA 260 "" 0 "" {TEXT -1 10 "Lecture 12" }}{PARA 19 " " 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT 256 39 "The RSA \+ Public Key Cryptographic System" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 " The " }{TEXT 332 10 "RSA system" }{TEXT -1 6 " is a " }{TEXT 333 31 "p ublic-key cryptographic method" }{TEXT -1 264 " that permits both encr yption and digital signatures (authentication). Ronald Rivest, Adi Sha mir, and Leonard Adleman developed the RSA system in 1977. RSA stands for the first letter in each of its inventors' last names. For more \+ informations you may start with" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 7 " " }{TEXT 288 46 "http://www.rsasecu rity.com/rsalabs/faq/3.html " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "or you may do a web luis search at the USF libr ary on the key word " }{TEXT 289 12 "cryptography" }{TEXT -1 2 ". " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 36 "Here's th e way the RSA system works:" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 155 "Suppose Alice wants Bob to send h er a secret message using the RSA system. Here's what she does. [The c ommunication can take place via email, for example.]" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 38 "1. She finds two large \+ primes p and q." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 47 "2. She forms the product m = pq. We call m the " }{TEXT 290 7 "modulus" }{TEXT -1 3 ". \n" }}{PARA 0 "" 0 "" {TEXT -1 16 "3. S he computes " }{XPPEDIT 18 0 "phi(m) = (p-1)*(q-1);" "6#/-%$phiG6#%\"m G*&,&%\"pG\"\"\"F+!\"\"F+,&%\"qGF+F+F,F+" }{TEXT -1 25 ". [This is the so-called " }{TEXT 336 18 "Euler phi function" }{TEXT -1 28 " applied to the modulus m. ]" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 53 "4. She chooses a positive integer e such that igcd(e," }{XPPEDIT 18 0 "phi(m);" "6#-%$phiG6#%\"mG" }{TEXT -1 6 ") = 1." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 20 "5. She co mputes the " }{TEXT 291 7 "inverse" }{TEXT -1 18 ", call it d, of e " }{TEXT 292 6 "modulo" }{TEXT -1 1 " " }{XPPEDIT 18 0 "phi(m);" "6#-%$p hiG6#%\"mG" }{TEXT -1 2 ".\n" }}{PARA 0 "" 0 "" {TEXT -1 92 "6. She se nds the pair of numbers [m,e] to Bob. This pair of numbers may be made public, but " }{TEXT 257 11 "the numbers" }{TEXT -1 8 " p,q, d " } {TEXT 259 3 "and" }{TEXT -1 1 " " }{XPPEDIT 18 0 "phi(m);" "6#-%$phiG6 #%\"mG" }{TEXT -1 1 " " }{TEXT 258 23 "should be kept secret! " } {TEXT -1 19 " We call [m,e] the " }{TEXT 261 10 "public key" }{TEXT -1 12 " and d, the " }{TEXT 262 11 "private key" }{TEXT -1 2 ". " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 106 "7. She t ells Bob how to use Maple to convert the text of his message into a se quence of positive integers " }{XPPEDIT 18 0 "a[1];" "6#&%\"aG6#\"\"\" " }{TEXT -1 3 " , " }{XPPEDIT 18 0 "a[2];" "6#&%\"aG6#\"\"#" }{TEXT -1 10 ", . . . , " }{XPPEDIT 18 0 "a[k];" "6#&%\"aG6#%\"kG" }{TEXT -1 46 " each less than m. The method is shown below. " }{TEXT 260 31 "Thi s method can be made public." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 50 "8. She tells Bob to compute for each i the numb er " }{XPPEDIT 18 0 "b[i] = `mod`(a[i]^e,m);" "6#/&%\"bG6#%\"iG-%$modG 6$)&%\"aG6#F'%\"eG%\"mG" }{TEXT -1 51 " and tells him to send her the \+ sequence of numbers " }{XPPEDIT 18 0 "b[1];" "6#&%\"bG6#\"\"\"" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "b[2];" "6#&%\"bG6#\"\"#" }{TEXT -1 9 " , . . ., " }{XPPEDIT 18 0 "b[k];" "6#&%\"bG6#%\"kG" }{TEXT -1 23 ". He need not keep the " }{XPPEDIT 18 0 "b[i];" "6#&%\"bG6#%\"iG" }{TEXT -1 64 " 's secret after he has computed them. But, he should keep the " }{XPPEDIT 18 0 "a[i];" "6#&%\"aG6#%\"iG" }{TEXT -1 10 "'s secret." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "9. Now \+ when Alice gets the " }{XPPEDIT 18 0 "b[i];" "6#&%\"bG6#%\"iG" }{TEXT -1 28 " 's from Bob, she computes " }{XPPEDIT 18 0 "`mod`(b[i]^d,m); " "6#-%$modG6$)&%\"bG6#%\"iG%\"dG%\"mG" }{TEXT -1 34 " and this will t urn out to be the " }{XPPEDIT 18 0 "a[i];" "6#&%\"aG6#%\"iG" }{TEXT -1 96 "'s. Then she can use Maple to convert these back into text as w e illustrate in the next section." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 28 "An Example of the RSA Syst em" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 187 "We illustrate the RSA syste m using two randomly chosen primes with 20 decimal digits. Note that \+ 10^n is the smallest n+1 decimal digit number and 10^(n+1) -1 is the l argest. For example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "10^ 2; 10^3-1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "We first generate t wo 20 digit random positive integers and then use the Maple command " }{TEXT 337 9 "nextprime" }{TEXT -1 56 " to obtain the smallest primes \+ greater than each number." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "N:=rand(10^19..10^20 -1)();\nM:=rand(10^19..10^20 -1)();" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "p:=nextprime(N);\nq:=nextpri me(M);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 16 "Now we form our " } {TEXT 338 7 "modulus" }{TEXT -1 3 " m:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "m:=p*q;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "How ma ny digits does m have? This tells us:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "length(m);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "No w we compute " }{XPPEDIT 18 0 "phi(m);" "6#-%$phiG6#%\"mG" }{TEXT -1 98 " which is possible since we know that m = p*q where p and q are pr imes. We simply use the formula " }{XPPEDIT 18 0 "phi(m) = (p-1)*(q-1) ;" "6#/-%$phiG6#%\"mG*&,&%\"pG\"\"\"F+!\"\"F+,&%\"qGF+F+F,F+" }{TEXT -1 3 ". " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "phi:=(p-1)*(q- 1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "Now we wish to find a numb er e such that " }{XPPEDIT 18 0 "igcd(e,phi(m)) = 1;" "6#/-%%igcdG6$% \"eG-%$phiG6#%\"mG\"\"\"" }{TEXT -1 50 ". To make sure that e is prett y big we start with " }{XPPEDIT 18 0 "e = phi(m);" "6#/%\"eG-%$phiG6#% \"mG" }{TEXT -1 43 " and keep trying till we find what we want:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "e:=phi:\nwhile igcd(e,phi) > 1 do\ne:=rand(10^19..10^20-1)();\nigcd(e,phi);\nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "From number theory we know that 1/e mod " } {XPPEDIT 18 0 "phi;" "6#%$phiG" }{TEXT -1 23 " exists if and only if \+ " }{XPPEDIT 18 0 "igcd(e,phi(m)) = 1;" "6#/-%%igcdG6$%\"eG-%$phiG6#%\" mG\"\"\"" }{TEXT -1 43 ". The following command will compute this:" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "d:=1/e mod phi;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "Check that ed mod " }{XPPEDIT 18 0 "phi(m)" "6#-%$phiG6#%\"mG" }{TEXT -1 5 " = 1." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "e*d mod phi;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "So the " }{TEXT 263 10 "public key" }{TEXT -1 32 " sent to Bob and made public is " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "Public_Key:=[m,e];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "The inform ation we must keep secret in this case is:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 25 "Private_key:=[p,q,d,phi];" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 17 "In cryptography, " }{TEXT 265 10 "plain text" }{TEXT -1 77 " refers to any message that is not enciphered. After encryption it is called " }{TEXT 266 13 "cipher text. " }{TEXT -1 50 "Now we ass ign Bob's message to the variable named " }{TEXT 293 10 "plain_text" } {TEXT -1 69 ", as follows. (Of course, the name of the variable is not important.)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 275 "plain_text :=\"It is not knowledge, but the act of learning, not possession but t he act of getting there, which grants the greatest enjoyment. When I h ave clarified and exhausted a subject, then I turn away from it, in or der to go into darkness again; --Karl Friedrich Gauss\";\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 216 "Note that the text includes new line sym bols, \\n, as well as numerous blanks.The \\ at the end of each line i s just Maple's way of saying that this should all be on one line, but \+ I am forced to break it at this point." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "\nWe now convert this text to a list of numbers:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "List1:=convert(plain_text,by tes);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "We consider List1 as th e base 256 representation of a number. We convert this to a base m nu mber as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "List2:= convert(List1,base, 256,m);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "No w we apply the mapping which send x to " }{XPPEDIT 18 0 "`mod`(x^e,m); " "6#-%$modG6$)%\"xG%\"eG%\"mG" }{TEXT -1 19 " to each number in " } {TEXT 339 5 "List2" }{TEXT -1 25 ". This can be done using " }{TEXT 264 5 "map. " }{TEXT -1 77 " We thus obtain the enciphered message tha t will be sent to Alice. Note that " }{TEXT 267 17 "Power(x,e) mod m; " }{TEXT -1 29 " is much more efficient than " }{TEXT 268 9 "x^e mod m " }{TEXT -1 80 ". In fact, for large integers m and e the latter may e ven cause Maple to crash. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "cipher_text:=map(x->Power(x,e) mod \+ m, List2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 116 "\nNow Bob sends th is to Alice and the whole world for that matter. But since only Alice \+ has the secret private key, " }{TEXT 294 45 "only she will be able to decipher the message" }{TEXT -1 61 " (in the case where p and q are c hosen with sufficient care.)" }}{PARA 0 "" 0 "" {TEXT -1 84 "\nWe show now how she deciphers the message: She applies the mapping which send x to " }{XPPEDIT 18 0 "`mod`(x^d,m);" "6#-%$modG6$)%\"xG%\"dG%\"mG" } {TEXT -1 87 " where d is her private deciphering key. Again for effic iency we use Power(x,d) mod m:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "decipher1:=map(x->Power(x,d) mod m,cipher_text);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Next she converts this to base 256:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "decipher2:=convert(decipher1 ,base,m,256);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "Finally she conv erts the numbers back to text and sees what message Bob sent her:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "decipher3:=convert(decipher2 ,bytes);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "Breaking the RSA System" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "To decipher the message it is " }{TEXT 340 8 "b elieved" }{TEXT -1 110 " but not proved that one must be able to find \+ the private key d given only the public key [m,e]. If one knows " } {XPPEDIT 18 0 "phi(m);" "6#-%$phiG6#%\"mG" }{TEXT -1 54 " then Maple q uickly computes d by the command 1/e mod " }{XPPEDIT 18 0 "phi(m);" "6 #-%$phiG6#%\"mG" }{TEXT -1 30 ". It is known that computing " } {XPPEDIT 18 0 "phi(m);" "6#-%$phiG6#%\"mG" }{TEXT -1 577 " is the same order of difficulty as factoring m. If m is the product of two 100 di git primes, say, then m is 200 digits long and current factoring algor ithms are unable to factor such numbers within a reasonable time unles s the primes are poorly chosen (as in Problem 4 in this week's homewor k assignment). Don't ask Maple to factor such a number for you unless you want to wait a long time -- years or centuries, depending on the \+ size of the number and luck. Factoring algorithms always depend on luc k. After all one might guess the factors. But this would be very unlik ely. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 11 " It is also " }{TEXT 271 8 "believed" }{TEXT -1 182 " but not proved th at breaking the RSA system is equivalent to factoring the modulus m. T he best algorithm known at present for factoring such large, difficult numbers, is called the " }{TEXT 272 38 "Number Field Sieve Factoring \+ Algorithm" }{TEXT -1 35 ". A group of mathematicians called " }{TEXT 269 9 "The Cabal" }{TEXT -1 79 " announced the completion, on November 14, 2000, of the factorization with the " }{TEXT 270 33 "Special Numb er Field Sieve (SNFS)" }{TEXT -1 967 " of the 233-digit Cunningham num ber 2^773 + 1 into the product of the numbers 3 and 533371 and three \+ primes of 55, 71, and 102 digits, respectively. This establishes a ne w record for the Special Number Field Sieve. [Note that this is somew hat easier to factor than a number of this size which is the product o f only two primes of approximate equal size. In this case the 3 and 5 33371 factors were easy to find. And the remaining factor has the sma ll 55-digit and 71-digit primes.] \n\nThe sieving was done on about 15 0 SGI workstations and Sun workstations and servers running at 180-450 MHz, and on about 100 PCs running at 266-600 MHz. The sieving took ab out five calendar months. It was started mid-April, 2000, and finished on September 15, 2000. Total sieving time was 57.4 CPU years. \n\nThe previous SNFS record was the 211-digit repunit number 10,211- = (10^2 11 - 1)/9, factored on April 8, 1999, also by the Cabal. Factorization details are available from: " }}{PARA 0 "" 0 "" {TEXT 276 5 " " } }{PARA 0 "" 0 "" {TEXT 277 9 " " }{TEXT -1 58 "\n ftp: //ftp.cwi.nl/pub/herman/SNFSrecords/SNFS-233" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 247 "There are many sources of information on the RSA system. It is im portant not only for sending data securely but also can be used to \"s ign\" electronically submitted documents. For more information see for example any of the many books available on " }{TEXT 273 14 "cryptogra phy. " }{TEXT -1 150 " Just search on this key word using Web Luis or \+ on your favorite search engine. There is now a company that controls t he use of the RSA system called " }{TEXT 274 21 "RSA Data Security Inc " }{TEXT -1 25 ". whose website's URL is " }{TEXT 275 29 "http://www.r sasecurity.com/. " }{TEXT -1 99 "Both Netscape and Internet Explorer c ontain security software from RSA Data Security Inc. Also the " } {TEXT 342 3 "PGP" }{TEXT -1 261 " (Pretty Good Privacy) encryption sys tem incorporates the RSA scheme. PGP can be used for authentication p urposes (i.e., to electronically sign a document). You may download th e program for free from the MIT website\n\n http://web.mit.edu/ network/pgp.html" }{TEXT 341 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 147 " You may find out about Philip Zimmerman n, the creator of PGP, and his troubles with the government at his web page\n\n http://web.mit.edu/prz/" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 124 "He even has his phone number given \+ on the webpage, but in a way that forces people to read an entire para graph to obtain it." }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 43 "The commands readdata, writeto and appendto" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 554 "If for example one wants to run a Maple program that will take several days to complete the co mputation and there will be data printed out along the way, it is wise to print this out put to a file. This way if Maple crashes before it \+ finished the data can be obtained from the file. Also there are times \+ when you might obtain data from other sources that you wish Maple to p rocess. In this case if the data is in a text file, it may be read int o a Maple worksheet so that you can process it further. Here are some \+ commands that will allow one to do this." }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 20 "writeto and appendto" }}{EXCHG {PARA 15 "" 0 "" {TEXT -1 17 "When the command " }{TEXT 295 18 "writeto(filename);" }{TEXT -1 76 " is typed all future commands will have their results immediately \+ stored in " }{TEXT 343 8 "filename" }{TEXT -1 129 " and will not be di splayed on the screen. Unless you indicate otherwise the file will be \+ created and stored in your Maple folder." }}{PARA 15 "" 0 "" {TEXT -1 115 "While in this mode, no prompt will appear at the terminal. The pr ompt and the input statements will be echoed into " }{TEXT 344 8 "file name" }{TEXT -1 33 " (unless echoing is turned off). " }}{PARA 15 "" 0 "" {TEXT -1 20 "The special command " }{TEXT 296 17 "writeto(termina l)" }{TEXT -1 73 " will restore the standard mode of printing the resu lts on the terminal. " }}{PARA 15 "" 0 "" {TEXT -1 3 "If " }{TEXT 345 8 "filename" }{TEXT -1 58 " already exists the contents of the file ar e overwritten. " }}{PARA 15 "" 0 "" {TEXT -1 62 "An alternative mode o f writing to a file is available via the " }{TEXT 298 8 "appendto" } {TEXT -1 26 " function. In the case of " }{TEXT 297 19 "appendto(filen ame);" }{TEXT -1 50 " rather than overwriting the contents (if any) of " }{TEXT 346 8 "filename" }{TEXT -1 20 ", the new output is " }{TEXT 348 8 "appended" }{TEXT -1 4 " to " }{TEXT 347 8 "filename" }{TEXT -1 21 ". In other respects, " }{TEXT 299 8 "appendto" }{TEXT -1 5 " and \+ " }{TEXT 300 7 "writeto" }{TEXT -1 30 " have the same functionality. \+ " }}{PARA 0 "" 0 "" {TEXT -1 47 "To see what's going on we will need t o use the " }{TEXT 349 8 "readdata" }{TEXT -1 9 " function" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 119 "writeto(`datafile1`);\nfor i from 10^10 to 10^10 + 6 do\nprintf(\"%15d %15d %15d \\n\",i, 5*i, 10*i);\nod;\nwriteto(term inal);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "readdata" }}{PARA 15 "" 0 "" {TEXT -1 4 "T he " }{TEXT 301 9 "readdata " }{TEXT -1 341 "function reads numeric da ta from an input text file into Maple. The data must consist of intege rs or floats arranged in columns separated by white space. If only one column of data is read, the output is a list of the data. If more tha n one column is read, the output is a list of rows of data correspondi ng to the rows of data in the file. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "L:=readdata(`datafile1`, integer, 3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "Here are two ways to display the date rea d in." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "matrix(L);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "for i from 1 to nops(L) do \+ \nprintf(\" %15d %15d %15d \\n\",op(L[i])); \nod;" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 29 "O ther read and write commands" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 175 "Maple has a variety of commands f or reading data from external files and writing data to external files . The type of command you use depends on the type of data. For example , " }{TEXT 312 8 "readdata" }{TEXT -1 51 " will work for lists of numb ers, but you will need " }{TEXT 313 8 "readline" }{TEXT -1 15 " to rea d text (" }{TEXT 314 7 "strings" }{TEXT -1 168 "). Similarly for writi ng to a file, the type of data is important. Here is a brief summary o f the other commands. For more details see the online help for each co mmand." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 315 10 "For input:" }{TEXT -1 5 "\n\n1. " }{TEXT 302 8 "readline" }{TEXT -1 65 " reads a single line from a file or the terminal, and returns i t " }{TEXT 318 11 "as a string" }{TEXT -1 94 ". You can then parse th is with \"sscanf\" or the \"parse\" function (for Maple expressions). \n\n2. " }{TEXT 303 8 "readdata" }{TEXT -1 19 " reads a text file " } {TEXT 317 18 "containing numbers" }{TEXT -1 149 " separated by tabs or spaces, and returns it as a list. You can specify which columns to r ead, and whether to treat them as integers or floats.\n\n3. " }{TEXT 304 26 "fscanf , sscanf, and scanf" }{TEXT -1 150 " are based on the C standard library functions of the same names for formatting input. T he Maple versions of these functions each return a list.\n\n4. " } {TEXT 305 9 "readbytes" }{TEXT -1 29 " reads a specified number of " } {TEXT 319 5 "bytes" }{TEXT -1 80 " from a file, and returns either a l ist of integers or a string of characters.\n\n" }{TEXT 316 11 "For out put:" }{TEXT -1 5 "\n\n1. " }{TEXT 306 9 "writeline" }{TEXT -1 8 " wri tes " }{TEXT 320 8 "strings " }{TEXT -1 31 "to a file or the terminal. \n\n2. " }{TEXT 307 9 "writedata" }{TEXT -1 18 " is used to write " } {TEXT 321 14 "numerical data" }{TEXT -1 21 " to a text file.\n\n3. " } {TEXT 308 29 "fprintf , sprintf, and printf" }{TEXT -1 198 " are based on the C standard library functions of the same names; these allow yo u to control the format of output. There is also an \"nprintf\" which returns a Maple symbol rather than a string.\n\n4. " }{TEXT 309 10 "w ritebytes" }{TEXT -1 12 " writes the " }{TEXT 322 5 "bytes" }{TEXT -1 120 " from a string of characters or list of integers to a file (the f ile is opened with type text or binary, respectively).\n" }}{PARA 0 " " 0 "" {TEXT -1 3 "5. " }{TEXT 310 7 "writeto" }{TEXT -1 4 " or " } {TEXT 311 8 "appendto" }{TEXT -1 8 " writes " }{TEXT 323 22 "output fr om the screen" }{TEXT -1 41 " into the specified file. In the case of \+ " }{TEXT 324 8 "writeto," }{TEXT -1 45 " the old file is overwritten, \+ in the case of " }{TEXT 325 9 "appendto," }{TEXT -1 65 " the new data \+ produced by Maple is appended to the existing file." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 41 "Converting to Fortran, C, Latex, and HTML" }}{PARA 0 "" 0 "" {TEXT -1 5 "\nThe " } {TEXT 35 7 "fortran" }{TEXT -1 69 " function generates Fortran code fo r evaluating the input. The input " }{TEXT 35 1 "s" }{TEXT -1 107 " mu st be a single algebraic expression, an array of algebraic expressions , a list of equations of the form " }{TEXT 35 16 "name = algebraic" } {TEXT -1 86 " that is understood to mean a sequence of assignment stat ements, or a Maple procedure." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "with(codegen,fortran):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "f:=unapply(sin(x*y) + ln(x^2 + 5*x*y + 1), x,y);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "fortran(f);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 35 1 "C" }{TEXT -1 63 " function generat es C code for evaluating the input. The input " }{TEXT 35 1 "s" } {TEXT -1 129 " must be one of the following: a single algebraic expres sion, an array of algebraic expressions, a list of equations of the fo rm " }{TEXT 35 16 "name = algebraic" }{TEXT -1 89 " (which is understo od to mean a sequence of assignment statements), or a Maple procedure. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(codegen,C):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "C(f);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 1 "\n" }{TEXT -1 4 "The " }{TEXT 326 5 "latex" } {TEXT -1 85 " function produces output which is suitable for printing \+ the input expression with a " }{TEXT 327 8 "LaTeX 2e" }{TEXT -1 82 " p rocessor. It knows how to format integrals, limits, sums, products and matrices." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "A:=matrix([[s eq(i,i=1..5)],[seq(i^2,i=1..5)]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "latex(A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 3 "To " }{TEXT 328 6 "export" }{TEXT -1 19 " a worksheet as an " }{TEXT 329 4 "HTML" }{TEXT -1 40 " document for viewing in a Web browser: " }} {PARA 14 "" 0 "" {TEXT -1 48 " 1. Open the worksheet that you want to \+ export. " }}{PARA 14 "" 0 "" {TEXT -1 13 " 2. From the " }{TEXT 36 4 " File" }{TEXT -1 14 " menu, choose " }{TEXT 36 9 "Export As" }{TEXT -1 11 ", and then " }{TEXT 36 4 "HTML" }{TEXT -1 149 ". \n\nNote that whe n Maple creates the HTML file it will also create a folder containing \+ gif files that will be employed when the HTML file is opened. " }} {PARA 14 "" 0 "" {TEXT -1 0 "" }}{PARA 14 "" 0 "" {TEXT -1 312 "You ma y use the above to convert the entire worksheet to an HTML file. Or, \+ individual plots can be saved in a separate worksheet and then exporte d to html. This will create a file containing only the plot. The anima ted plots will run continuously when opened with a web browser as we w ill demonstrate in class. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 66 "animate3d( 10*sin(t)*abs(y)*abs(x), x = -1..1, y=-3..3, t=0..2*Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 28 "Writing Efficient Maple Code" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 215 "For a n umber of useful hints on how to write efficient code, that is, how to \+ improve the performance of a program that you have working, but would \+ like to speed up, read the help page that comes up when you execute " }{TEXT 335 10 "?efficient" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "?efficient" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 36 "Assignment 12 -- the last assignment" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 278 10 "Problem 1." } {TEXT -1 98 " Alice sent a message to Bob using the RSA system. The p ublic key used to encode the message was " }}{PARA 0 "" 0 "" {TEXT -1 79 "[m,e] = [187454749788911503119994043213682616233000961, 2307369747 4256143563]. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 26 "The enciphered message was" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 1228 " [9976308850671705071637949852035 7841718875740, 120165413768425112311337085191282286020515442, 13055485 2152844850464253187688342192964186591, 3083103880347330918694403904469 3095063005267, 43791870977158745785820581340119798552660187, 699699650 42359538654291028155927734707714502, 338699659256999909038017914779294 60546990002, 33844215332363231914638130818590411552396086, 61034870951 899306892357141802983347226683758, 15268070224895082795829529457271713 5277913525, 109591116592896191360922558098912453060002989, 15548994778 9995346755966254731407091292570943, 3050853785484135288833738680013167 8916944679, 45657204694505066046067342403378233363404150, 122580283375 455701674982424288406984864898071, 63190645718352016104824679398188140 019415424, 17253386795565064409576412640690151622064852, 7643268136560 2448262013510061731737725777808, 4419855123469897669096067167819380964 828479, 87913005918401414546998775379426321338719933, 1554345165267352 15629181544556450169276890711, 746953813599011144431688669057557230392 88800, 246854149837977729662442017899408430336317, 1217662277746125438 67361050340041336298158533, 166784352080096633524033563364825999607054 575, 72405993088552642775735865911360107823805504]\n\nDecipher this me ssage. " }{TEXT 350 4 "Hint" }{TEXT -1 53 ". Use of ifactor with the o ption 'pollard' may help. " }{TEXT 351 112 "When you are finished with the decription. You should use colons where possible to suppress unne cessary output. " }{TEXT -1 2 "\n\n" }{TEXT 279 10 "Problem 2." } {TEXT -1 176 " Find, using Maple, a triple [m,e,d] where m is the pro duct of two 200 decimal digit primes, e is a random prime number of 10 0 decimal digits and d is the inverse of e modulo " }{XPPEDIT 18 0 "ph i(m);" "6#-%$phiG6#%\"mG" }{TEXT -1 168 ". Use this to encipher some m essage of your choice of at least 4 lines length using the RSA system. Then, decipher the enciphered text to obtain the original message.\n \n" }{TEXT 280 9 "Problem 3" }{TEXT -1 58 ". Given that the m = pq whe re p and q are primes and that " }{XPPEDIT 18 0 "phi(m) = (p-1)*(q-1); " "6#/-%$phiG6#%\"mG*&,&%\"pG\"\"\"F+!\"\"F+,&%\"qGF+F+F,F+" }{TEXT -1 15 ". Suppose that " }{XPPEDIT 18 0 "m = 10^100+598*10^50+67497;" " 6#/%\"mG,(*$\"#5\"$+\"\"\"\"*&\"$)fF)*$F'\"#]F)F)\"&(\\nF)" }{TEXT -1 6 " and " }{XPPEDIT 18 0 "phi(m) = 10^100+596*10^50+66900;" "6#/-%$ph iG6#%\"mG,(*$\"#5\"$+\"\"\"\"*&\"$'fF,*$F*\"#]F,F,\"&+p'F," }{TEXT -1 18 ". Find p and q. \n\n" }{TEXT 331 4 "Hint" }{TEXT -1 2 ": " } {XPPEDIT 18 0 "phi(m) = (p-1)*(q-1);" "6#/-%$phiG6#%\"mG*&,&%\"pG\"\" \"F+!\"\"F+,&%\"qGF+F+F,F+" }{TEXT -1 9 " , Hence " }{XPPEDIT 18 0 "ph i(m) = m-p-q+1;" "6#/-%$phiG6#%\"mG,*F'\"\"\"%\"pG!\"\"%\"qGF+F)F)" } {TEXT -1 29 ". We also have the equation " }{XPPEDIT 18 0 "(p-q)^2 = \+ (p+q)^2-4*p*q;" "6#/*$,&%\"pG\"\"\"%\"qG!\"\"\"\"#,&*$,&F&F'F(F'F*F'*( \"\"%F'F&F'F(F'F)" }{TEXT -1 39 ", as well as the equation m = pq. Us e " }{TEXT 334 5 "solve" }{TEXT -1 192 " to solve these three equation s for the variables p and q. [Actually this can be done by hand withou t too much difficulty.] This will give you a formula for finding p and q as a function of " }{XPPEDIT 18 0 "phi(m);" "6#-%$phiG6#%\"mG" } {TEXT -1 34 " and m. The moral is: if you know " }{XPPEDIT 18 0 "phi(m );" "6#-%$phiG6#%\"mG" }{TEXT -1 25 " you can factor m easily." }} {PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 281 9 "Problem 4" }{TEXT -1 232 ". [This exercise shows that if care is not taken in choosing the \+ primes p and q used in the RSA system that the system can be easily br oken.] Suppose you know that a person's public key modulus m is the f ollowing 200 digit number :" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {XPPEDIT 18 0 "1665718200859 0549877293859320735990648731577415651414508956413467009247675308229223 5735087737299144087247477492337792847654146253083529676393008722822791 99825030962210816740376886176930271167988018683;" "6#\"cw$o=!))z;r-$p< ')oPSn\"3@i4.D)*>zAGs3IRw'HN3`i9aw%GzPB\\xuC(3W\"*HPx3NdB#H#3`nZ#4qY8k &*3XT^cTx:t[1*ft?$fQHx)\\0f3?=dm\"" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 330 65 "Factor m and check your factorization after the factors are fo und" }{TEXT -1 3 ". " }{TEXT 285 18 "Use the following " }{TEXT 282 27 "Fermat factorization method" }{TEXT 286 2 ": " }{TEXT -1 15 " Note that if " }{XPPEDIT 18 0 "m = x^2-y^2;" "6#/%\"mG,&*$%\"xG\"\"#\"\" \"*$%\"yGF(!\"\"" }{TEXT -1 6 " then " }{XPPEDIT 18 0 "m = (x-y)*(x+y) ;" "6#/%\"mG*&,&%\"xG\"\"\"%\"yG!\"\"F(,&F'F(F)F(F(" }{TEXT -1 8 ". So if " }{XPPEDIT 18 0 "1 < x-y;" "6#2\"\"\",&%\"xGF$%\"yG!\"\"" }{TEXT -1 198 " we have a non-trivial factorization of m. If m is a product o f just two primes then one will be x - y and the other will be x + y. \+ This is the basis of the Fermat factorization method. Note that " } {XPPEDIT 18 0 "m = x^2-y^2" "6#/%\"mG,&*$%\"xG\"\"#\"\"\"*$%\"yGF(!\" \"" }{TEXT -1 18 " is equivalent to " }{XPPEDIT 18 0 "x^2-m = y^2;" "6 #/,&*$%\"xG\"\"#\"\"\"%\"mG!\"\"*$%\"yGF'" }{TEXT -1 35 ". So if for \+ some number x we have " }{TEXT 283 34 "type(sqrt(x^2 - m),integer) = t rue" }{TEXT -1 17 " then we can set " }{TEXT 352 18 "y = sqrt(x^2 - m) " }{TEXT -1 70 "and using the above idea we may factor m. Fermat's m ethod is to take " }{TEXT 353 4 "x = " }{XPPEDIT 354 0 "ceil(sqrt(m)); " "6#-%%ceilG6#-%%sqrtG6#%\"mG" }{TEXT -1 59 " and keep incrementing x by 1 till an x is found such that " }{XPPEDIT 355 0 "x^2-m;" "6#,&*$% \"xG\"\"#\"\"\"%\"mG!\"\"" }{TEXT -1 12 " is a square" }{TEXT 284 3 ". " }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 31 "[Note that you may need to use " }{TEXT 287 24 "ceil(eval f(sqrt(m),200))" }{TEXT -1 3 ".] " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 272 "If the number m is a product of two prim es that are relatively close together then this method will factor m q uickly. If you do not find the factors in just a few seconds, you prob ably have a bug in your program. For some reason Maple does not have t his method built in. \n" }}}}}{MARK "2" 0 }{VIEWOPTS 0 0 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 1 1 1 33 1 1 }