1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function xorConvert (text, key) {
var kL = key.length;

return Array.prototype
.slice.call(text)
.map(function (c, index) {
return String.fromCharCode(c.charCodeAt(0) ^ key[index % kL].charCodeAt(0));
}).join('');
}

var key = "RandomPassKey";
var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@£#$%^&*()[]{};:'\",.<>/\\";
var cipherText = xorConvert(txt, key);

assert(xorConvert(cipherText, key) === txt);

Comment and share

  • page 1 of 1

Evangelos Pappas

{bio,
{softwareEngineer, [JavaScript, Node.JS, erlang, Java, Blockchain, Messaging, SMPP, SMTP]},
{fields, [Startups, ECommerce, Advertising, Marketing]},
{photographer, wannabe}}.

{pgp, [
{github_url, https://goo.gl/9rdxR8 },
{mit_host, https://goo.gl/6jEqa0 }]}.

{addresses, [
{bitcoin, 14ojSTH4rkHpzgCjNUSkYrgLrdrao6Bxns}]}.


[VibrantMedia, Evalonlabs].


London, UK