Client Side Encryption

Hide your data. This script takes a string of text and a "key" to generate a scrambled output. Running the output through the script again with the same key restores the original text.

Result will appear here...

Copy the Script

<script>
function xorEncrypt(text, key) {
    var result = "";
    for (var i = 0; i < text.length; i++) {
        result += String.fromCharCode(text.charCodeAt(i) ^ key.charCodeAt(i % key.length));
    }
    return result;
}

// Usage:
// var encrypted = xorEncrypt("Hello", "123");
// var decrypted = xorEncrypt(encrypted, "123");
</script>

Frequently Asked Questions

No. This is a simple obfuscation technique (XOR cipher) and is easily reversible. Do not use this for banking data, passwords, or sensitive personal information.

It is useful for hiding spoilers, obfuscating email addresses from bots, or creating simple puzzle games where the answer is hidden in the source code.

Yes. For real security, use the Web Crypto API (AES-GCM) available in modern browsers, but that is much more complex than this simple script.