|
Encrypting and Decrypting with TCL eggdrops
|
Previous Top Next |
| The following tcl commands are provided by this module (and should also be provided by any other encryption module):
|
| encrypt <key> <string>
|
| returns: encrypted string (using blowfish), encoded into ascii using base-64 so it can be sent over the botnet
|
| decrypt <key> <encrypted-base64-string>
|
| returns: decrypted string (using blowfish)
|
|
|
| #sample TCL script for encrypting and decrypting
|
| bind pub - "mcps" mcpsdecrypt
|
| bind pub - "!etest" mcpsencrypt
|
| set key "replacethistextwithyourmircryptionkey"
|
| #
|
| proc mcpsdecrypt {nick uhost handle chan arg} {
|
| global key
|
| set msg [ decrypt $key $arg ]
|
| if {$msg=="!edtest"} {
|
| #######################################################
|
| #### start of encrypted trigger to encrypted reply ####
|
| #### using the trigger !edtest ####
|
| #######################################################
|
| set ende [ encrypt $key "Encrypted Trigger -> Encrypted" ]
|
| putserv "PRIVMSG $chan :mcps $ende"
|
| }
|
| if {$msg=="!dtest"} {
|
| ############################################
|
| #### start of encrypted trigger to plain text reply ####
|
| #### using the trigger !dtest ####
|
| ########################################################
|
| putserv "PRIVMSG $chan :Encrypted Trigger -> Plain"
|
| }
|
| }
|
| #
|
| proc mcpsencrypt {nick uhost hand chan arg} {
|
| ########################################################
|
| #### start of Plain text trigger to encrypted reply ####
|
| #### using the trigger !etest ####
|
| ########################################################
|
| global key
|
| set msg [ encrypt $key "Plain Trigger -> Encrypted" ]
|
| putserv "PRIVMSG $chan :mcps $msg"
|
| }
|
|
|