{VERSION 5 0 "IBM INTEL LINUX" "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 }{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 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 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 19 "Rijndael-Square.mws" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 36 "libname := \"/tmp/Rijndael\", libname:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "Nb := 4:\nNk := 4:\nNr := 4:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 112 "#CipherInput := HexToCipher Input( \"12345678123456781234567812345678\" ):\nCipherInput := Generat eRandomMessage(): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "State ToHex( CipherInput );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "ac tive_x := 0:\nactive_y := 1:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "LambdaSet := array( 0..255 ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 125 "for b from 0 to 255 do\n LambdaSet[b] := copy( Cip herInput );\n LambdaSet[b][ active_x, active_y ] := F256[input]( b ) ;\nod:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "StateToHex( LambdaSet[10] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "#CipherKey := HexToKey(\"FCF2A93E2B FA35A28C978008D35E3C37\"):\nCipherKey := GenerateRandomKey( ):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "CipherSet := array( 0..255 ) :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 179 "start := time():\nfor i from 0 to 255 do\n CipherSet[i] := copy( Rijndael( LambdaSet[i], \+ CipherKey ) );\nod:\nprintf(\"Zeit pro 4-Runden-Verschl\374sselung: %f s\\n\",(time()-start)/256);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "keybyte_x := 2:\nkeybyte_y := 3:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 372 "start := time():\nfor b from 0 to 255 do\n # print f(\"Probiere b = %d\\n\",b);\n B := F256[input]( b );\n summe := F 256[zero];\n for i from 0 to 255 do\n summe := F256[`+`]( InvSB ox( F256[`+`]( CipherSet[i][ keybyte_x, keybyte_y ], B ) ), summe );\n od;\n if summe = F256[zero] then\n print( b );\n fi;\nod: \nprintf(\"Zeit f\374r den Angriff: %f s\\n\",(time()-start)):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "ExpandedKey := KeyExpansion( CipherKey ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "F256[outpu t]( RoundKey( ExpandedKey, 4)[ keybyte_x, keybyte_y ] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 671 "start := time():\nGuessedRoundKey \+ := array( 0..3, 0..Nb-1, [[0$Nb]$4] ):\nfor x from 0 to 3 do\n for y from 0 to Nb-1 do\n hits := NULL;\n for b from 0 to 255 do \n # printf(\"Probiere b = %d\\n\",b);\n B := F256[inp ut]( b );\n summe := F256[zero];\n for i from 0 to 255 do\n summe := F256[`+`]( InvSBox( F256[`+`]( CipherSet[i][ x, y ], B ) ), summe );\n od;\n if summe = F256[zero] then\n hits := hits, convert( b, hex );\n fi;\n \+ od:\n GuessedRoundKey[x,y] := \{ hits \};\n od;\nod:\nlinalg [transpose]( matrix( GuessedRoundKey ) ); \nprintf(\"Zeit f\374r \+ den Angriff: %f s\\n\",(time()-start)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "StateToHex( RoundKey( ExpandedKey, 4) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 17 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }