A Bit of a Challenge: Feeling Clever?
Posted: Fri Apr 17, 2009 6:59 pm
Bored? Need a little bit of a programming challenge, or something to keep you busy?
Perhaps this isn't a challenge for some - there may or may not be a perfectly simple solution. You'll just have to find out!
Without further delay, here's the challenge:
Synopsis: I have created an algorithm to hash a text input - a password to be specific. It's a weak algorithm - no higher math involved.
Goal: Your goal is to develop a script to decrypt any hashed output. You can use pretty much any language you want - Perl, Python, C - I don't care. As long as it's cross-platform and the compiler is free (no Blitz Basic), you're in the clear.
The Algorithm: b = l * square root(2*a)
The Variables:
b = the final cyphertext
l = z1,z2,z3... (all z's strung together)
.....z (all of them) = (x*y)-(t*10)
..........t = the number of times 10 will have to be subtracted from (x*y) to create a single-digit number, such that z is less than 10.
..........x = the numerical value of the character (a=1, b=2, c=3, etc, and 0=30, 1=31, 2=32, 3=33, etc.) THE TEXT INPUT CAN ONLY BE NUMBERS OR LETTERS!
..........y = the character's place in the inputted string (for string "hamburger", h's y=1, a's y=2, m's y=3, etc.)
a = the length of the inputted string (for example, "hamburger" would be 9).
Example:
Input: hamburger
b = 3520793142.1933355146206174612553225957 * 10^9
l = 829858902
a = 9
3520793142.1933355146206174612553225957 = 829858902 * sqrt(2*9)
Rules For Submission
Send me a private message with a link to your source code, along with the compiled binary (if applicable; users using interpreted languages like Python won't need to include a compiled binary, as there is no such thing). You may post a reply saying that you submitted it, but be sure not to include your code or any hints as to how you did it.
The winner will be the first person to submit one that actually works properly. I will announce the winners on Sunday, April 26. So get to it, and have fun!
Update:
You get extra points if your script/program can encode as well as decode. This'll be easier, of course, but still rather useful.
This is optional - the main challenge is the most important part of your submission.
Perhaps this isn't a challenge for some - there may or may not be a perfectly simple solution. You'll just have to find out!
Without further delay, here's the challenge:
Synopsis: I have created an algorithm to hash a text input - a password to be specific. It's a weak algorithm - no higher math involved.
Goal: Your goal is to develop a script to decrypt any hashed output. You can use pretty much any language you want - Perl, Python, C - I don't care. As long as it's cross-platform and the compiler is free (no Blitz Basic), you're in the clear.
The Algorithm: b = l * square root(2*a)
The Variables:
b = the final cyphertext
l = z1,z2,z3... (all z's strung together)
.....z (all of them) = (x*y)-(t*10)
..........t = the number of times 10 will have to be subtracted from (x*y) to create a single-digit number, such that z is less than 10.
..........x = the numerical value of the character (a=1, b=2, c=3, etc, and 0=30, 1=31, 2=32, 3=33, etc.) THE TEXT INPUT CAN ONLY BE NUMBERS OR LETTERS!
..........y = the character's place in the inputted string (for string "hamburger", h's y=1, a's y=2, m's y=3, etc.)
a = the length of the inputted string (for example, "hamburger" would be 9).
Example:
Input: hamburger
b = 3520793142.1933355146206174612553225957 * 10^9
l = 829858902
a = 9
3520793142.1933355146206174612553225957 = 829858902 * sqrt(2*9)
Rules For Submission
Send me a private message with a link to your source code, along with the compiled binary (if applicable; users using interpreted languages like Python won't need to include a compiled binary, as there is no such thing). You may post a reply saying that you submitted it, but be sure not to include your code or any hints as to how you did it.
The winner will be the first person to submit one that actually works properly. I will announce the winners on Sunday, April 26. So get to it, and have fun!
Update:
You get extra points if your script/program can encode as well as decode. This'll be easier, of course, but still rather useful.
This is optional - the main challenge is the most important part of your submission.