{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 "" -1 256 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{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 "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 "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 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 } {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 6 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Geneva" 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 "" 18 257 1 {CSTYLE "" -1 -1 "Geneva" 0 1 0 0 0 0 0 0 0 0 0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va" 0 1 0 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 }} {SECT 0 {EXCHG {PARA 257 "" 0 "" {TEXT -1 11 "Secure mail" }}{PARA 258 "" 0 "" {TEXT -1 38 "\251 Mike May, S. J., 2002, maymk@slu.edu" }} }{EXCHG {PARA 259 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 260 "" 0 "" {TEXT -1 225 "We want to look at sending a collection of c oncepts we have been working on in class for an application like sendi ng and receiving secured mail. We will use DES as our symmetric block cipher and RSA as our public key cipher." }}{PARA 261 "" 0 "" {TEXT -1 0 "" }}{PARA 262 "" 0 "" {TEXT -1 309 "The intent is to be able to \+ send an encrypted message over an open channel in such a way that it i s secure from eavesdropping, and such that the intended recipient know s who sent the message and that it has not been tampered with. (The r ecipient should be assured to both message integrity and authenticity. )" }}}{EXCHG {PARA 263 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 264 "" 0 "" {TEXT -1 22 "Encrypting the message" }}{EXCHG {PARA 265 " " 0 "" {TEXT -1 48 "We start with a message that we will be sending." }}}{EXCHG {PARA 266 "> " 0 "" {MPLTEXT 1 0 591 "message := \"This is a n attempt to look at a reasonable way to send a message\nin such a way that it is encrypted, but that the receiver can also revify that\nthe message is really from me, and that no one has tampered with it after I\nsigned the message. There are several pieces to deal with. I nee d to hash\nthe message down to a digest of reasonable length. We will do that with DES.\nAfter we have a hashed digest, we sign it with RSA . Then, since I want to have \nthe message decrypted by the intended \+ recipient alone, I encrypt the session key\nwith RSA and the receiver' s public key. x\":" }}}{EXCHG {PARA 267 "" 0 "" {TEXT -1 431 "We want \+ to encrypt the message with DES used in Cipher Block Chaining mode. Y ou can either rerun the DES constants and DES functions worksheets to \+ load the constants and commands, or you can read them in from a file. \+ To read the DES.m file, you need to copy the file to the current dire ctory. On a Macintosh, that is the directory with the Maple applicati on. The current directory can be determined by the currentdir() comma nd." }}}{EXCHG {PARA 268 "> " 0 "" {MPLTEXT 1 0 13 "currentdir();" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#Q)C:\\maple6\"" }}}{EXCHG {PARA 269 " " 0 "" {TEXT -1 158 "Either copy DES.m to the current directory before proceeding or create it on your own machine by running the DESConstan ts.mws and DESFunctions.mws worksheets." }}}{EXCHG {PARA 270 "> " 0 " " {MPLTEXT 1 0 13 "read `DES.m`;" }}}{EXCHG {PARA 271 "" 0 "" {TEXT -1 276 "To prepare the message for encryption with DES, we want to bre ak it into hex words of 64 bits. Each word corresponds to 8 ASCII cha racters, so we pad the message out with null characters so that the nu mber of characters is divisible by 8. We also record the number of wo rds." }}}{EXCHG {PARA 272 "> " 0 "" {MPLTEXT 1 0 104 "messLength := le ngth(message);\nmessWords := ceil(messLength/8);\nmessPadding := 8*mes sWords - messLength;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%+messLengthG \"$x&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%*messWordsG\"#t" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%,messPaddingG\"\"(" }}}{EXCHG {PARA 273 "> " 0 "" {MPLTEXT 1 0 88 "messList := convert(message, bytes):\nmessLis t := [op(messList),seq(0,i=1..messPadding)]:" }}}{EXCHG {PARA 274 "> \+ " 0 "" {MPLTEXT 1 0 63 "intTo2Hex := intVal -> substring(convert(intVa l+256,hex),2..3):" }}}{EXCHG {PARA 275 "> " 0 "" {MPLTEXT 1 0 119 "mes sHexList := map(intTo2Hex,messList):\nmessHexWordList := [seq(cat(seq( messHexList[8*i+j],j=1..8)),i=0..messWords-1)];" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%0messHexWordListG7eo%15468697320697320G%1616E20617474 656DG%1707420746F206C6FG%16F6B206174206120G%1726561736F6E6162G%16C6520 7761792074G%16F2073656E642061G%1206D657373616765G%10A696E2073756368G%1 2061207761792074G%16861742069742069G%17320656E63727970G%17465642C20627 574G%12074686174207468G%16520726563656976G%165722063616E2061G%16C736F2 072657669G%1667920746861740AG%1746865206D657373G%16167652069732072G%16 5616C6C79206672G%16F6D206D652C2061G%16E64207468617420G%16E6F206F6E6520 68G%161732074616D7065G%17265642077697468G%12069742061667465G%17220490A 7369676EG%1656420746865206DG%16573736167652E20G%12054686572652061G%172 65207365766572G%1616C207069656365G%17320746F20646561G%16C20776974682E2 0G%12049206E65656420G%1746F20686173680AGF8%161676520646F776EG%120746F2 061206469G%167657374206F6620GF*%16C65206C656E6774G%1682E202057652077G% 1696C6C20646F2074G%16861742077697468G%1204445532E0A4166G%1746572207765 2068G%16176652061206861G%17368656420646967G%16573742C20776520G%1736967 6E20697420G%17769746820525341G%12E20205468656E2CG%12073696E63652049G%1 2077616E7420746FG%12068617665200A74G%16865206D65737361G%16765206465637 279G%17074656420627920G%174686520696E7465G%16E64656420726563G%16970696 56E742061G%16C6F6E652C204920G%1656E637279707420G%17468652073657373G%16 96F6E206B65790AGFX%120616E6420746865G%12072656365697665G%1722773207075 626CG%16963206B65792E20G%17800000000000000G" }}}{EXCHG {PARA 276 "" 0 "" {TEXT -1 195 "To encrypt this message with DES in CBC mode I need a key and an initial value. We choose the key at random. (This ignore s the fine point that every eighth bit of a key should be a parity bit .)" }}}{EXCHG {PARA 277 "> " 0 "" {MPLTEXT 1 0 59 "randKey := substrin g(convert(2^64+rand(2^64)(),hex),2..17);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(randKeyG%17778EEFFF432E596G" }}}{EXCHG {PARA 278 "" 0 "" {TEXT -1 0 "" }{TEXT 256 0 "" }{TEXT -1 130 "In order to reproduce res ults we record the key as 7778EEFFF432E596. We expand this key with t he command from the DES worksheets." }}}{EXCHG {PARA 279 "> " 0 "" {MPLTEXT 1 0 59 "randKey := \"7778EEFFF432E596\":\nkey := keyexpander( randKey):" }}}{EXCHG {PARA 280 "" 0 "" {TEXT -1 63 "Our initial value \+ will be the zero word encrypted with our key." }}}{EXCHG {PARA 281 "> \+ " 0 "" {MPLTEXT 1 0 81 "allZeroes := substring(convert(2^64+0,hex),2.. 17);\nIV := qdDEShex(allZeroes,key);" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#>%*allZeroesG%10000000000000000G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >%#IVGQ104844CB2337C0CC26\"" }}}{EXCHG {PARA 282 "" 0 "" {TEXT -1 180 "We now encrypt the message with with DES in CBC mode. The first word uses the initial value and the first word of the message. The rest o f the message in then encrypted in a loop" }}}{EXCHG {PARA 283 "> " 0 "" {MPLTEXT 1 0 176 "cipherTable[1] := qdDEShex(xor64hex(IV,messHexWor dList[1]),key);\nfor i from 2 to messWords do\ncipherTable[i] := qdDES hex(xor64hex(cipherTable[i-1],messHexWordList[i]),key):\nod:" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%,cipherTableG6#\"\"\"%1CFE5523C29D556BFG " }}}{EXCHG {PARA 284 "" 0 "" {TEXT -1 112 "Time for a technical adjus tment. We want to convert the format of the encrypted message from a \+ table to a list." }}}{EXCHG {PARA 285 "> " 0 "" {MPLTEXT 1 0 40 "ciphe rList := convert(cipherTable,list);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6 #>%+cipherListG7eo%1CFE5523C29D556BFG%196F0272D4A3A54E4G%17EB9FE4EDA6B B7F5G%197AE9F3B9962C5A5G%11347D0568C88B728G%1C623BCA4F38195DCG%1F933A4 B073ED3112G%1B91012489AC26DAEG%1EFD8057D6FD221BDG%11295F50C701D1D2AG%1 6F6DFA21417FAA4AG%17141B83C93FD20B6G%1E69DCE99E7250748G%1FE176522609FF 31BG%14A4C6F06D3777871G%1AF0F92A74F6BEC46G%162FD8DDE9EE32D60GQ10CB6D35 244F2E4426\"%16A967981EA02B712G%172CC1609326E70E8G%1B0DED0ECA222C388G% 1752B36EFD2577F58G%1453BB651C1E38943G%1281EAA993BC733C8G%1266339ECE05A EC2BG%1F042F363E0407FC0G%1399568B48B4DEE1BG%16795E99D5464A384G%1BC17EA AC8D5E4668G%1D1350C559437085CG%18A713C993AC9797FG%1409D82BB0A4E31E9G%1 DB5C8F9438DD8E47G%1F0FAB6F37EC1D37EG%12ABA3EB9FD4F2880G%146416F72365B3 D50G%1B85739A2776D053FG%184FC96A4F62FAC39G%15ABF5E07AA8AD34EG%1A0FDF34 99984D67FG%1F3FCD3D6AC6AEF93G%1A14644D8C85838D1G%1E7D72469150DBA19G%12 E1D829A60388C20G%16718F326DB8347C4G%13E0135B8172EB1DCG%1B0628989325F47 F9G%14F43A4AE9F3A3E8AG%19B734D47D058A4FAG%110D0EC2185334AA9G%157DD05A5 68A1298AG%1F3950DBD3FD36DD1GQ10001188AEE7CE1F2F8%1919E055417230178G%16 5E51F33A12038C2G%19CAB5B56319968D5G%1541D06B4F4BED47AG%137CB3A45D19969 8EGQ1077BAFF5CA62F4B8F8%1E75D714902E9AF89G%1A587EDFFCD7870A1G%113D9E02 08439CA65G%18FA36034F7CFB55DG%15FE1295449ED3D04GQ1074B76973A2AD3CAF8%1 3240DED15561C814G%19700F1A93DB61F1EGQ10B1A9419B9D4DEDEF8%1C7541B456A78 272FG%1B6919537C24376E3G%1D3EC4451D3A8B3B6G%129D4B2C2FF8D4A48G%17C54E0 8D43AEC1AFG" }}}{EXCHG {PARA 286 "" 0 "" {TEXT -1 35 "Thus we have enc rypted the message." }}}}{SECT 0 {PARA 287 "" 0 "" {TEXT -1 47 "Signin g the hash and encrypting the session key" }}{EXCHG {PARA 288 "" 0 "" {TEXT -1 115 "For the purpose of digital signatures, we will consider \+ the last word of the message to be the hash of the message." }}} {EXCHG {PARA 289 "> " 0 "" {MPLTEXT 1 0 30 "hash := cipherList[messWor ds];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%hashG%17C54E08D43AEC1AFG" } }}{EXCHG {PARA 290 "" 0 "" {TEXT -1 286 "We want to use RSA for two fu nctions. We want to encrypt the session key so our recipient can decr ypt the message. We also want to sign the hash. To sign the hash wit h RSA we produce our primes and our public n. We then set 2^16 + 1 as our standard encryption key, and we compute d." }}}{EXCHG {PARA 291 " > " 0 "" {MPLTEXT 1 0 63 "p := nextprime(rand(10^80)());;\nq := nextpr ime(rand(10^80)());;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"pG\"[ptSh0 Vgo<7uHs&3AA1K!Q0$QvYn(*=(e%eNcVhDuuptI$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"qG\"[pJT$))\\g\\nr0V)3gTfp\"RqX!\\zrzjr[v+JbE&>\")f#4u.!)" } }}{EXCHG {PARA 292 "> " 0 "" {MPLTEXT 1 0 286 "Senderp := 330736974742 56143563558458718976746753830538032062222085722974121768604305614073: \nSenderq := 800374092598119526553100754871637971794904570391695941600 88430571674960498834131:\nSendern := Senderp*Senderq;\nSendere := 2^16 +1;\nSenderd := (1/Sendere) mod ((Senderp-1)*(Senderq-1)):" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%(SendernG\"[ujbKEX$fepG264V)3x3M([O>l%pIc* )pWwLSfq%[eC]NtQ2]%>o_M$y-#ygTk8`!oJ^[B#H^j^9twa&yC#[gI8ZE" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(SendereG\"&Pb'" }}}{EXCHG {PARA 293 "" 0 "" {TEXT -1 111 "We publish (Sendern, Sendere) as our public key. To \+ sign the hash we encrypt the hash with our decryption key." }}}{EXCHG {PARA 294 "> " 0 "" {MPLTEXT 1 0 127 "digestNum := convert(hash, decim al, hex);\nsignature := Power(digestNum,Senderd) mod Sendern;\nsigHex \+ := convert(signature, hex);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%*dige stNumG\"4ZgHxgXK!f*)" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%*signatureG \"[uq5Ht7()Q!o0(*f$*H-1;Hz#zK_0WscF&fp'R$*[.I]FaM%4s`OV=1WicIEm&)>#yMh +GXtHLU$[d(oBO*3;Tz-P)fC" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%'sigHexG %`s2CCA706E7E7864A48915A4B0A2A3EF20D56C920BD79B48B15B66B982576BEB36884 15EECC0474C48649ED7AC322A9DFD7E811221FFB0DA8EC67B66EF51C721323BD3EG" } }}{EXCHG {PARA 295 "" 0 "" {TEXT -1 86 "To encrypt the session key, we need the receiver's public key, (Receivern, Receivere)." }}}{EXCHG {PARA 296 "> " 0 "" {MPLTEXT 1 0 63 "p := nextprime(rand(10^80)());;\n q := nextprime(rand(10^80)());;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>% \"pG\"[prMw!fb\")>2j[Yh3IN0^*\\t%\\i?zI&RJSkh%>qu`k\"zX?" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%\"qG\"[pj$)yqknt%4NZXowLH)fnu$*4g(>7)*31gsK(4^ Ga_4Pn#*" }}}{EXCHG {PARA 297 "> " 0 "" {MPLTEXT 1 0 306 "Receiverp := 204579164537470194616440313953079206249473499510535300861464863071981 55590763471:\nReceiverq := 9267370952542851097327260060898121976009937 4675982933766845473509473676470788363:\nReceivern := Receiverp*Receive rq;\nReceivere := 2^16+1:\nReceiverd := (1/Receivere) mod ((Receiverp- 1)*(Receiverq-1));" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%*ReceivernG\"[ utzGK%GU3/]tIh?9rgsVXVvk1X`&fu_yo\"4yb*=$***)Rl*p^wQ.$3%R\"4VgC&RxZ=QG fs0%)ywHbk86#e.Ip+6f*=" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%*Receiverd G\"[uLQ3MsX*Qz%>pA=vXeGC!*o+'G!p.ivJCzPs9f&\\#Q!*[T,&oD1*\\!*oDVVKAa:@ rSn?6NH%))R0ToyVUBuyF)yV$p\"" }}}{EXCHG {PARA 298 "> " 0 "" {MPLTEXT 1 0 138 "keyNum := convert(randKey, decimal, hex);\nencryptKey := Powe r(keyNum, Receivere) mod Receivern:\nencryptKeyHex := convert(encryptK ey, hex);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'keyNumG\"4]0v*zqM*)3') " }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%.encryptKeyHexG%`s10F36CDAE57F66 5A367984588EC59ACACFD57D31338F7C119F57E5AFE25B13E06BB669508542CE257DB9 55EE4BD8840830EE5C728A470EEC8E267BBCB113000F29C5EG" }}}}{SECT 0 {PARA 299 "" 0 "" {TEXT -1 11 "The message" }}{EXCHG {PARA 300 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 301 "" 0 "" {TEXT -1 44 "Putting thi ngs together we have our message." }}{PARA 302 "" 0 "" {TEXT -1 0 "" } }{PARA 303 "" 0 "" {TEXT -1 1453 "cipherList := [CFE5523C29D556BF, \"9 6F0272D4A3A54E4\", \"7EB9FE4EDA6BB7F5\", \"97AE9F3B9962C5A5\", \"1347D 0568C88B728\", C623BCA4F38195DC, F933A4B073ED3112, B91012489AC26DAE, \+ \"88AC794BF81A3613\", \"027979270A6CE25E\", \"1FF04858A850FB18\", \"72 B6F715E5F0B050\", \"302DA487928942DD\", \"400825FF341D62FF\", \"25BAB3 DFAA300C6E\", DF6548D262CCDB76, \"155112EEC2A35653\", \"3626EB94C95083 87\", F923D7D04BA91C3C, \"4541DD7ED88DF681\", B80954BD64B25BD1, E5DDE2 260FA80D54, \"553431C417C63262\", \"238AEC42B48D39F9\", \"001F68168A03 DC79\", F0F26735387BEAFE, ABF29815E6EEF280, \"1CE591E013397E46\", AE25 3A8F2CB920F5, \"6CDD5CF57DB814E9\", \"538EDF12831AAF07\", D16DA28C099F BCD2, \"16EA042321E8C07C\", \"4B4E3A3A240CD134\", \"008A4839BB5A902A\" , \"1D9EF4F67B9D790F\", \"315D4ABFE6FD552A\", \"5B8EC53DB56BE2F0\", \" 8764D129BE79A2AE\", E468BD18F31EFC89, \"041B1B2EDD8609F2\", \"94084157 231C1D69\", \"7592C6C37E571E88\", \"1AE32E4143FDBD02\", \"4F46C82DF30E 8C7B\", C4CEC8AC4B918453, \"43B15827F8831008\", F47E5AA003E98FEC, \"5B 2581BC8F0D5FD8\", \"2463B68E42F65963\", \"614F5FEFF34EECE6\", \"1F5FBB 2D65D5D1B0\", EE611B55060418A9, \"78EDFE10B983D58F\", E0DCBAE6A02405A2 , \"089157D36419A8A8\", A82D7722C7302B21, \"755443BF881CDAA8\", \"9F9A 275493C95772\", \"673AF1ED886F45FA\", \"1666C6E7E5F342ED\", C44E2FB386 806250, EC429290D9DE3961, D69AFA699BC1B350, A558FC5AD6134C13, \"3836A7 16B9D63336\", FAA592E49F503D7B, \"793C737ADDBD5ECE\", \"00912BAFAE5F4E 4F\", \"1C297C183126E230\", \"6A69015002985748\", \"01A14542FEBCBC8E\" , D058ADE681825447];\nhash := D058ADE681825447;" }}{PARA 304 "" 0 "" {TEXT -1 299 "sigHex := \"151746B988F8A7879A20548871F96A4D40CE8CBFB826 381F26183F2209C8D4E75460CC3617781B018BEF0DB767E18ECE809551514E0479C54F 188697160FCD867C088\"\nencryptKeyHex := \"10F36CDAE57F665A367984588EC5 9ACACFD57D31338F7C119F57E5AFE25B13E06BB669508542CE257DB955EE4BD8840830 EE5C728A470EEC8E267BBCB113000F29C5E\";" }}{PARA 305 "" 0 "" {TEXT -1 188 "Sendern := 264713306048224785547673145163512922348513168053136441 6078202783345268194500738733550245848470594033764469895630694651936487 340877088430911072869585934526325563\nSendere := 65537" }}}{EXCHG {PARA 306 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 307 "" 0 "" {TEXT -1 19 "Reading the message" }}{EXCHG {PARA 308 "" 0 "" {TEXT -1 198 "To put ourselves in the position of the receiver, we restart to c lear the memory. The receiver knows the public key of the sender and \+ the receiver's private key. The receiver also has our message." }}} {EXCHG {PARA 309 "> " 0 "" {MPLTEXT 1 0 22 "restart;\nread `DES.m`:" } }}{EXCHG {PARA 310 "> " 0 "" {MPLTEXT 1 0 540 "Receivern := 1895911006 9300358211136455297678840572592838184777395246043091394083033876516996 5398999318955780916878527459553450664754345437260711420613073500408422 8432287973:\nReceiverd := 16934378827787423424378684105398842935112067 4071211554223243432568904990625685014148903824955914723779243175620369 0286006890242858457518226919479389457234083833:\nSendern := 2647133060 4822478554767314516351292234851316805313644160782027833452681945007387 3355024584847059403376446989563069465193648734087708843091107286958593 4526325563:\nSendere := 65537:" }}}{EXCHG {PARA 311 "> " 0 "" {MPLTEXT 1 0 1728 "cipherList := [CFE5523C29D556BF, \"96F0272D4A3A54E4 \", \"7EB9FE4EDA6BB7F5\", \"97AE9F3B9962C5A5\", \"1347D0568C88B728\", \+ C623BCA4F38195DC, F933A4B073ED3112, B91012489AC26DAE, \"88AC794BF81A36 13\", \"027979270A6CE25E\", \"1FF04858A850FB18\", \"72B6F715E5F0B050\" , \"302DA487928942DD\", \"400825FF341D62FF\", \"25BAB3DFAA300C6E\", DF 6548D262CCDB76, \"155112EEC2A35653\", \"3626EB94C9508387\", F923D7D04B A91C3C, \"4541DD7ED88DF681\", B80954BD64B25BD1, E5DDE2260FA80D54, \"55 3431C417C63262\", \"238AEC42B48D39F9\", \"001F68168A03DC79\", F0F26735 387BEAFE, ABF29815E6EEF280, \"1CE591E013397E46\", AE253A8F2CB920F5, \" 6CDD5CF57DB814E9\", \"538EDF12831AAF07\", D16DA28C099FBCD2, \"16EA0423 21E8C07C\", \"4B4E3A3A240CD134\", \"008A4839BB5A902A\", \"1D9EF4F67B9D 790F\", \"315D4ABFE6FD552A\", \"5B8EC53DB56BE2F0\", \"8764D129BE79A2AE \", E468BD18F31EFC89, \"041B1B2EDD8609F2\", \"94084157231C1D69\", \"75 92C6C37E571E88\", \"1AE32E4143FDBD02\", \"4F46C82DF30E8C7B\", C4CEC8AC 4B918453, \"43B15827F8831008\", F47E5AA003E98FEC, \"5B2581BC8F0D5FD8\" , \"2463B68E42F65963\", \"614F5FEFF34EECE6\", \"1F5FBB2D65D5D1B0\", EE 611B55060418A9, \"78EDFE10B983D58F\", E0DCBAE6A02405A2, \"089157D36419 A8A8\", A82D7722C7302B21, \"755443BF881CDAA8\", \"9F9A275493C95772\", \+ \"673AF1ED886F45FA\", \"1666C6E7E5F342ED\", C44E2FB386806250, EC429290 D9DE3961, D69AFA699BC1B350, A558FC5AD6134C13, \"3836A716B9D63336\", FA A592E49F503D7B, \"793C737ADDBD5ECE\", \"00912BAFAE5F4E4F\", \"1C297C18 3126E230\", \"6A69015002985748\", \"01A14542FEBCBC8E\", D058ADE6818254 47]:\nsigHex := \"151746B988F8A7879A20548871F96A4D40CE8CBFB826381F2618 3F2209C8D4E75460CC3617781B018BEF0DB767E18ECE809551514E0479C54F18869716 0FCD867C088\":\nencryptKeyHex := \"10F36CDAE57F665A367984588EC59ACACFD 57D31338F7C119F57E5AFE25B13E06BB669508542CE257DB955EE4BD8840830EE5C728 A470EEC8E267BBCB113000F29C5E\":" }}}{EXCHG {PARA 312 "" 0 "" {TEXT -1 39 "Check first that the signature matches." }}}{EXCHG {PARA 313 "> " 0 "" {MPLTEXT 1 0 145 "signature := convert(sigHex, decimal, hex):\nsi gD := Power(signature,Sendere) mod Sendern;\nhashRecover := substring( convert(2^64+sigD,hex),2..17);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%s igDG\"5jQVmLcSH,:" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%,hashRecoverG%1 D058ADE681825447G" }}}{EXCHG {PARA 314 "" 0 "" {TEXT -1 76 "Next the r eceiver recovers the session key using the receiver's private key;" }} }{EXCHG {PARA 315 "> " 0 "" {MPLTEXT 1 0 163 "encryptKey := convert(en cryptKeyHex,decimal,hex):\nkeyNum := Power(encryptKey, Receiverd) mod \+ Receivern:\nsessionKey := substring(convert(keyNum + 2^64, hex),2..17) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%+sessionKeyG%17778EEFFF432E596G " }}}{EXCHG {PARA 316 "" 0 "" {TEXT -1 90 "Now the receiver starts dec rypting the message with the standard procedure for CBC mode. " }}} {EXCHG {PARA 317 "> " 0 "" {MPLTEXT 1 0 113 "key := keyexpander(sessio nKey):\nallZeroes := substring(convert(2^64+0,hex),2..17):\nIV := qdDE Shex(allZeroes,key);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#IVGQ104844C B2337C0CC26\"" }}}{EXCHG {PARA 318 "> " 0 "" {MPLTEXT 1 0 41 "messWord s := linalg[vectdim](cipherList);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#> %*messWordsG\"#t" }}}{EXCHG {PARA 319 "> " 0 "" {MPLTEXT 1 0 165 "plai nTable[1] := xor64hex(unDEShex(cipherList[1],key), IV):\nfor i from 2 \+ to messWords do\nplainTable[i] := xor64hex(unDEShex(cipherList[i],key) , cipherList[i-1]);\nod:" }}}{EXCHG {PARA 320 "> " 0 "" {MPLTEXT 1 0 38 "plainList := convert(plainTable,list);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%*plainListG7eo%15468697320697320G%1616E20617474656DG% 1707420746F206C6FG%16F6B206174206120G%1726561736F6E6162G%16C6520776179 2074G%16F2073656E642061G%1206D657373616765GQ10D696E20737563686\"%12061 207761792074G%16861742069742069G%17320656E63727970G%17465642C20627574G %12074686174207468G%16520726563656976G%165722063616E2061G%16C736F20726 57669G%1667920746861740DG%1746865206D657373G%16167652069732072G%165616 C6C79206672G%16F6D206D652C2061G%16E64207468617420G%16E6F206F6E652068G% 161732074616D7065G%17265642077697468G%12069742061667465G%17220490D7369 676EG%1656420746865206DG%16573736167652E20G%12054686572652061G%1726520 7365766572G%1616C207069656365G%17320746F20646561G%16C20776974682E20G%1 2049206E65656420G%1746F20686173680DGF9%161676520646F776EG%120746F20612 06469G%167657374206F6620GF*%16C65206C656E6774G%1682E202057652077G%1696 C6C20646F2074G%16861742077697468G%1204445532E0D4166G%17465722077652068 G%16176652061206861G%17368656420646967G%16573742C20776520G%17369676E20 697420G%17769746820525341G%12E20205468656E2CG%12073696E63652049G%12077 616E7420746FG%12068617665200D74G%16865206D65737361G%16765206465637279G %17074656420627920G%174686520696E7465G%16E64656420726563G%1697069656E7 42061G%16C6F6E652C204920G%1656E637279707420G%17468652073657373G%1696F6 E206B65790DGFY%120616E6420746865G%12072656365697665G%1722773207075626C G%16963206B65792E20G%17800000000000000G" }}}{EXCHG {PARA 321 "" 0 "" {TEXT -1 32 "Finally we convert back to text," }}}{EXCHG {PARA 322 "> \+ " 0 "" {MPLTEXT 1 0 101 "plainListBytes := map(x -> seq(convert(substr ing(x,2*i+1..2*i+2),decimal,hex),i=0..7),\n plainList):" }}}{EXCHG {PARA 323 "> " 0 "" {MPLTEXT 1 0 42 "received := convert(plainListByte s,bytes);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%)receivedGQ\\_mThis~is~ an~attempt~to~look~at~a~reasonable~way~to~send~a~message|.in~such~a~wa y~that~it~is~encrypted,~but~that~the~receiver~can~also~revify~that|.th e~message~is~really~from~me,~and~that~no~one~has~tampered~with~it~afte r~I|.signed~the~message.~~There~are~several~pieces~to~deal~with.~~I~ne ed~to~hash|.the~message~down~to~a~digest~of~reasonable~length.~~We~wil l~do~that~with~DES.|.After~we~have~a~hashed~digest,~we~sign~it~with~RS A.~~Then,~since~I~want~to~have~|.the~message~decrypted~by~the~intended ~recipient~alone,~I~encrypt~the~session~key|.with~RSA~and~the~receiver 's~public~key.~x6\"" }}}{EXCHG {PARA 324 "" 0 "" {TEXT -1 71 "This bec omes easier to read if it is converted from a string to a name." }}} {EXCHG {PARA 325 "> " 0 "" {MPLTEXT 1 0 24 "convert(received, name);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#%\\_mThis~is~an~attempt~to~look~at~a ~reasonable~way~to~send~a~message|.in~such~a~way~that~it~is~encrypted, ~but~that~the~receiver~can~also~revify~that|.the~message~is~really~fro m~me,~and~that~no~one~has~tampered~with~it~after~I|.signed~the~message .~~There~are~several~pieces~to~deal~with.~~I~need~to~hash|.the~message ~down~to~a~digest~of~reasonable~length.~~We~will~do~that~with~DES.|.Af ter~we~have~a~hashed~digest,~we~sign~it~with~RSA.~~Then,~since~I~want~ to~have~|.the~message~decrypted~by~the~intended~recipient~alone,~I~enc rypt~the~session~key|.with~RSA~and~the~receiver's~public~key.~xG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 326 "" 0 "" {TEXT -1 10 "Exercises:" }}{EXCHG {PARA 327 "" 0 "" {TEXT -1 537 "1 ) The following message was sent to to a receiver with the following \+ private key:\nReceivern := 1457907094342636571934108159685862980326515 9149118248616433975229804975507362306154960468021868768356118367534405 25199587698019954839165932427842278373706998741;\nReceiverd := 3418029 8922096847472065507840720943425419102236324807359431775852717312155060 7778293183240178522095499109087453784896094825475099226794560236481979 918863102913;\nVerify that it was sent by sender, decrypt it, formulat e a reply to sender that is encrypted and signed." }}}{EXCHG {PARA 328 "" 0 "" {TEXT -1 2083 "Sendern := 26471330604822478554767314516351 2922348513168053136441607820278334526819450073873355024584847059403376 4469895630694651936487340877088430911072869585934526325563:\nSendere : = 65537:\ncipherlist := [\"841DF241571484DA\", \"79793834C7DD81D0\", \+ \"48ABB98186432AE6\", \"81DBE80752EADAB6\", \"8B43C22E1099BC4E\", \"33 19DDD18A5216D7\", \"2C465263FCB169D7\", AD1DB4C8E76699AE, \"9F439228B3 264B02\", \"7D235364FC85B872\", \"2AEB9BBBB01BBE9A\", \"5BA93E6E539970 B1\", \"8FC41AEE50B953FA\", \"324B23BB22CCD112\", \"395513EC6C5F82D1\" , D821C1549F0C8AC0, \"58FE6D0F4F6C8643\", \"4B5C7E74B3859EFD\", \"9907 A68B351101D3\", \"56424729A52A8889\", \"5D3AF3A93FD72238\", DEE853E94A 56B0BA, B0430A8817016724, \"6D9FD3FFBB3A4D50\", E81B5EE640F89D42, \"51 0DFC71FA25C40C\", \"3CC43FBB5B655D72\", \"630071DB2D013E9F\", \"6B2286 634C67C6DE\", \"58447F6CBD665E69\", E945777C507A99CE, \"0367FD0AC597D7 31\", \"616B270C7B713B66\", \"537B8E0728D3E8E9\", E4C57177141001F5, A5 F09AE750BE19FD, \"55D5BEAC66E71FC5\", \"4E33D27B5A5F7E09\", B9203D5C4E F0068D, \"5DC41D5BA801444F\", \"8786352A029EE02D\", \"04B30B785A76F6DA \", \"623F4AB38026661B\", \"48BC5F2C834D1F35\", F115C4747A0521E8, \"93 6C3DA21AD0D3ED\", AC52CC995163B0DF, E54536560E8CBA96, \"157912D2417927 71\", \"29C096048813A485\", CE70C7E14525124C, \"2B7D0241F09A6890\", \" 377D1B206D53823B\", \"1301320EF2E23257\", \"444DF372B826A9CF\", FC580B 4A75667C47, C310038925FB71DA, \"85E21A5B46FDE69A\", B328EC3944D128DE, \+ \"650D24EB4D657855\", D6CF942B2CFF4805, \"694BA546F05B9471\", \"5C0C7A 9B814E4D87\", C698D4BF4704ACFF, \"2BF5C15310CB94BF\", \"3FF942653F528F B0\", \"7A0A0B17200F9BC7\", \"7B8C888CA6E7C992\", \"6FBE19BB8BB32031\" , \"97C62DA7C96C134C\", \"8CC5430A980A3DDC\", EF150D80FD6B277E, \"2762 FAAA92DA27C6\", ABA7010CE599034D, \"1DBB5EE17CAB5788\", B769F09C13715F D2, \"6D4AFC0B31B19123\", D7671D4064D46B27, \"9BC484AEE970D44A\", \"99 DA4B18A0B9D70D\", \"512AA8D5AEBA0CBF\"];\nsigHex := \"17E394C94FF7357C A2B856A764D54911A64F45000EA103E0BA0971FE35371AE81CC2AB9413FA808218C904 9CC0AF7CFDD4DC04E4E600994A6BE02DDDA3221854DDC89\";\nencryptKeyHex := \+ \"120B390A6D5333E6D19BCC3FE367C27B3B5562F89344A2B1708307AF1593E956FE1D 1EECE000AF9EC6DB69913119B2886B6207C7908966B6EFAA0D6BA868E0DA65584\";" }}}{EXCHG {PARA 329 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 330 " " 0 "" {TEXT -1 391 "2) Create a 10 line message, a random DES key, \+ and a pair of RSA keys, one for encryption and one for signing. Encry pt your message with DES is CBC mode, consider the last cipherword to \+ be a has of the message and sign the hash. Encrypt your DES key with \+ RSA and post the composite message to the bulletin board. (You will a lso need to append the receiver's private key on this problem." }}} {EXCHG {PARA 331 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 332 "" 0 "" {TEXT -1 89 "3) Pull your own message off the bulletin board and d ecrypt it to be sure that it works." }}}{EXCHG {PARA 333 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 334 "" 0 "" {TEXT -1 112 "4) Exchan ge public RSA keys with someone in the class. Send a message and reply using this secured mail system." }}}{EXCHG {PARA 335 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 336 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }