polymorphic encryption system

By EliteT0kr on Sep 09, 2005

string.hex

; string.hex
; polymorphic encryption system
; by t0k3d aka AiC
; elitet0kr@hotmail.com

on 1:load: { set %isCrypt 1 }

alias c.sz_Hex {
  var %szCount, %szChr, %szStr, %pszLen = $len($1-)
  var %lpNum = $rand(1, %pszLen), %lpCStr = $asc($mid($1-, %lpNum, 1))
  while (%pszLen) {
    inc %szCount 1
    var %lParam = $mid($1-, %szCount, 1)
    var %szChr = $+($chr(92), x, $calc($asc(%lParam) + %lpCStr))
    var %szStr = $+(%szStr, %szChr)
    dec %pszLen 1
  }
  return $+($chr(92), x, $calc(%lpNum + $gettok(%szStr, $numtok(%szStr, 120) -, 120)), %szStr, $chr(92), d, %lpNum)
}

alias d.sz_Hex {
  var %szIn, %szOut, %szCount = 0
  var %cStr = $gettok($1-, $numtok($1-, 92), 92), %r.cStr = $remove(%cStr, d)
  var %b.cStr = $gettok($1-, 1, 92)
  var %szTemp = $remtok($1-, %cStr, 1, 92)
  var %b.szTemp = $+($chr(92), $remtok(%szTemp, %b.cStr, 1, 92))
  var %pszPush = $numtok(%b.szTemp, 92)
  if (%r.cStr > 30) { var %lpNum = $calc(%r.cStr / 7) }
  else { var %lpNum = %r.cStr }
  var %szKey = $remove($gettok(%b.szTemp, %lpNum, 92), x)
  var %b.szKey = $calc(%szKey / 2)
  while (%pszPush) {
    inc %szCount 1
    var %lpcChar = $remove($gettok(%b.szTemp, %szCount, 92), x)
    var %b.lpcNum = $calc(%lpcChar - %b.szKey)
    var %szIn = $chr($calc(%lpcChar - %b.szKey))
    if (%b.lpcNum == 32) { var %szOut = $+(%szOut, $chr(32), %szIn) }
    else { var %szOut = $+(%szOut, %szIn) }
    dec %pszPush 1
  }
  return %szOut
}

alias hex {
  if ($1 == enable) { .enable #hex | .disable #warn | echo $color(action) -a string.hex is now on. }
  else { .disable #hex | .enable #warn | echo $color(action) -a string.hex is now off. }
}

menu * {
  -
  string.hex
  .on:hex enable
  .off:hex disable
  .about: echo -a made by t0k3d aka AiC.  elitet0kr@hotmail.com
}

#hex off
on 1:input:*: {
  if ($left($1, 1) != /) { haltdef | .msg $active $c.sz_Hex($1-) $+($chr(160), $chr(22)) | echo -a 12(7(14encrypted7)12) $+(14, $me, , :, 12) $1- }
}

on ^*:text:*:*: {
  if ($2 == $+($chr(160), $chr(22))) {
    if (%isCrypt == 1) { echo -a 12(7(14encrypted7)12) $+(14, $nick, , 12) is saying " $+ $d.sz_Hex($1) $+ " encrypted on $+($server, $chr(32), $iif($chan, $chan, via private message), .) | inc %isCrypt 1 | .timer 1 300 dec %isCrypt 1 }
    if (!$chan) { haltdef | echo $nick 12(7(14encrypted7)12) $+(14, $nick, , :, 12) $d.sz_Hex($1) }
    else { haltdef | echo $chan 12(7(14encrypted7)12) $+(14, $nick, , :, 12) $d.sz_Hex($1) }
  }
}
#hex end

#warn on
on ^*:text:*:*: {
  if ($2 == $+($chr(160), $chr(22))) {
    if (%isCrypt == 1) { echo -a 12(7(14encrypted7)12) $+(14, $nick, , 12) is saying " $+ $d.sz_Hex($1) $+ " encrypted on $+($server, $chr(32), $iif($chan, $chan, via private message), .) | .timer 1 300 dec %isCrypt 1 }
  }
}
#warn end

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.