So I got really bored and decided to check this site out, I was initially very skeptical about having anything to do with this site.
Well, it turns out this site is pretty neat. You can pass a series of staged tests in order to gain points and get to new levels.
One level in particular that I would like to discuss involves very basic cryptography. This is level 6, where you are given an encrypted string, the generator, and an input to enter the decrypted string.
Now, in order to pass this level you have to understand what it's doing in the first place.
Try entering something simple like "1111".
You'll see it displays "1234".
This is a common method when testing types of encryption, you'll be able to spot consistencies and figure them out right away. (assuming they are simple. ROT13
uses a similar method.)
Now, you can probably already tell what it's doing to encrypt strings. Increasing each succeeding character by its index in the string.
Now, in order to decrypt this encryption, you obviously have to do the reverse. Just subtract the ascii character by that of its index in the string.
Below is an AutoIt script I wrote specifically for this level.
Global $string = "string", $x = StringLen($string), $buffer = "", $i=0, $leng=0
$char = StringMid($string, $i, 1) ;select each char and parse it
$asc = Asc($char) ;get the current ascii code
$new = chr($asc-$leng) ;increase it by the index we are at
$buffer=$buffer&$new ;apply the new character to the buffer
ConsoleWrite("Decrypted: " & $buffer & @CRLF)
Enjoy! If you're interested in AutoIt there are a few things that could be done better with this code, Feel free to play around with it.