Simple XOR encryption wanted

Hi
Can someone give me or redirect me to a simple but 100% efficient Xor encryption function ? (for text strings)
I dont care much about security because Im not trying to protect anything valuable but I need to bee working 100% of the times since, depending of the key you provide sometines the result is not back-convertable (at least this happens to the only xor function that I found on the net)
I hope I made myself clear.

Thanks for yr help

Uh, XOR is not an encryption function. It’s a bit manipulation function.

See http://documentation.xojo.com/index.php/Bitwise.BitXor

Here is something you might like… it is RC4 encryption

text can have special characters (such as line breaks) and no problem
The Base64 is used to make it all 7bit ASCII characters allowing it to be stored in standard DB text fields if required.

  Dim MM As MemoryBlock = strData
  Dim MM2 As New MemoryBlock(LenB(strData))
  Dim memAsciiArray(255) As Integer
  Dim memKeyArray(255)   As Integer
  Dim memJump As Integer
  Dim memTemp As Integer
  Dim memY As Integer
  Dim intKeyLength As Integer
  Dim intIndex As Integer
  Dim intT As Integer
  Dim intX As Integer
  
  intKeyLength = Len(strKey)
  
  For intIndex = 0 To 255
    memKeyArray(intIndex) = Asc(Mid(strKey, ((intIndex) Mod (intKeyLength)) + 1, 1))
  Next
  
  For intIndex = 0 To 255
    memAsciiArray(intIndex) = intIndex
  Next
  
  For intIndex = 0 To 255
    memJump = (memJump + memAsciiArray(intIndex) + memKeyArray(intIndex)) Mod 256
    memTemp = memAsciiArray(intIndex)
    memAsciiArray(intIndex) = memAsciiArray(memJump)
    memAsciiArray(memJump) = memTemp
  Next
  
  intIndex = 0
  memJump = 0
  
  For intX = 1 To MM2.Size
    intIndex = (intIndex + 1) Mod 256
    memJump = (memJump + memAsciiArray(intIndex)) Mod 256
    intT = (memAsciiArray(intIndex) + memAsciiArray(memJump)) Mod 256
    memTemp = memAsciiArray(intIndex)
    memAsciiArray(intIndex) = memAsciiArray(memJump)
    memAsciiArray(memJump) = memTemp
    memY = memAsciiArray(intT)
    mm2.Byte(intX - 1) = bitwise.bitxor(Val("&h" + Hex(MM.Byte(IntX - 1))), bitwise.bitxor(memTemp,memY))
  Next
  
  Return MM2

Encode

encoded_text=EncodeBase64(rc4(clear_text,reg_key),0)

Decode

clear_text=rc4(DecodeBase64(encoded_text),reg_key)

If you like RC4, we had a thread a few months ago about RC4 algorithm optimizations and ended up with something that was about 35x as fast.

https://forum.xojo.com/13818-faster-encyrption-obscuration-than-rc4-for-large-24mb-15mb-file

I just need a simple encryption method that works both for encoding and decoding