Uses two separate keys that work two different ways to transform the easily crackable $encode identifier into a medium-security encryption method.
To use the encryption, just copy and paste the script into your remotes and type "/encrypt on [key] [MIME count]". The key and the MIME count should both be whole numbers greater than 1, and MIME count should be less than key.
Anyone who you want to communicate with must also have this snippet and should use the same key and MIME count. Similarly you use "/encrypt off" to turn encryption off.
Thanks to Sigh_ for helping me with this one.
--Update--
Added $nitrous alias as an easy way to encrypt and decrypt strings for use in other scripts. Usage is $nitrous(string,key,mimecount). Without any properties it will encrypt the string, or you can specify dec or decrypt as the property to decrypt it.
--Update Again 12/3/06--
You will now see what you type, as requested.
alias encrypt {
if ( $1 == off ) {
set %enc off
echo $colour(info) -a * Encryption is now OFF
}
elseif ( $1 == on ) {
if ( !$2 ) && ( !%k ) {
echo $colour(info) -a * You must specify a key!
halt
}
elseif ( !$3 ) && ( !%mc ) {
echo $colour(info) -a * You must specify a MIME count!
halt
}
set %k $2
set %mc $3
if ( %k < 1 ) || ( $chr(46) isin %k ) || ( %k !isnum ) {
echo $colour(info) -a * Invalid Key
unset %k
halt
}
if ( %mc < %k ) || ( $chr(46) isin %mc ) || ( %mc !isnum ) {
echo $colour(info) -a * Invalid MIME count
unset %mc
halt
}
set %enc on
echo $colour(info) -a * Encryption is now ON, using $+ %k $+ as key, $+ %mc $+ as MIME count
}
else {
echo $colour(info) -a * SYNTAX: /encrypt <on|off> [key] [MIME count]
}
}
on ^*:input:*: {
if ( %enc == on ) && ( $left($1,1) != $readini(mirc.ini,text,commandchar) ) {
var %c = 1,%f = $1-
while (%c <= %k) {
%f = $encode(%f,$iif(%mc // %c,m,u))
inc %c
}
echo -a $+(<,$me,>) %f
.msg $active $chr(384) %f
halt
}
}
on ^*:TEXT:*:*: {
if ( $1 == $chr(384) ) {
var %c = %k,%f = $2-
while (%c) {
%f = $decode(%f,$iif(%mc // %c,m,u))
dec %c
}
echo $colour(text) -a $+(<,$nick,>) %f
haltdef
}
}
alias nitrous {
if ( !$2 ) || ( !$3 ) || ( $2 !isnum ) || ( $3 !isnum ) {
return $null
}
if ( !$prop ) {
var %f = $1,%c = 1
while ( %c <= $2 ) {
%f = $encode(%f,$iif($3 // %c,m,u))
inc %c
}
return %f
}
elseif ( $prop == dec ) || ( $prop == decrypt) {
var %f = $1,%c = $2
while (%c) {
%f = $decode(%f,$iif($3 // %c,m,u))
dec %c
}
return %f
}
}
Greetings...Ive a snafu n wonder if you may have a solution or workaround for it.
I copied and pasted your encryption snippet into a script called P&Plus, a script with heavy safeguards againt such things as DCC and queries.
It works...half-way. Ii will decrypt text but cannot encrypt...text comes out plaintext...
I tried the alias command n still no encrypt...
Any tips, tricks or snippet alterations I can try to get it going properly will be greatly appreciated.
In any case I must say great snippet n hella fun in a chatroom even though Im only getting half the picture so to speak ;)
We like this addon. We only can come up with two things you could add to it to make it better.
That way when you\'re on multiple networks, you can turn it off to chat normal.
and
Like, echo back but still encrypt.
Thanks!
ufo^hunter
In lieu of contacting me on here, send me an email to:
conspiracyirc@hotmail.com