ID:257763
 
//Title: XOR-Based String Encryption
//Credit to: Xx Dark Wizard xX
//Contributed by: Xx Dark Wizard xX


/*
A very simple encryption algorithm, not very secure but useful.
*/


proc
XorEncrypt(string,key)
for(var/i = 1 to length(string))
var/char = text2ascii(string,i)
. += ascii2text(char ^ key)
text2ascii() has a second parameter to allow you to specify the position in the string, so you can take out the copytext().
In response to Shadowdarke
Yeah, I wrote that a long time ago, fixed now.