1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simple Encryption/Decryption engine

Discussion in 'T&T - Scripting' started by Rex Clark, Aug 28, 2008.

  1. Rex Clark

    Joined:
    May 30, 2008
    Messages:
    57
    Likes Received:
    0
    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.
    
    
     

Share This Page