Comparing version 3.3.4 to 3.3.5
@@ -6,3 +6,3 @@ 'use strict'; | ||
* @subpackage main | ||
* @version 3.2.0 | ||
* @version 3.3.0 | ||
* @author hex7c0 <hex7c0@gmail.com> | ||
@@ -9,0 +9,0 @@ * @copyright hex7c0 2014 |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -6,0 +6,0 @@ return s; |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -6,0 +6,0 @@ return s; |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -10,3 +10,3 @@ return s; | ||
function body(inp, gksa) { | ||
for (var i = 0, j1 = 0, j2 = 0, s1 = gksa.slice(), s2 = gksa.slice(), out = [], y = 0, l = _.size(inp); l > y; y++) i = (i + 1) % 256, | ||
for (var i = 0, j1 = 0, j2 = 0, s1 = gksa.slice(), s2 = gksa.slice(), out = [], y = 0, l = _.size(inp); y < l; y++) i = (i + 1) % 256, | ||
j1 = (j1 + s1[i]) % 256, s1[j1] = [ s1[i], s1[i] = s1[j1] ][0], out.push(inp[y] ^ s2[(s1[i] + s1[j1]) % 256]), | ||
@@ -34,3 +34,3 @@ ++y < l && (j2 = (j2 + s2[i]) % 256, s2[j2] = [ s2[i], s2[i] = s2[j2] ][0], out.push(inp[y] ^ s1[(s2[i] + s2[j1]) % 256])); | ||
}, Rc4a.prototype.codeString = deprecate(function(str) { | ||
for (var i = 0, j1 = 0, j2 = 0, s1 = this.ksa.slice(), s2 = this.ksa.slice(), out = "", y = 0, l = _.size(str); l > y; y++) i = (i + 1) % 256, | ||
for (var i = 0, j1 = 0, j2 = 0, s1 = this.ksa.slice(), s2 = this.ksa.slice(), out = "", y = 0, l = _.size(str); y < l; y++) i = (i + 1) % 256, | ||
j1 = (j1 + s1[i]) % 256, s1[j1] = [ s1[i], s1[i] = s1[j1] ][0], out += String.fromCharCode(str.charCodeAt(y) ^ s2[(s1[i] + s1[j1]) % 256]), | ||
@@ -37,0 +37,0 @@ ++y < l && (j2 = (j2 + s2[i]) % 256, s2[j2] = [ s2[i], s2[i] = s2[j2] ][0], out += String.fromCharCode(str.charCodeAt(y) ^ s1[(s2[i] + s2[j2]) % 256])); |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = _.size(key), i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -6,0 +6,0 @@ return s; |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -10,3 +10,3 @@ return s; | ||
function body(inp, gksa, container, length) { | ||
for (var i = 0, j = 0, out = container, ksa = gksa.slice(), y = 0; length > y; ++y) i = (i + 1) % 256, | ||
for (var i = 0, j = 0, out = container, ksa = gksa.slice(), y = 0; y < length; ++y) i = (i + 1) % 256, | ||
j = (j + ksa[i]) % 256, ksa[j] = [ ksa[i], ksa[i] = ksa[j] ][0], out[y] = inp[y] ^ ksa[(ksa[i] + ksa[j]) % 256]; | ||
@@ -28,7 +28,7 @@ return out; | ||
this.key = new Array(key.length); | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; ii > i; ++i) this.key[i] = keys[i]; | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; i < ii; ++i) this.key[i] = keys[i]; | ||
} | ||
this.ksa = gKsa(this.key); | ||
}, Arc4.prototype.codeString = deprecate(function(str) { | ||
for (var i = 0, j = 0, out = "", ksa = this.ksa.slice(), y = 0, l = str.length; l > y; ++y) i = (i + 1) % 256, | ||
for (var i = 0, j = 0, out = "", ksa = this.ksa.slice(), y = 0, l = str.length; y < l; ++y) i = (i + 1) % 256, | ||
j = (j + ksa[i]) % 256, ksa[j] = [ ksa[i], ksa[i] = ksa[j] ][0], out += String.fromCharCode(str.charCodeAt(y) ^ ksa[(ksa[i] + ksa[j]) % 256]); | ||
@@ -35,0 +35,0 @@ return out; |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -10,3 +10,3 @@ return s; | ||
function body(inp, gksa, container, length) { | ||
for (var a, b, c, i = 0, j = 0, out = container, ksa = gksa.slice(), y = 0; length > y; ++y) i = (i + 1) % 256, | ||
for (var a, b, c, i = 0, j = 0, out = container, ksa = gksa.slice(), y = 0; y < length; ++y) i = (i + 1) % 256, | ||
a = ksa[i], j = ksa[(j + a) % 256], b = ksa[j], ksa[j] = [ a, ksa[i] = b ][0], c = (ksa[i << 5 ^ j >> 3] + ksa[j << 5 ^ i >> 3]) % 256, | ||
@@ -28,7 +28,7 @@ out[y] = inp[y] ^ ksa[a + b] + ksa[170 ^ c] ^ ksa[j + b]; | ||
if ("string" != typeof key && !Buffer.isBuffer(key)) throw new Error("Invalid data"); | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; ii > i; ++i) this.key[i] = keys[i]; | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; i < ii; ++i) this.key[i] = keys[i]; | ||
} | ||
this.ksa = gKsa(this.key); | ||
}, Rc4p.prototype.codeString = deprecate(function(str) { | ||
for (var a, b, c, i = 0, j = 0, out = "", ksa = this.ksa.slice(), y = 0, l = str.length; l > y; ++y) i = (i + 1) % 256, | ||
for (var a, b, c, i = 0, j = 0, out = "", ksa = this.ksa.slice(), y = 0, l = str.length; y < l; ++y) i = (i + 1) % 256, | ||
a = ksa[i], j = ksa[(j + a) % 256], b = ksa[j], ksa[j] = [ a, ksa[i] = b ][0], c = (ksa[i << 5 ^ j >> 3] + ksa[j << 5 ^ i >> 3]) % 256, | ||
@@ -35,0 +35,0 @@ out += String.fromCharCode(str.charCodeAt(y) ^ ksa[a + b] + ksa[170 ^ c] ^ ksa[j + b]); |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -10,3 +10,3 @@ return s; | ||
function body(inp, gksa, container, length) { | ||
for (var i = 0, j1 = 0, j2 = 0, out = container, s1 = gksa.slice(), s2 = gksa.slice(), y = 0; length > y; ++y) i = (i + 1) % 256, | ||
for (var i = 0, j1 = 0, j2 = 0, out = container, s1 = gksa.slice(), s2 = gksa.slice(), y = 0; y < length; ++y) i = (i + 1) % 256, | ||
j1 = (j1 + s1[i]) % 256, s1[j1] = [ s1[i], s1[i] = s1[j1] ][0], out[y] = inp[y] ^ s2[(s1[i] + s1[j1]) % 256], | ||
@@ -29,7 +29,7 @@ ++y < length && (j2 = (j2 + s2[i]) % 256, s2[j2] = [ s2[i], s2[i] = s2[j2] ][0], | ||
if ("string" != typeof key && !Buffer.isBuffer(key)) throw new Error("Invalid data"); | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; ii > i; ++i) this.key[i] = keys[i]; | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; i < ii; ++i) this.key[i] = keys[i]; | ||
} | ||
this.ksa = gKsa(this.key); | ||
}, Rc4a.prototype.codeString = deprecate(function(str) { | ||
for (var i = 0, j1 = 0, j2 = 0, out = "", s1 = this.ksa.slice(), s2 = this.ksa.slice(), y = 0, l = str.length; l > y; ++y) i = (i + 1) % 256, | ||
for (var i = 0, j1 = 0, j2 = 0, out = "", s1 = this.ksa.slice(), s2 = this.ksa.slice(), y = 0, l = str.length; y < l; ++y) i = (i + 1) % 256, | ||
j1 = (j1 + s1[i]) % 256, s1[j1] = [ s1[i], s1[i] = s1[j1] ][0], out += String.fromCharCode(str.charCodeAt(y) ^ s2[(s1[i] + s1[j1]) % 256]), | ||
@@ -36,0 +36,0 @@ ++y < l && (j2 = (j2 + s2[i]) % 256, s2[j2] = [ s2[i], s2[i] = s2[j2] ][0], out += String.fromCharCode(str.charCodeAt(y) ^ s1[(s2[i] + s2[j2]) % 256])); |
"use strict"; | ||
function gKsa(key) { | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; 256 > i; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
for (var j = 0, s = box.slice(), len = key.length, i = 0; i < 256; ++i) j = (j + s[i] + key[i % len]) % 256, | ||
s[j] = [ s[i], s[i] = s[j] ][0]; | ||
@@ -10,3 +10,3 @@ return s; | ||
function body(inp, gksa, container, length) { | ||
for (var a, b, i = 0, j = 0, out = container, ksa = gksa.slice(), y = 0; length > y; ++y) a = ksa[i], | ||
for (var a, b, i = 0, j = 0, out = container, ksa = gksa.slice(), y = 0; y < length; ++y) a = ksa[i], | ||
j = ksa[(j + a) % 256], b = ksa[j], out[y] = inp[y] ^ ksa[ksa[b] + 1], ksa[j] = [ a, ksa[i] = b ][0], | ||
@@ -28,7 +28,7 @@ i = (i + 1) % 256; | ||
if ("string" != typeof key && !Buffer.isBuffer(key)) throw new Error("Invalid data"); | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; ii > i; ++i) this.key[i] = keys[i]; | ||
for (var keys = new Buffer(key), i = 0, ii = keys.length; i < ii; ++i) this.key[i] = keys[i]; | ||
} | ||
this.ksa = gKsa(this.key); | ||
}, Vmpc.prototype.codeString = deprecate(function(str) { | ||
for (var a, b, i = 0, j = 0, out = "", ksa = this.ksa.slice(), y = 0, l = str.length; l > y; ++y) a = ksa[i], | ||
for (var a, b, i = 0, j = 0, out = "", ksa = this.ksa.slice(), y = 0, l = str.length; y < l; ++y) a = ksa[i], | ||
j = ksa[(j + a) % 256], b = ksa[j], out += String.fromCharCode(str.charCodeAt(y) ^ ksa[ksa[b] + 1]), | ||
@@ -35,0 +35,0 @@ ksa[j] = [ a, ksa[i] = b ][0], i = (i + 1) % 256; |
{ | ||
"version": "3.3.4", | ||
"version": "3.3.5", | ||
"name": "arc4", | ||
@@ -15,3 +15,3 @@ "description": "rc4 stream cipher", | ||
"email": "hex7c0@gmail.com", | ||
"url": "http://hex7c0.tk/" | ||
"url": "https://hex7c0.github.io/" | ||
}, | ||
@@ -27,16 +27,16 @@ "repository": { | ||
"directories": { | ||
"lib": "./min/lib" | ||
"lib": "./min/lib", | ||
"example": "./examples" | ||
}, | ||
"main": "index.min.js", | ||
"dependencies": { | ||
"lodash": "4.12.0" | ||
"lodash": "4.15.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "~2.11", | ||
"grunt-contrib-clean": "~1.0", | ||
"grunt-contrib-uglify": "~1.0", | ||
"grunt-contrib-uglify": "~2.0", | ||
"grunt-contrib-jshint": "~1.0", | ||
"grunt-endline": "~0.5", | ||
"istanbul": "~0.4", | ||
"mocha": "~2.4" | ||
"mocha": "~3.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "engines": { |
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
Found 1 instance in 1 package
131828
6
26
1
116
+ Addedlodash@4.15.0(transitive)
- Removedlodash@4.12.0(transitive)
Updatedlodash@4.15.0