Skip to content

nealfennimore/xor

Repository files navigation

codecov npm version

Simple XOR module

Small module for running strings through a XOR cipher

Basic encryption and decryption example

const { toChar, xorStrings } = require( '@nfen/xor' );

function encrypt( key, clearText ) {
    return toChar( xorStrings( key, clearText ) );
}

function decrypt( key, cipherText ) {
    return toChar( xorStrings( key, cipherText ) );
}

console.assert(
    decrypt( 'whatever', encrypt( 'whatever', 'what is this sentence huh' ) ) === 'what is this sentence huh'
);

About

Simple XOR Module

Resources

Stars

Watchers

Forks

Packages

No packages published