RC4 stream cipher
my original python code
Installation
Install through NPM
npm install arc4
or
git clone git://github.com/hex7c0/arc4.git
or
http://supergiovane.tk/#/arc4
API
inside nodejs project
var rc4 = require('arc4')('secret_key');
rc4.codeString('foo');
methods
change your key (warning)
rc4.change('foo');
encode string data
rc4.codeString('string');
encode array data
rc4.codeArray([49,50,51]);
encode buffer data
rc4.codeBuffer(new Buffer('ciao'));
encode string, byte or buffer
rc4.code(your_data);
same methods with RC4A
postifx for RC4A
rc4.codeRC4A(your_data);
same methods with VMPC
postifx for VMPC
rc4.codeVMPC(your_data);
same methods with RC4P
postifx for RC4+
rc4.codeRC4P(your_data);
rc4(param)
param
- String | Array | Buffer Your key (default "throw Error")
Examples
Take a look at my examples
License
Copyright (c) 2014 hex7c0
Licensed under the GPLv3 license