Help using $encode and $decode. - 01/12/14 12:13 AM
Never mind at the moment. I think I got it working now.
I changed the script in the body of this post. Does this look right now?
At the very bottom is the text from the changelog. I want to be able to encrypt the text within variable %message with a 56 character (448 bit) key inside variable %key. I don't want this to be a one way password hash. I want to be able to decode it using the key.
I have tried several variations using $encode and $decode and I am doing something wrong as it never works or mIRC throws an error.
/encrypt {
var %message.encrypted
var %message.decrypted
var %message = This is a test.
var %key = hfudnqtwh5jv748djne219fndjem568djsmrmufiuhuihgf789yqnksg
%message.encrypted = $encode(%message,cl,%key)
%message.decrypted = $decode(%message.encrypted,cl,%key)
echo -s The original message is %message
echo -s The encrypted message is %message.encrypted
echo -s The decrypted message is %message.decrypted
}
8.Extended $encode/$decode to support blowfish. By default, the method is compatible with OpenSSL and uses CBC, key hashing, a random salt and PKCS#5 padding. The identifier format is:
$encode(%var | binvar, switches, key, [salt | iv])
$decode(%var | binvar, switches, key, [salt | iv])
Where the switches are:
method: c = cbc or e = ecb encryption (one or the other)
key: l = literal key (optional, must be 56 characters)
salt/iv: s = salt or i = iv or r = randomiv (all optional)
padding: z = zeros, n = one and zeros, p = spaces (all optional)
I changed the script in the body of this post. Does this look right now?
At the very bottom is the text from the changelog. I want to be able to encrypt the text within variable %message with a 56 character (448 bit) key inside variable %key. I don't want this to be a one way password hash. I want to be able to decode it using the key.
I have tried several variations using $encode and $decode and I am doing something wrong as it never works or mIRC throws an error.
/encrypt {
var %message.encrypted
var %message.decrypted
var %message = This is a test.
var %key = hfudnqtwh5jv748djne219fndjem568djsmrmufiuhuihgf789yqnksg
%message.encrypted = $encode(%message,cl,%key)
%message.decrypted = $decode(%message.encrypted,cl,%key)
echo -s The original message is %message
echo -s The encrypted message is %message.encrypted
echo -s The decrypted message is %message.decrypted
}
8.Extended $encode/$decode to support blowfish. By default, the method is compatible with OpenSSL and uses CBC, key hashing, a random salt and PKCS#5 padding. The identifier format is:
$encode(%var | binvar, switches, key, [salt | iv])
$decode(%var | binvar, switches, key, [salt | iv])
Where the switches are:
method: c = cbc or e = ecb encryption (one or the other)
key: l = literal key (optional, must be 56 characters)
salt/iv: s = salt or i = iv or r = randomiv (all optional)
padding: z = zeros, n = one and zeros, p = spaces (all optional)