NAME=XorEncrypt
AUTHOR=
ITEM=function XorEncrypt$(text$, key$)
DESCRIPTION=Function encrypts text$ using key$. Same function also decrypts if text$ is an encrypted string. Note: encrypted string may contain line breaks, therefore they should be saved and read as a binary file rather than a text file.
OUTSIDE CODE=

function XorEncrypt$(text$, key$)
    k = len(key$)
    t = len(text$)
    for i = 1 to t
        a = asc(mid$(text$, i, 1))
        b = asc(mid$(key$, i mod k + 1, 1))
        XorEncrypt$ = XorEncrypt$; chr$(a xor b)
    next i
end function
