You may want to do 2 pass encoding: First pass does simple xor encoding, second pass ensures output will survive to/from the registry (not sure if the registry will support low order (control codes, < 32) or extended ascii (> 127), the frequent product of simple xoring methods).
One common method for ensuring the latter is
base16|32|64 encoding which typically encodes to a limited (printable ascii) character set, let me know if you want sample lisp code to do base encoding.
Example:
(setq
text "Welcome to theswamp.org"
mask "Actually, I was talking to the duck."
)
(
xortext text mask)
"\026\006\030\026\016\001\tYXOiT\037\004\000W\025\014\034E\006\034\000"
(
tobase64 (
xortext text mask))
"4VNN4Vs01K_NIq_J6kF-KlJB63J56--"
(
xortext (
frombase64 (
tobase64 (
xortext text mask))) mask)
"Welcome to theswamp.org"
Encryption is a vast topic that one could dedicate one's entire career to. Before committing to a solution you consider interogating the usual suspects, wikipedia.org, answers.com ...