Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arc4

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc4

rc4 stream cipher

  • 3.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

arc4

NPM version Build Status Dependency Status

RC4 stream cipher. You can select from ['arc4', 'rc4a', 'vmpc', 'rc4+'] algorithm, and encode/decode with different encodings for *String only.

My original python code

Installation

Install through NPM

npm install arc4

or

git clone git://github.com/hex7c0/arc4.git

API

inside nodejs project

var rc4 = require('arc4');

var cipher = rc4('arc4', 'secret_key');
var d = cipher.encodeString('ciao');
var e = cipher.decodeString(d);

Methods

change your key (warning) and reload gKsa

cipher.change('foo');

encode string data

cipher.encodeString('string','utf8','base64);

encode array data

cipher.encodeArray([49,50,51]);

encode buffer data

cipher.encodeBuffer(new Buffer('ciao'));

encode string or byte or buffer (switch type)

cipher.encode(your_data);

for decoding, change "encode*" to "decode*"

cipher.decode(your_data);

rc4(algorithm,password,[lodash])

algorithm
  • algorithm - String | Array | Buffer Choose between ['arc4', 'rc4a', 'vmpc', 'rc4+'] (default "throw Error")
password
  • password - String Your key (default "throw Error")
[lodash]
  • lodash - Boolean Use lodash library (check benchmark test for right decision) (default "disabled")

Examples

Take a look at my examples

License GPLv3

Keywords

FAQs

Package last updated on 08 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc