// JavaScript Document

function encryptString(text) {
  // This technique implements a simple encryption using the xor operator
  // applied to a constant factor and each character. Decryption is done 
  // by applying the same operator and factor to each encrypted character.
  var FACTOR = 5;
  var encrypted = '';
  for (var i = 0; i < text.length; ++i) {
    encrypted += String.fromCharCode( FACTOR ^ text.charCodeAt(i) );
  }
  return encrypted;
}