hackthissite.org basic web 6 decryption mirc snippet

for those who being playing hackthissite.org basic web challange and stuck at level 6, actually it’s just a simple encryption, you can find the algorithm by try encrypt a string

for example

single character ‘a‘ will return ‘a‘, but when you encrypt ‘ab‘ it will return ‘ac‘ and when you encrypt abcdefgh it will return acegikmo. it show that its converting according to the possition of the character..

still blur??
try encrypt this 12345 string, it will give you 13579, this give us idea how the character are arranged according to their possition.

123 will be 1+0 2+1 3+1+1 = 135
456
will be 4+0 5+1 6+1+1 = 468

and so on…

this also prove that it can be decrypt by reverse it back.
encrypt : 456 will be 4+0 5+1 6+1+1 = 468
decrypt : 468 will be 4-0 5-1 6-1-1 = 456
i don’t know how to explain it more,
you might understand it by look at this mirc snippet

;the encryption

alias e {
;abcdefgh = acegikmo
var %strim = $1, %x = 1, %x2 = 0, %password
while ($mid(%strim,%x,1)) {
%password = %password $+ $chr($calc($asc($v1) + %x2))
inc %x
inc %x2
}
echo -a %strim encrypt to %password
}

;the decryption

alias d {
var %strim = $1, %x = 1, %x2 = 0, %password, %berok, %hanjem,
while ($mid(%strim,%x,1)) {

/*

actually this part can be more simpler, you just need to modify the encryption alias by add minus(-) at %x2, but i do this so u can understand how it work

*/
%berok = $asc($mid(%strim,%x,1))
%hanjem = $calc(%berok - %x2)
%password = %password $+ $chr(%hanjem)
inc %x
inc %x2
}
echo -a : %strim decrypt to %password
}

* thanks to pidi the berok for the code..

this code this not perfect when it try to decrypt string that contain dot(.) comma(,) and single quote(’) character because it’s done in mirc. You try build it in C =)

**UPDATE (1/11/2006)

alias en {
var %s = 1,%t,%g = 0
while (%s < = $len($1)) {
%t = %t $+ $chr($calc($asc($mid($1,%s,1)) + %g))
inc %s
inc %g
}
echo -s encrypt [ $len($1) ][ $1 ] to [ %t ][ $len(%t) ]
}

alias de {
var %s = 1,%t,%g = 0
while (%s <= $len($1)) {
%t = %t $+ $chr($calc($asc($mid($1,%s,1)) - %g))
inc %s
inc %g
}
echo -s decrypt [ $len(%t) ][ %t ] from [ $1 ][ $len($1) ]
}

i’ve rebuild the snippet and this should fix the decryption of command (,) and single quote(’) character
have fun

NOTE : never use simple encryption for you password system. The best would be inreversible encryption such as MD5 or SHA-1. The best protecton is, never let the encrypted password leak out :D

3 Comments

  1. Posted October 31, 2006 at 12:58 pm | Permalink

    ade orang main lagi ke menatang nih? hu3.

  2. Posted October 31, 2006 at 4:00 pm | Permalink

    entah la.. ada lagi kot
    tu pidi the berok dan geng-gengnya main
    aku sampai lvl 8 realistic dah stuck dan malas -_-

  3. Posted October 31, 2006 at 5:12 pm | Permalink

    haha…..
    x pandai uit.. x tau mugo satu