/* OPENSSL script for use with NONE BenderIRC Clients // $VER openssl.arexx 1.01 (11.12.2004) Cyborg */ FILE_IN = 't:in' FILE_OUT = 't:out' options results parse arg param /* Split the CLI args to modus ( encode/decode ) Channel ( Channelname with leading # ) Textline ( Text to decode encode ) */ parse var param mode' 'Channel' 'textline /* if the string is in "" remove them */ if (c2d(substr(textline,1,1)) = 34) then textline = substr(textline,2,length(textline)-2) /* If we want to encode : 1. write ASCII text to inputfile for openssl 2. call openssl 3. read AES output of open ssl line by line and strip the EOL pls refer to the benderirc.de/hp/crypto.html for the technical question WHY?! */ if ( upper(mode) = "ENC") then do if open(file, FILE_IN ,'W') then do l = length(textline) WriteLN(file,textline) close(file) end address COMMAND "openssl:bin/openssl enc -aes256 -kfile benderirc:config/keys/"Channel" -a -e -in "FILE_IN" -out "FILE_OUT if open(file, FILE_OUT,'R') then do out = "" do until eof(file) line = ReadLn(file) out = out''line end close(file) say "CC01"out end exit /* EXIT because AREXX seems to be a bit off with something here */ end /* We want to decode an encrypted message: 1. write the encoded message in 64 byte blocks to the file pls refer to the benderirc.de/hp/crypto.html for the 64byte border reason 2. call openssl 3. read the complede textblock in */ if ( upper(mode) = "DEC" & substr(textline,1,4)="CC01") then do if open(file, FILE_IN ,'W') then do textline = substr(textline,5,length(textline)-4) DO i=1 TO length(textline) BY 64 writeln(file,substr(textline,i,64)) END Close(file) end address COMMAND "openssl:bin/openssl enc -aes256 -kfile benderirc:config/keys/"Channel" -a -d -in "FILE_IN" -out "FILE_OUT if open(file, FILE_OUT,'R') then do out = "" do until eof(file) line = ReadLn(file) out = out''line end close(file) say out end end /* READY - What ever your IRC Client now needs to work with it, it`s your problem ! */