Code:
if {%$} == {} goto usage
setlocal
*(unset /q * %+ unalias /q * %+ unfunction /q *)
set guest=%$
if %@isxdigit[%guest] == 1 goto decrypt
:ENCRYPT
do x=0 to %@dec[%@words[%guest]]
set x_%[x]=%@word[%x,%guest]
set bits=%@ascii[%[x_%x]]
do y=0 to %@dec[%@words[%bits]]
set bit1=%@convert[10,16,%@eval[%@word[%y,%bits] xor 255]]
set bit2=%bit2%%bit1
enddo
echo Input string: [%[x_%x]]
echo Ouput string: %bit2
if {%[x_%x]} == {} leave
enddo
goto end
:DECRYPT
do f=0 %@dec[%@len[%guest]] by 2
set in=%@char[%@eval[%@convert[16,10,%@instr[%f,2,%guest]] xor 255]]
set out=%out%%in
enddo
echo Input sting: [%guest]
echo Output string %out
:END
endlocal
quit
:USAGE
text
Simple Bitwise Encryption/Decryption
Usage: BitWise String
BitWise determins which way to swing depending on input string.
endtext
: *NOTE* Yahelite Chat client uses this very mild encryption.