Function Decrypt(k,m) r = "" while (m != "" if (m.length < 64) c = m m = "" else c = m.substring (0,64) m = m.substring (64,m.length) if (c % 64 != 0) while c.length < 64 c += '0' c = NOT c b1 = c.substring(0,32) b2 = c.substring(32,64) k1 = k.substring(0,32) k2 = k.substring(32,64) j = 0 while (j < 32) if (j % 2 == 0 ) b1.charAt(j) = b1.charAt(j) XOR k1.charAt(j) b2.charAt(j) = b2.charAt(j) XOR k2.charAt(j) j++ r += right circular shift (b2 + b1) return r
Message Edited by Rarebit on 06.16.2006 03:49 PM
Is it me, or does something in that code not make sense (minus the which appears by mistake)? Specifically:r += right circular shift ( b2 + b1)
There are 3 ways to look at this...
Other ideas?
Plus, is the code significant in any way?
OOC:
Whoo Vector! You guys are bringing it to them!
"The beatings will continue until Moral improves."
-AlicethePattern, Head Archivist, Mega City Department of Energy (Regression - Recursion)
Digita1Spirit wrote:"PBlade: Aha! Have at ye, knave!"
The_Effectuator wrote:You know, maybe I could be ZionEveryone's new mission controller.
I second this.
"I need to stop watching TV in my head." ~Effectuator.
((Brilliant coverage by The X! Bravo! Even if at some points they were a few jumps behind.))
dataslayer wrote: Is it me, or does something in that code not make sense (minus the which appears by mistake)? Specifically:r += right circular shift ( b2 + b1) There are 3 ways to look at this... you do a 1 bit RCS on b2+b1 you do a b2+b1 RCS on b2+b1 Or it was ment to say r += RSC(b2, b1) <~~thats my guess Other ideas? Plus, is the code significant in any way?
It seems like right circular shift would be a method(function) with a syntax along the lines of right circular shift(int i); I have no idea what it's meant to do, though. I suppose we're supposed to assume it's a circular shift to the right of letters or something, here's a breakdown of the code:
Function Decrypt(k,m) //Method declared as Decrypt, expects two parameters, k and m r = "" //Instance variable r declared as a null string while (m != "") //Do this part while variable m is not an empty string if (m.length < 64) //If the number of characters in string m is less than 64... c = m //set variable c equal to variable m m = "" //set variable m equal to an empty string (so the while condition may be fulfilled later) else //Otherwise, if m is not an empty string c = m.substring (0,64) //set variable c equal to a string of characters from the first character in m to the 64th character in m m = m.substring (64,m.length) //set variable m to a string of characters from the 65th character in m to the last character in m if (c % 64 != 0) //if the remainder of variable c divided by 64 is not equal to zero while c.length < 64 //while the length of c is less than 64 c += '0' //append a 0 to string c c = NOT c //set variable c equal to not c b1 = c.substring(0,32) //set instance variable b1 equal to the first character in c to the 32nd character in c b2 = c.substring(32,64) //set instance variable b2 equal to the 33rd character in c to the 64th character in c k1 = k.substring(0,32) //set instance variable k1 equal to the first character in k to the 32nd character in k k2 = k.substring(32,64) //set instance variable k2 equal to the 33rd character in k to the 64th character in k j = 0 //set variable j equal to 0 while (j < 32) //while variable j is less than 32 if (j % 2 == 0 ) //if the remainder of j divided by 2 is equal to 0 b1.charAt(j) = b1.charAt(j) XOR k1.charAt(j) //I'll be damned if I remember what an exclusive or does. b2.charAt(j) = b2.charAt(j) XOR k2.charAt(j) j++ //increment j by 1 r += right circular shift (b2 + b1) //add the value of a right circular shift of b2 + b1 to r return r //ultimately return the value r
There are some somewhat more understandable explanations of programming language. I'll plug all of this into my IDE and see what I can make of it.