New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 3.0.3 to 3.0.4

5

History.md

@@ -0,1 +1,6 @@

v3.0.4 / 2014-09-09
==================
* Performance improvement
v3.0.3 / 2014-09-08

@@ -2,0 +7,0 @@ ==================

5

index.min.js

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";var min=__dirname+"/min/lib/";module.exports=function(a,b,c){return c?require(min+"lodash/index.js")(a,b):require(min+"normal/index.js")(a,b)};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=_.size(a),e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){var c=0,d=0,e=b.slice();return _.map(a,function(a){return c=(c+1)%256,d=(d+e[c])%256,e[d]=[e[c],e[c]=e[d]][0],a^e[(e[c]+e[d])%256]})}function ARC4(a){this.key,this.ksa,this.change(a)}try{var _=require("lodash")}catch(MODULE_NOT_FOUND){console.error(MODULE_NOT_FOUND),process.exit(1)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new ARC4(a)},ARC4.prototype.change=function(a){if(_.isArray(a))this.key=a;else{if(!_.isString(a)&&!Buffer.isBuffer(a))throw new Error("Invalid data");this.key=_.map(new Buffer(a),function(a){return a})}this.ksa=gKsa(this.key)},ARC4.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');var b=0,c=0,d="",e=this.ksa.slice();return _.map(a,function(a){b=(b+1)%256,c=(c+e[b])%256,e[c]=[e[b],e[b]=e[c]][0],d+=String.fromCharCode(a.charCodeAt(0)^e[(e[b]+e[c])%256])}),d},ARC4.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},ARC4.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},ARC4.prototype.codeArray=ARC4.prototype.encodeArray=ARC4.prototype.decodeArray=function(a){return body(a,this.ksa)},ARC4.prototype.codeBuffer=ARC4.prototype.encodeBuffer=ARC4.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},ARC4.prototype.encode=function(a,b,c){if(_.isString(a))return this.encodeString(a,b,c);if(_.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},ARC4.prototype.decode=function(a,b,c){if(_.isString(a))return this.decodeString(a,b,c);if(_.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},ARC4.prototype.code=function(a){if(_.isString(a))return this.codeString(a);if(_.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";var min=__dirname+"/";module.exports=function(a,b){var c;switch(a){case"arc4":c=require(min+"arc4.js");break;case"rc4a":c=require(min+"rc4a.js");break;case"vmpc":c=require(min+"vmpc.js");break;case"rc4+":c=require(min+"rc4+.js");break;default:throw new TypeError("algorithm required")}if(!b)throw new TypeError("password required");return c(b)};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=_.size(a),e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){var c,d,e,f=0,g=0,h=b.slice();return _.map(a,function(a){return f=(f+1)%256,c=h[f],g=h[(g+c)%256],d=h[g],h[g]=[c,h[f]=d][0],a^h[c+d]+h[170^e]^h[g+d]})}function RC4p(a){this.key,this.ksa,this.change(a)}try{var _=require("lodash")}catch(MODULE_NOT_FOUND){console.error(MODULE_NOT_FOUND),process.exit(1)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new RC4p(a)},RC4p.prototype.change=function(a){if(_.isArray(a))this.key=a;else{if(!_.isString(a)&&!Buffer.isBuffer(a))throw new Error("Invalid data");this.key=_.map(new Buffer(a),function(a){return a})}this.ksa=gKsa(this.key)},RC4p.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');var b,c,d,e=0,f=0,g="",h=this.ksa.slice();return _.map(a,function(a){e=(e+1)%256,b=h[e],f=h[(f+b)%256],c=h[f],h[f]=[b,h[e]=c][0],d=(h[e<<5^f>>3]+h[f<<5^e>>3])%256,g+=String.fromCharCode(a.charCodeAt(0)^h[b+c]+h[170^d]^h[f+c])}),g},RC4p.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},RC4p.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},RC4p.prototype.codeArray=RC4p.prototype.encodeArray=RC4p.prototype.decodeArray=function(a){return body(a,this.ksa)},RC4p.prototype.codeBuffer=RC4p.prototype.encodeBuffer=RC4p.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},RC4p.prototype.encode=function(a,b,c){if(_.isString(a))return this.encodeString(a,b,c);if(_.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},RC4p.prototype.decode=function(a,b,c){if(_.isString(a))return this.decodeString(a,b,c);if(_.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},RC4p.prototype.code=function(a){if(_.isString(a))return this.codeString(a);if(_.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=_.size(a),e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){for(var c=0,d=0,e=0,f=b.slice(),g=b.slice(),h=[],i=0,j=_.size(a);j>i;i++)c=(c+1)%256,d=(d+f[c])%256,f[d]=[f[c],f[c]=f[d]][0],h.push(a[i]^g[(f[c]+f[d])%256]),++i<j&&(e=(e+g[c])%256,g[e]=[g[c],g[c]=g[e]][0],h.push(a[i]^f[(g[c]+g[d])%256]));return h}function RC4A(a){this.key,this.ksa,this.change(a)}try{var _=require("lodash")}catch(MODULE_NOT_FOUND){console.error(MODULE_NOT_FOUND),process.exit(1)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new RC4A(a)},RC4A.prototype.change=function(a){if(_.isArray(a))this.key=a;else{if(!_.isString(a)&&!Buffer.isBuffer(a))throw new Error("Invalid data");this.key=_.map(new Buffer(a),function(a){return a})}this.ksa=gKsa(this.key)},RC4A.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b=0,c=0,d=0,e=this.ksa.slice(),f=this.ksa.slice(),g="",h=0,i=_.size(a);i>h;h++)b=(b+1)%256,c=(c+e[b])%256,e[c]=[e[b],e[b]=e[c]][0],g+=String.fromCharCode(a.charCodeAt(h)^f[(e[b]+e[c])%256]),++h<i&&(d=(d+f[b])%256,f[d]=[f[b],f[b]=f[d]][0],g+=String.fromCharCode(a.charCodeAt(h)^e[(f[b]+f[d])%256]));return g},RC4A.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},RC4A.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},RC4A.prototype.codeArray=RC4A.prototype.encodeArray=RC4A.prototype.decodeArray=function(a){return body(a,this.ksa)},RC4A.prototype.codeBuffer=RC4A.prototype.encodeBuffer=RC4A.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},RC4A.prototype.encode=function(a,b,c){if(_.isString(a))return this.encodeString(a,b,c);if(_.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},RC4A.prototype.decode=function(a,b,c){if(_.isString(a))return this.decodeString(a,b,c);if(_.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},RC4A.prototype.code=function(a){if(_.isString(a))return this.codeString(a);if(_.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=_.size(a),e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){var c,d,e=0,f=0,g=b.slice(),h=new Array;return _.map(a,function(a,b){c=g[e],f=g[(f+c)%256],d=g[f],h[b]=a^g[g[d]+1],g[f]=[c,g[e]=d][0],e=(e+1)%256}),h}function VMPC(a){this.key,this.ksa,this.change(a)}try{var _=require("lodash")}catch(MODULE_NOT_FOUND){console.error(MODULE_NOT_FOUND),process.exit(1)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new VMPC(a)},VMPC.prototype.change=function(a){if(_.isArray(a))this.key=a;else{if(!_.isString(a)&&!Buffer.isBuffer(a))throw new Error("Invalid data");this.key=_.map(new Buffer(a),function(a){return a})}this.ksa=gKsa(this.key)},VMPC.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');var b,c,d=0,e=0,f="",g=this.ksa.slice();return _.map(a,function(a){b=g[d],e=g[(e+b)%256],c=g[e],f+=String.fromCharCode(a.charCodeAt(0)^g[g[c]+1]),g[e]=[b,g[d]=c][0],d=(d+1)%256}),f},VMPC.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},VMPC.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},VMPC.prototype.codeArray=VMPC.prototype.encodeArray=VMPC.prototype.decodeArray=function(a){return body(a,this.ksa)},VMPC.prototype.codeBuffer=VMPC.prototype.encodeBuffer=VMPC.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},VMPC.prototype.encode=function(a,b,c){if(_.isString(a))return this.encodeString(a,b,c);if(_.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},VMPC.prototype.decode=function(a,b,c){if(_.isString(a))return this.decodeString(a,b,c);if(_.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},VMPC.prototype.code=function(a){if(_.isString(a))return this.codeString(a);if(_.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};

7

min/lib/normal/arc4.js

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){for(var c=0,d=0,e=new Array,f=b.slice(),g=0,h=a.length;h>g;g++)c=(c+1)%256,d=(d+f[c])%256,f[d]=[f[c],f[c]=f[d]][0],e.push(a[g]^f[(f[c]+f[d])%256]);return e}function ARC4(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new ARC4(a)},ARC4.prototype.change=function(a){if(Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");this.key=new Array(a.legth);for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},ARC4.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b=0,c=0,d="",e=this.ksa.slice(),f=0,g=a.length;g>f;f++)b=(b+1)%256,c=(c+e[b])%256,e[c]=[e[b],e[b]=e[c]][0],d+=String.fromCharCode(a.charCodeAt(f)^e[(e[b]+e[c])%256]);return d},ARC4.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},ARC4.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},ARC4.prototype.codeArray=ARC4.prototype.encodeArray=ARC4.prototype.decodeArray=function(a){return body(a,this.ksa)},ARC4.prototype.codeBuffer=ARC4.prototype.encodeBuffer=ARC4.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},ARC4.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},ARC4.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},ARC4.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b,c,d){for(var e=0,f=0,g=c,h=b.slice(),i=0;d>i;i++)e=(e+1)%256,f=(f+h[e])%256,h[f]=[h[e],h[e]=h[f]][0],g[i]=a[i]^h[(h[e]+h[f])%256];return g}function ARC4(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new ARC4(a)},ARC4.prototype.change=function(a){if(Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");this.key=new Array(a.legth);for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},ARC4.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b=0,c=0,d="",e=this.ksa.slice(),f=0,g=a.length;g>f;f++)b=(b+1)%256,c=(c+e[b])%256,e[c]=[e[b],e[b]=e[c]][0],d+=String.fromCharCode(a.charCodeAt(f)^e[(e[b]+e[c])%256]);return d},ARC4.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"hex")},ARC4.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"utf8")},ARC4.prototype.codeArray=ARC4.prototype.encodeArray=ARC4.prototype.decodeArray=function(a){var b=a.length;return body(a,this.ksa,new Array(b),b)},ARC4.prototype.codeBuffer=ARC4.prototype.encodeBuffer=ARC4.prototype.decodeBuffer=function(a){var b=a.length;return body(a,this.ksa,new Buffer(b),b)},ARC4.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},ARC4.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},ARC4.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";var min=__dirname+"/";module.exports=function(a,b){var c;switch(a){case"arc4":c=require(min+"arc4.js");break;case"rc4a":c=require(min+"rc4a.js");break;case"vmpc":c=require(min+"vmpc.js");break;case"rc4+":c=require(min+"rc4+.js");break;default:throw new TypeError("algorithm required")}if(!b)throw new TypeError("password required");return c(b)};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){for(var c,d,e,f=0,g=0,h=new Array,i=b.slice(),j=0,k=a.length;k>j;j++)f=(f+1)%256,c=i[f],g=i[(g+c)%256],d=i[g],i[g]=[c,i[f]=d][0],e=(i[f<<5^g>>3]+i[g<<5^f>>3])%256,h.push(a[j]^i[c+d]+i[170^e]^i[g+d]);return h}function RC4p(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new RC4p(a)},RC4p.prototype.change=function(a){if(this.key=new Array(a.legth),Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},RC4p.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b,c,d,e=0,f=0,g="",h=this.ksa.slice(),i=0,j=a.length;j>i;i++)e=(e+1)%256,b=h[e],f=h[(f+b)%256],c=h[f],h[f]=[b,h[e]=c][0],d=(h[e<<5^f>>3]+h[f<<5^e>>3])%256,g+=String.fromCharCode(a.charCodeAt(i)^h[b+c]+h[170^d]^h[f+c]);return g},RC4p.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},RC4p.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},RC4p.prototype.codeArray=RC4p.prototype.encodeArray=RC4p.prototype.decodeArray=function(a){return body(a,this.ksa)},RC4p.prototype.codeBuffer=RC4p.prototype.encodeBuffer=RC4p.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},RC4p.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},RC4p.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},RC4p.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b,c,d){for(var e,f,g,h=0,i=0,j=c,k=b.slice(),l=0;d>l;l++)h=(h+1)%256,e=k[h],i=k[(i+e)%256],f=k[i],k[i]=[e,k[h]=f][0],g=(k[h<<5^i>>3]+k[i<<5^h>>3])%256,j[l]=a[l]^k[e+f]+k[170^g]^k[i+f];return j}function RC4p(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new RC4p(a)},RC4p.prototype.change=function(a){if(this.key=new Array(a.legth),Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},RC4p.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b,c,d,e=0,f=0,g="",h=this.ksa.slice(),i=0,j=a.length;j>i;i++)e=(e+1)%256,b=h[e],f=h[(f+b)%256],c=h[f],h[f]=[b,h[e]=c][0],d=(h[e<<5^f>>3]+h[f<<5^e>>3])%256,g+=String.fromCharCode(a.charCodeAt(i)^h[b+c]+h[170^d]^h[f+c]);return g},RC4p.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"hex")},RC4p.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"utf8")},RC4p.prototype.codeArray=RC4p.prototype.encodeArray=RC4p.prototype.decodeArray=function(a){var b=a.length;return body(a,this.ksa,new Array(b),b)},RC4p.prototype.codeBuffer=RC4p.prototype.encodeBuffer=RC4p.prototype.decodeBuffer=function(a){var b=a.length;return body(a,this.ksa,new Buffer(b),b)},RC4p.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},RC4p.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},RC4p.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){for(var c=0,d=0,e=0,f=new Array,g=b.slice(),h=b.slice(),i=0,j=a.length;j>i;i++)c=(c+1)%256,d=(d+g[c])%256,g[d]=[g[c],g[c]=g[d]][0],f.push(a[i]^h[(g[c]+g[d])%256]),++i<j&&(e=(e+h[c])%256,h[e]=[h[c],h[c]=h[e]][0],f.push(a[i]^g[(h[c]+h[d])%256]));return f}function RC4A(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new RC4A(a)},RC4A.prototype.change=function(a){if(this.key=new Array(a.legth),Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},RC4A.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b=0,c=0,d=0,e="",f=this.ksa.slice(),g=this.ksa.slice(),h=0,i=a.length;i>h;h++)b=(b+1)%256,c=(c+f[b])%256,f[c]=[f[b],f[b]=f[c]][0],e+=String.fromCharCode(a.charCodeAt(h)^g[(f[b]+f[c])%256]),++h<i&&(d=(d+g[b])%256,g[d]=[g[b],g[b]=g[d]][0],e+=String.fromCharCode(a.charCodeAt(h)^f[(g[b]+g[d])%256]));return e},RC4A.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},RC4A.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},RC4A.prototype.codeArray=RC4A.prototype.encodeArray=RC4A.prototype.decodeArray=function(a){return body(a,this.ksa)},RC4A.prototype.codeBuffer=RC4A.prototype.encodeBuffer=RC4A.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},RC4A.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},RC4A.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},RC4A.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b,c,d){for(var e=0,f=0,g=0,h=c,i=b.slice(),j=b.slice(),k=0;d>k;k++)e=(e+1)%256,f=(f+i[e])%256,i[f]=[i[e],i[e]=i[f]][0],h[k]=a[k]^j[(i[e]+i[f])%256],++k<d&&(g=(g+j[e])%256,j[g]=[j[e],j[e]=j[g]][0],h[k]=a[k]^i[(j[e]+j[f])%256]);return h}function RC4A(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new RC4A(a)},RC4A.prototype.change=function(a){if(this.key=new Array(a.legth),Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},RC4A.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b=0,c=0,d=0,e="",f=this.ksa.slice(),g=this.ksa.slice(),h=0,i=a.length;i>h;h++)b=(b+1)%256,c=(c+f[b])%256,f[c]=[f[b],f[b]=f[c]][0],e+=String.fromCharCode(a.charCodeAt(h)^g[(f[b]+f[c])%256]),++h<i&&(d=(d+g[b])%256,g[d]=[g[b],g[b]=g[d]][0],e+=String.fromCharCode(a.charCodeAt(h)^f[(g[b]+g[d])%256]));return e},RC4A.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"hex")},RC4A.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"utf8")},RC4A.prototype.codeArray=RC4A.prototype.encodeArray=RC4A.prototype.decodeArray=function(a){var b=a.length;return body(a,this.ksa,new Array(b),b)},RC4A.prototype.codeBuffer=RC4A.prototype.encodeBuffer=RC4A.prototype.decodeBuffer=function(a){var b=a.length;return body(a,this.ksa,new Buffer(b),b)},RC4A.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},RC4A.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},RC4A.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};

@@ -1,6 +0,1 @@

/*
* arc4 v3.0.3
* (c) hex7c0 http://supergiovane.tk/#/arc4
* Licensed under GPLv3
*/
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b){for(var c,d,e=0,f=0,g=new Array,h=b.slice(),i=0,j=a.length;j>i;i++)c=h[e],f=h[(f+c)%256],d=h[f],g.push(a[i]^h[h[d]+1]),h[f]=[c,h[e]=d][0],e=(e+1)%256;return g}function VMPC(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new VMPC(a)},VMPC.prototype.change=function(a){if(this.key=new Array(a.legth),Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},VMPC.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b,c,d=0,e=0,f="",g=this.ksa.slice(),h=0,i=a.length;i>h;h++)b=g[d],e=g[(e+b)%256],c=g[e],f+=String.fromCharCode(a.charCodeAt(h)^g[g[c]+1]),g[e]=[b,g[d]=c][0],d=(d+1)%256;return f},VMPC.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8");return new Buffer(body(d,this.ksa)).toString(c||"hex")},VMPC.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex");return new Buffer(body(d,this.ksa)).toString(c||"utf8")},VMPC.prototype.codeArray=VMPC.prototype.encodeArray=VMPC.prototype.decodeArray=function(a){return body(a,this.ksa)},VMPC.prototype.codeBuffer=VMPC.prototype.encodeBuffer=VMPC.prototype.decodeBuffer=function(a){return new Buffer(body(a,this.ksa))},VMPC.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},VMPC.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},VMPC.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};
"use strict";function gKsa(a){for(var b=0,c=box.slice(),d=a.length,e=0;256>e;e++)b=(b+c[e]+a[e%d])%256,c[b]=[c[e],c[e]=c[b]][0];return c}function body(a,b,c,d){for(var e,f,g=0,h=0,i=c,j=b.slice(),k=0;d>k;k++)e=j[g],h=j[(h+e)%256],f=j[h],i[k]=a[k]^j[j[f]+1],j[h]=[e,j[g]=f][0],g=(g+1)%256;return i}function VMPC(a){this.key,this.ksa,this.change(a)}var box=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];module.exports=function(a){return new VMPC(a)},VMPC.prototype.change=function(a){if(this.key=new Array(a.legth),Array.isArray(a))this.key=a;else{if("string"!=typeof a&&!Buffer.isBuffer(a))throw new Error("Invalid data");for(var a=new Buffer(a),b=0,c=a.length;c>b;b++)this.key[b]=a[b]}this.ksa=gKsa(this.key)},VMPC.prototype.codeString=function(a){console.info('arc4 > "codeString" method is deprecated');for(var b,c,d=0,e=0,f="",g=this.ksa.slice(),h=0,i=a.length;i>h;h++)b=g[d],e=g[(e+b)%256],c=g[e],f+=String.fromCharCode(a.charCodeAt(h)^g[g[c]+1]),g[e]=[b,g[d]=c][0],d=(d+1)%256;return f},VMPC.prototype.encodeString=function(a,b,c){var d=new Buffer(a,b||"utf8"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"hex")},VMPC.prototype.decodeString=function(a,b,c){var d=new Buffer(a,b||"hex"),e=d.length;return new Buffer(body(d,this.ksa,new Buffer(e),e)).toString(c||"utf8")},VMPC.prototype.codeArray=VMPC.prototype.encodeArray=VMPC.prototype.decodeArray=function(a){var b=a.length;return body(a,this.ksa,new Array(b),b)},VMPC.prototype.codeBuffer=VMPC.prototype.encodeBuffer=VMPC.prototype.decodeBuffer=function(a){var b=a.length;return body(a,this.ksa,new Buffer(b),b)},VMPC.prototype.encode=function(a,b,c){if("string"==typeof a)return this.encodeString(a,b,c);if(Array.isArray(a))return this.encodeArray(a);if(Buffer.isBuffer(a))return this.encodeBuffer(a);throw new Error("Invalid data")},VMPC.prototype.decode=function(a,b,c){if("string"==typeof a)return this.decodeString(a,b,c);if(Array.isArray(a))return this.decodeArray(a);if(Buffer.isBuffer(a))return this.decodeBuffer(a);throw new Error("Invalid data")},VMPC.prototype.code=function(a){if("string"==typeof a)return this.codeString(a);if(Array.isArray(a))return this.codeArray(a);if(Buffer.isBuffer(a))return this.codeBuffer(a);throw new Error("Invalid data")};
{
"version": "3.0.3",
"version": "3.0.4",
"name": "arc4",

@@ -4,0 +4,0 @@ "description": "rc4 stream cipher",

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