rc4js
Introduction
JavaScript Version RC4 Cipher
Installation
npm install rc4js
Usage
var rc4js = ; // Make cipher by password var cipher = rc4js; // or Make cipher by key 16 bytes length Buffer // var key = new Buffer("i_will_make_a_16"); // var cipher = rc4js.createCipherByKey(key); // Text to encoding var txt = "PZd2"; // get encrypt result var result = cipher; console; console; // > <Buffer bb 94 6a 9f> // Decrypt var decipher = rc4js; result = cipher; console; console; // > PZd2
In ES6 way:
; // Make cipher by password const cipher = rc4js; // or Make cipher by key 16 bytes length Buffer // var key = new Buffer("i_will_make_a_16"); // var cipher = rc4js.createCipherByKey(key); // Text to encoding const txt = "PZd2"; // get encrypt result let result = cipher; console; console; // > <Buffer bb 94 6a 9f> // Decrypt const decipher = rc4js; result = cipher; console; console; // > PZd2