scrambler

Simplified 2-way encryption.

Usage no npm install needed!

<script type="module">
  import scrambler from 'https://cdn.skypack.dev/scrambler';
</script>

README

Scrambler

Simplified 2-way encryption for Node.js / IO.js.

Usage

var scrambler = require('scrambler'),
    password  = 'password';

var enc = scrambler.encrypt('hello world', password);
console.log(enc) // => '8e81390fc89894eef0e32b2862e94065'

var orig = scrambler.decrypt(enc, password);
console.log(orig) // => 'hello world' 

API

scrambler.encrypt(string, password)

Encrypts a string with the given encryption password.

scrambler.encrypt('the galaxy is on orions belt', 'testing');

scrambler.decrypt(string, password)

Decrypts a string with the given encryption password.

var str = '3fae03cecfaf82581adf87bbe0d799a2e0f98585e3ef39bd04fee0948e37f8a4';
var res = scrambler.encrypt(str, 'test');

console.log(res) // => [message too secret to tell openly]

Small print

Written by Tomás Pollak. (c) Fork, Ltd. MIT License.