{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 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 "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 12 "Umwandlungen" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 110 "bits2number := proc( X )\n local x,i;\n x:=0:\n f or i to nops(X) do\n x:=2*x+X[nops(X)+1-i];\n od;\n x;\nend:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 197 "number2bits := proc( xx, l \+ )\n local X,x;\n x:=xx;\n X:=NULL;\n to l do\n x:=iquo( x, 2, ' r' );\n X:=(X,r);\n od;\n if x<>0 then print(`Warnung: Informatio nsverlust! `,x); fi;\n [eval(X)];\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 113 "bytes2number := proc( X )\n local x,i;\n x:=0:\n \+ for i to nops(X) do\n x:=256*x+X[nops(X)+1-i];\n od;\n x;\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 200 "number2bytes := proc( xx , l )\n local X,x;\n x:=xx;\n X:=NULL;\n to l do\n x:=iquo( x, \+ 256, 'r' );\n X:=(X,r);\n od;\n if x<>0 then print(`Warnung: Info rmationsverlust! `,x); fi;\n [eval(X)];\nend:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 115 "words2number := proc( X )\n local x,i;\n x: =0:\n for i to nops(X) do\n x:=256^2*x+X[nops(X)+1-i];\n od;\n x ;\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 202 "number2words := proc( xx, l )\n local X,x;\n x:=xx;\n X:=NULL;\n to l do\n x:= iquo( x, 256^2, 'r' );\n X:=(X,r);\n od;\n if x<>0 then print(`Wa rnung: Informationsverlust! `,x); fi;\n [eval(X)];\nend:" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 10 "Prozeduren" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 319 "erzeuge_Rundenschluessel:=proc(k)\n global R,K;\n \+ local p,i,j;\n K:=k;\n R:=array(1..9,1..6):\n p:=0:\n for i to 9 d o\n for j to 6 do\n R[i,j]:=K mod 2^16;\n K:=K * 2^112 mo d (2^128-1);\n p:=p+1;\n if p=128/16 then\n p:=0:\n \+ K:=K*2^25 mod (2^128-1):\n fi;\n od;\n od;\n eval(R); \nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 162 "mult16:=proc(x,y )\n local X,Y,Z;\n X:=x; Y:=y;\n if X=0 then X:=2^16; fi;\n if Y=0 then Y:=2^16; fi;\n Z:=(X*Y) mod (2^16+1);\n if Z=2^16 then Z:=0; f i;\n Z;\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 126 "inv16:=p roc(x)\n local X,Z;\n X:=x;\n if X=0 then X:=2^16; fi;\n Z:=X&^(-1 ) mod (2^16+1);\n if Z=2^16 then Z:=0; fi;\n Z;\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 179 "xor16:=proc(x,y)\n local i,X,Y,Z; \n X:=number2bits(x,16);\n Y:=number2bits(y,16);\n Z:=NULL;\n for \+ i to 16 do\n Z:=eval(Z),(X[i]+Y[i])mod 2;\n od;\n bits2number([ev al(Z)]);\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "sum16:=pr oc(x,y)\n (x+y) mod 2^16;\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 553 "encrypt:=proc(x)\n global R;\n local i,y,Y,Z,a,b,c ;\n Y:=number2words(x,4);\n Z:=[0,0,0,0];\n for i to 9 do\n Z[1] := mult16( Y[1] , R[i,1] );\n Z[2]:= sum16( Y[2] , R[i,2] );\n Z [3]:= sum16( Y[3] , R[i,3] );\n Z[4]:= mult16( Y[4] , R[i,4] );\n \+ if (i=9) then break; fi;\n a:= mult16( xor16( Z[1], Z[3] ), R[i,5 ] );\n b:= mult16( sum16( xor16( Z[2], Z[4] ), a ), R[i,6] );\n \+ c:= sum16( a, b );\n Y[1]:= xor16( Z[1], b );\n Y[2]:= xor16( Z[ 3], b );\n Y[3]:= xor16( Z[2], c );\n Y[4]:= xor16( Z[4], c );\n od;\n words2number(Z);\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 378 "encryptfile:=proc(infile,outfile)\n local st,INPUT,OUTPUT,x, y,X,Y;\n st:=time():\n INPUT:=fopen(infile,READ,BINARY);\n OUTPUT:= fopen(outfile,WRITE,BINARY);\n do\n X:=readbytes( INPUT, 8 );\n \+ if X=0 then break; fi;\n x:=bytes2number( X );\n y:=encrypt( x \+ );\n Y:=number2bytes( y, 8 );\n writebytes( OUTPUT, Y );\n od: \n fclose(INPUT),fclose(OUTPUT);\n time()-st;\nend:" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 4 "Test" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "isprime(2^16+1 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "erzeuge_Rundenschlues sel(1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "rand(2^64)();\nd ecrypt(\");\nencrypt(\");" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "KEY:=`7654321GEHEIMNIS`;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "K:=bytes2number(convert(KEY,bytes)):\niquo(\",2^56) - bytes2numb er(convert(`GEHEIMNIS`,bytes));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "erzeuge_Rundenschluessel(K);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "FOLDER:=`MYFOLDER/`:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "decryptfile(``.FOLDER.`ideaklar.txt`,``.FOLDER.`ideak lar.crypt`);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "encryptfile (``.FOLDER.`ideaklar.crypt`,``.FOLDER.`ideaklar.decrypt`);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "8 0 0" 17 }{VIEWOPTS 1 1 0 1 1 1803 }