{VERSION 3 0 "SGI MIPS UNIX" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "2D Input" 2 19 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "2 D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 " " 0 1 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 "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 18 "" 0 "" {TEXT -1 23 "MAT312: Applied Algebra" }} {PARA 18 "" 0 "" {TEXT -1 19 "Computer project #1" }}{PARA 19 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 19 8 "Message " }{TEXT 18 239 "b elow is a message which has been encrypted using the RSA public key al gorithm. In its encrypted form, it consists of 12 numbers of about \+ 210 decimal digits each. To get Maple to read it, you must hit the e nter key for each statement." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2553 "Message :=[\n2506687366489 7638140085303971169651970027323900993076899383071677609322867743924029 5257178981316117701965624531104681458002208123032739455036441595688900 759757446466769583605417595786288394551208695477810891237, 24784968265 5655471804778511653871068180575500506496445672016587529503240181045730 2506157539950880634253546180590506024796659396683413536962166327024423 84515847788360895757550652478657543926477631892150313607981, 158888150 6235651965103917827362855488493455874440804424153506787724334638736063 8182465878743390528332866873169227109134388368844477059275432437081228 8411526113824574066229853220150124534146420063066674871855199, 1171312 0866445676943254732114223162365704806282768849831417770173605433053267 5519552661766304185661524609961916813128312161514809099995726998115418 381951863530436556157042842660730462932805835224547159284816740, 26712 0648655711195114497528395544897196016955040936469542380483686533524849 8352694386098392888868002540972045337279551168740642502811725197304531 70348333981151651248228551415519215212586190598658444540481109856, 677 7906472735566816243836385657453513205134744604240536631988497498214533 6362396676349416077111575671613221425354563748712888678352156325550591 90354761033008989984565322669665188828297490724841391423164185633, 265 0605063384209761477025434619955419838813369037038035145177010312321054 2796604854876783562644860459915128778567766115967109415085972370725447 6140521486489354114718637027760701307547925715802976542431336473443, 2 1092557005712995912983012607225038468597999935512627981724216475262099 0494825428163700890823013307942267277918208857036332759955422909551928 768341433501401849297988437512790988023406088121035312585410317782475, 658669531488053063427327216533844273461060489685756364391651542910487 1285747419778037063268509510499966434028880834117396301356882661652883 7758313014516195657318311016628854261310963745162078100050716226611115 , 16036480732165435511717302450423177727375044892129676032240851923055 9210201182897852667639536616716633724735675259319287829292309149745538 2030361917121196627480268161069762959767156228230337172868444154864238 24, 226348620153385254622143996318532553026502038858722559629681446428 2169925574989395098213380935584065707345125666089413766583060587137440 2215308157914746451446315439926583558026584604175233506754955057517713 0890, 9765920028938720280000088416637335196913605308565795158492543170 2078703423201001205142438546998319164792543498737530279138080277711254 6417109863078342753713824010093251498117508837748016250276335043947243 86126\n]:" }{TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 69 "To reference any one of the numbers in the message, use the notation " }{TEXT 19 10 "Message[n]" }{TEXT -1 9 " for the " }{XPPEDIT 18 0 "n^th;" "6#)%\" nG%#thG" }{TEXT -1 20 " number in the list." }}{PARA 0 "" 0 "" {TEXT -1 73 "(note that the : at the end of the statement supresses any Mapl e output.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 44 "The message was encoded using the following " }{TEXT 19 4 "base " }{TEXT -1 74 ", which happens to be the product of two primes of abo ut 100 digits each. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 219 "bas e := 30645237836843904806816346282773271851874635743981678646285352705 1887614619645017555473997034658600670196373847577090557186847481568857 5148639434207680791924965821038451065702409095292295135390679933744604 89159;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 137 "The message was encoded using the exponent below, which will be o f little help in deciphering the message. However, you could use it t o " }}{PARA 0 "" 0 "" {TEXT -1 22 "forge a different one." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 109 "encodingExponent:=1872782342363042 6394917883250872196001257120579902357744184497884282647216527538382593 9373;" }}}{PARA 0 "" 0 "" {TEXT -1 14 "The exponent " }{TEXT 19 1 "x " }{TEXT -1 63 " below will allow you to decipher the message, by com puting , " }{XPPEDIT 19 1 "a^x;" "6#)%\"aG%\"xG" }{TEXT -1 5 " mod " } {XPPEDIT 19 1 "base;" "6#%%baseG" }{TEXT -1 9 ", where " }{XPPEDIT 19 1 "a;" "6#%\"aG" }{TEXT -1 45 " represents each number in the messa ge above." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 215 "x := 98246007475185045209994421243798892261304114349 0535054203552630969073441462583645630894836103108240682747507658949699 7390708757122628367151859091212055673903930387563218530109465392784229 4310968495586626369445;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 586 "Of course, the resulting computation gives you nu mbers, and you would like something you can read. To do so, you will \+ need to know how the words were converted to large integers. Here's h ow: the message was read in 47 characters at a time. Each character \+ was viewed as a number between 0 and 127 (by assigning it the correspo nding ASCII code), and the resulting block was interpreted as a 47-dig it number in base 128 (such numbers are about 210 digits long when wr itten in base 10). Spaces, punctuation, line breaks, and so on were tr eated as part of the message, and also encoded." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 92 "For example, to encode th e first 47 characters of the previous paragraph, we would compute " } }{PARA 0 "" 0 "" {TEXT -1 3 " " }{XPPEDIT 18 0 "79*128^46+102*128^45 +32*128^44+99*128^43+111*128^42;" "6#,,*&\"#z\"\"\"*$\"$G\"\"#YF&F&*& \"$-\"F&*$\"$G\"\"#XF&F&*&\"#KF&*$\"$G\"\"#WF&F&*&\"#**F&*$\"$G\"\"#VF &F&*&\"$6\"F&*$\"$G\"\"#UF&F&" }{TEXT -1 8 "+ ... + " }{XPPEDIT 18 0 " 32*128^3+121*128^2+111*128+117;" "6#,**&\"#K\"\"\"*$\"$G\"\"\"$F&F&*& \"$@\"F&*$\"$G\"\"\"#F&F&*&\"$6\"F&\"$G\"F&F&\"$<\"F&" }{TEXT -1 1 " \+ " }}{PARA 0 "" 0 "" {TEXT -1 246 "because O=79, f=102, space=32, c=99, o=111, (and so on) in the ASCII code. To write such a number as prin table text, we just reverse the process. Rather than make you worry h ow to do all that, below is a little Maple procedure which does that: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 165 "PrintNumberAsText:= proc(num)\n local i,p,k;\n p:=128;\n k :=47;\n printf(\"%s\",\n convert([seq( iquo(modp(num,p^(k-i+ 1)), p^(k-i)), i=1..k)],'bytes'));\n end;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "Make sure that you can use " } {TEXT 19 17 "PrintNumberAsText" }{TEXT -1 1 " " }{TEXT 19 0 "" }{TEXT -1 142 "to decipher what the number below represents. (Note that this process, while hard for people to read, is NOT encryption, merely tra nslation)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 111 "trialnum:= 767881737176172013294653540993500170940 865317690485262301912883980080798615353381549606267397341184;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 92 "Finally, you might need to know how to compute powers modulo p in Maple-- you do this using " }{TEXT 19 2 "&^" }{TEXT -1 5 " and " }{TEXT 19 3 "mod" }{TEXT -1 26 ". For e xample, to compute" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "` mod`(5^2,4);" "6#-%$modG6$*$\"\"&\"\"#\"\"%" }{TEXT -1 21 ", we do the following" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "5 &^ 2 mod 4; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"\"" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 113 "A more complicated example mig ht be to compute the third number in the message raised to the 178th p ower, mod 47:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "Message[3] \+ &^ 178 mod 47;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#M" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 106 "or, if you prefer to write modular arith metic in functional notation, you could write the same command as " }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "modp(Message[3] &^ 178, 47) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#M" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "That should be enough informati on to do the project." }}{PARA 0 "" 0 "" {TEXT -1 50 "You are now fina lly ready to decipher the message!" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "36 0" 2 }{VIEWOPTS 1 1 0 3 2 1804 }