Msg Encoder
Posted by CrashB
Saturday, May 29, 2004
Description: specially written to hide your msg from the people you are talking about!

Usage: /encsay message here
results: sends an encoded message to the current channel (or if you are in a query, that person will recieve an encoded message)

The snippet will also decode anything that fits its layout design that is said and you can see.

alias encsay {
  var %dif $rand(33,255)
  var %line $replace($1-,$chr(32),$chr(5))
  var %new $null
  var %i 1
  
  while %i <= $len(%line) {
    var %chr $asc($mid([ %line ],[ %i ],1))
    
    if %chr >= 33 {
      var %newchr $calc(%chr + %dif)
      
      if %newchr > 255 {
        var %newchr $calc((%newchr - 256) + %dif)
      }
    }
    else {
      var %newchr %chr
    }
    
    var %new %new $+ $chr(%newchr)
    inc %i
  }
  
  msg $active $calc((((%dif * 2) - 3) / 4) * 1000) $+ !ENC %new
}

on *:text:*!ENC *:*:{
  if $gettok($1,1,33) isnum {
    var %dif $calc(((($gettok($1,1,33) / 1000) * 4) + 3) / 2)
    var %line $2-
    var %new $null
    var %i 1
    
    while %i <= $len(%line) {
      var %chr $asc($mid([ %line ],[ %i ],1))
      
      if %chr >= 33 {
        var %newchr $calc(%chr - %dif)
        
        if %newchr < 33 {
          var %newchr $calc(255 - %newchr)
        }
      }
      else {
        var %newchr %chr
      }
      
      var %new %new $+ $chr(%newchr)
      inc %i
    }
    
    echo $color(highlight text) -a Decoded: $replace([ %new ],$chr(5),$chr(32))
  }
}
cheers
Posted by Parasite-FT-
Sunday, May 30, 2004 09:23pm PDT
well done, looks great :)

- Para
good idea
Posted by B1NG3
Wednesday, June 02, 2004 04:49am PDT
Very great idea CrashB, might I suggest letting the user define a key so the chat is `secure'?
(Might I also suggest using a picwin and sockets connecting the users directly so there is even less vulnerability to the users' message being decrypted/decoded)
hrmm
Posted by CrashB
Tuesday, June 15, 2004 03:04am PDT
grrr, isn't that what a /msg is for?!  no no, my snippet is merely for fun, as while other people see gibberish, it makes those that can read it fell special!
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world