[t]encrypt

By t0k3d on May 23, 2005

this lets you talk encrypted.
it's polymorphic, so it will be harder to decrypt.
its ASCII encryption.

; text encrypter
; t0k3d / AiC

menu * {
  -
  [t]encrypt
  .on:enc on
  .off:enc off
  .about:echo -a - made by t0k3d aka AiC on May 23, 2005.  started at 11:13 finished at 12:17 AM.
}

alias enc {
  if ($1 == on) { set %enc $true }
  else { set %enc $false }
}

on 1:INPUT:*: {
  if ($left($1, 1) != /) {
    if (%enc == $true) { haltdef | set %x $rand(1,37) | .msg $active $+($chr(15), $str($chr(30), %x), $chr(160)) $enc.txt($1-) | echo $target 12-1[12[14encryption12]1]12-5  $+ $me $+   $+ : $1- $+   }
  }
}

on ^1:TEXT:*:*: {
  ; reverses encryption into readable text
  ; uses the length of the amount of $chr(30)s to determine the decrypt routine
  if ($chr(30) isin $1) && ($chr(15) isin $1) && ($chr(160) isin $1) {
    ; uses a group of uncommon characters as a control so it doesn't decrypt text that isn't meant to be
    haltdef
    var %s = $calc($len($1) - 2)
    ; take away $chr(15) and $chr(160) away from the length of the $chr(30)s
    echo $target 12-1[12[14encryption12]1]12-5  $+ $nick $+   $+ : $dec.txt(%s, $2-) $+ 
  }
}

alias enc.txt {
  ; returns encrypted text from $enc.chr(text)
  var %p = $numtok($1-,32), %i 1
  while (%i <= %p) {
    var %c = $gettok($1-, %i, 32)
    var %enc.txt = %enc.txt $enc.chr(%c)
    inc %i 1
  }
  return %enc.txt
}

alias enc.chr {
  ; encryption system
  var %count 1, %c = $1, %n = $len($1)
  while (%count <= %n) {
    var %current.val = $mid(%c, %count, 1)
    var %calc = $calc($asc(%current.val) - %x)
    var %current.enc = $chr(%calc)
    var %c.done = %c.done $+ %current.enc
    inc %count 1
  }
  return %c.done
}

alias dec.txt {
  var %dec.n = $1, %i = $numtok($2-, 32), %c = 1
  while (%c <= %i) {
    var %x = $gettok($2-, %c, 32)
    var %dec.txt = %dec.txt $dec.chr(%dec.n, %x)
    inc %c 1
  }
  return %dec.txt
}

alias dec.chr {
  ; decryption system
  var %count 1, %dec.n = $1, %c = $2, %n = $len(%c)
  while (%count <= %n) {
    var %current.val = $mid(%c, %count, 1)
    var %calc = $calc($asc(%current.val) + %dec.n)
    var %current.enc = $chr(%calc)
    var %c.done = %c.done $+ %current.enc
    inc %count 1
  }
  return %c.done
}

Comments

Sign in to comment.
t0k3d   -  May 24, 2005

because it isn\'t in that order, darkreven, it would be like saying if abc isin 1a2b3c

 Respond  
DarthReven   -  May 23, 2005

insead of having if ($chr(30) isin $1) && ($chr(15) isin $1) && ($chr(160) isin $1) { use if ($+($chr(30),$chr(15),$chr(160)) isin $1) {

 Respond  
Paxia   -  May 23, 2005

Oh okay, sorry for the misunderstanding...

 Respond  
t0k3d   -  May 23, 2005

i am elitet0kr as well, i forgot my login pass...

 Respond  
Paxia   -  May 23, 2005

Lol, this is cool I think, but T0k3d, why are you pretending to be someone you aren\'t because the real T0k3d I was swore was Elite T0kr..?

 Respond  
UK-Sw1ft   -  May 23, 2005

it didnt work.. it just repeasted wha ti said , fix it tbh ;D

 Respond  
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.