Socket
Socket
Sign inDemoInstall

aes-decrypter

Package Overview
Dependencies
9
Maintainers
12
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.1 to 3.1.2

7

CHANGELOG.md

@@ -0,1 +1,8 @@

<a name="3.1.2"></a>
## [3.1.2](https://github.com/videojs/aes-decrypter/compare/v3.1.1...v3.1.2) (2021-01-12)
### Bug Fixes
* cjs dist should only import cjs ([#83](https://github.com/videojs/aes-decrypter/issues/83)) ([a8a5fbf](https://github.com/videojs/aes-decrypter/commit/a8a5fbf))
<a name="3.1.1"></a>

@@ -2,0 +9,0 @@ ## [3.1.1](https://github.com/videojs/aes-decrypter/compare/v3.1.0...v3.1.1) (2021-01-11)

36

dist/aes-decrypter.cjs.js

@@ -1,2 +0,2 @@

/*! @name aes-decrypter @version 3.1.1 @license Apache-2.0 */
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
'use strict';

@@ -6,9 +6,13 @@

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var _createClass = _interopDefault(require('@babel/runtime/helpers/createClass'));
var _inheritsLoose = _interopDefault(require('@babel/runtime/helpers/inheritsLoose'));
var Stream = _interopDefault(require('@videojs/vhs-utils/es/stream.js'));
var _createClass = require('@babel/runtime/helpers/createClass');
var _inheritsLoose = require('@babel/runtime/helpers/inheritsLoose');
var Stream = require('@videojs/vhs-utils/cjs/stream.js');
var pkcs7 = require('pkcs7');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
var _inheritsLoose__default = /*#__PURE__*/_interopDefaultLegacy(_inheritsLoose);
var Stream__default = /*#__PURE__*/_interopDefaultLegacy(Stream);
/**

@@ -115,5 +119,3 @@ * @file aes.js

var AES =
/*#__PURE__*/
function () {
var AES = /*#__PURE__*/function () {
function AES(key) {

@@ -254,6 +256,4 @@ /**

var AsyncStream =
/*#__PURE__*/
function (_Stream) {
_inheritsLoose(AsyncStream, _Stream);
var AsyncStream = /*#__PURE__*/function (_Stream) {
_inheritsLoose__default['default'](AsyncStream, _Stream);

@@ -263,3 +263,3 @@ function AsyncStream() {

_this = _Stream.call(this, Stream) || this;
_this = _Stream.call(this, Stream__default['default']) || this;
_this.jobs = [];

@@ -304,3 +304,3 @@ _this.delay = 1;

return AsyncStream;
}(Stream);
}(Stream__default['default']);

@@ -394,5 +394,3 @@ /**

var Decrypter =
/*#__PURE__*/
function () {
var Decrypter = /*#__PURE__*/function () {
function Decrypter(encrypted, key, initVector, done) {

@@ -437,3 +435,3 @@ var step = Decrypter.STEP;

_createClass(Decrypter, null, [{
_createClass__default['default'](Decrypter, null, [{
key: "STEP",

@@ -440,0 +438,0 @@ get: function get() {

@@ -1,2 +0,2 @@

/*! @name aes-decrypter @version 3.1.1 @license Apache-2.0 */
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
import _createClass from '@babel/runtime/helpers/createClass';

@@ -108,5 +108,3 @@ import _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';

var AES =
/*#__PURE__*/
function () {
var AES = /*#__PURE__*/function () {
function AES(key) {

@@ -247,5 +245,3 @@ /**

var AsyncStream =
/*#__PURE__*/
function (_Stream) {
var AsyncStream = /*#__PURE__*/function (_Stream) {
_inheritsLoose(AsyncStream, _Stream);

@@ -385,5 +381,3 @@

var Decrypter =
/*#__PURE__*/
function () {
var Decrypter = /*#__PURE__*/function () {
function Decrypter(encrypted, key, initVector, done) {

@@ -390,0 +384,0 @@ var step = Decrypter.STEP;

@@ -1,7 +0,7 @@

/*! @name aes-decrypter @version 3.1.1 @license Apache-2.0 */
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.aesDecrypter = {}));
}(this, function (exports) { 'use strict';
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.aesDecrypter = {}));
}(this, (function (exports) { 'use strict';

@@ -127,5 +127,3 @@ function _defineProperties(target, props) {

var AES =
/*#__PURE__*/
function () {
var AES = /*#__PURE__*/function () {
function AES(key) {

@@ -394,5 +392,3 @@ /**

var AsyncStream =
/*#__PURE__*/
function (_Stream) {
var AsyncStream = /*#__PURE__*/function (_Stream) {
inheritsLoose(AsyncStream, _Stream);

@@ -446,3 +442,2 @@

/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
/**

@@ -455,2 +450,3 @@ * Returns the subarray of a Uint8Array without PKCS#7 padding.

*/
function unpad(padded) {

@@ -547,5 +543,3 @@ return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);

var Decrypter =
/*#__PURE__*/
function () {
var Decrypter = /*#__PURE__*/function () {
function Decrypter(encrypted, key, initVector, done) {

@@ -607,2 +601,2 @@ var step = Decrypter.STEP;

}));
})));

@@ -1,4 +0,4 @@

/*! @name aes-decrypter @version 3.1.1 @license Apache-2.0 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).aesDecrypter={})}(this,function(t){"use strict";function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var r=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t},n=function(){var t,e,r,n,i,s,o,u,c=[[[],[],[],[],[]],[[],[],[],[],[]]],l=c[0],f=c[1],a=l[4],h=f[4],y=[],p=[];for(t=0;t<256;t++)p[(y[t]=t<<1^283*(t>>7))^t]=t;for(e=r=0;!a[e];e^=n||1,r=p[r]||1)for(s=(s=r^r<<1^r<<2^r<<3^r<<4)>>8^255&s^99,a[e]=s,h[s]=e,u=16843009*y[i=y[n=y[e]]]^65537*i^257*n^16843008*e,o=257*y[s]^16843008*s,t=0;t<4;t++)l[t][e]=o=o<<24^o>>>8,f[t][s]=u=u<<24^u>>>8;for(t=0;t<5;t++)l[t]=l[t].slice(0),f[t]=f[t].slice(0);return c},i=null,s=function(){function t(t){var e,r,s;i||(i=n()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];var o=this._tables[0][4],u=this._tables[1],c=t.length,l=1;if(4!==c&&6!==c&&8!==c)throw new Error("Invalid aes key size");var f=t.slice(0),a=[];for(this._key=[f,a],e=c;e<4*c+28;e++)s=f[e-1],(e%c==0||8===c&&e%c==4)&&(s=o[s>>>24]<<24^o[s>>16&255]<<16^o[s>>8&255]<<8^o[255&s],e%c==0&&(s=s<<8^s>>>24^l<<24,l=l<<1^283*(l>>7))),f[e]=f[e-c]^s;for(r=0;e;r++,e--)s=f[3&r?e:e-4],a[r]=e<=4||r<4?s:u[0][o[s>>>24]]^u[1][o[s>>16&255]]^u[2][o[s>>8&255]]^u[3][o[255&s]]}return t.prototype.decrypt=function(t,e,r,n,i,s){var o,u,c,l,f=this._key[1],a=t^f[0],h=n^f[1],y=r^f[2],p=e^f[3],b=f.length/4-2,_=4,d=this._tables[1],v=d[0],g=d[1],m=d[2],w=d[3],A=d[4];for(l=0;l<b;l++)o=v[a>>>24]^g[h>>16&255]^m[y>>8&255]^w[255&p]^f[_],u=v[h>>>24]^g[y>>16&255]^m[p>>8&255]^w[255&a]^f[_+1],c=v[y>>>24]^g[p>>16&255]^m[a>>8&255]^w[255&h]^f[_+2],p=v[p>>>24]^g[a>>16&255]^m[h>>8&255]^w[255&y]^f[_+3],_+=4,a=o,h=u,y=c;for(l=0;l<4;l++)i[(3&-l)+s]=A[a>>>24]<<24^A[h>>16&255]<<16^A[y>>8&255]<<8^A[255&p]^f[_++],o=a,a=h,h=y,y=p,p=o},t}();var o=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e},u=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var r=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(r,1),r>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var r=e.length,n=0;n<r;++n)e[n].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),s=e.length,o=0;o<s;++o)e[o].apply(this,i)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",function(e){t.push(e)})},t}(),c=function(t){function e(){var e;return(e=t.call(this,u)||this).jobs=[],e.delay=1,e.timeout_=null,e}o(e,t);var r=e.prototype;return r.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},r.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},e}(u);var l=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},f=function(t,e,r){var n,i,o,u,c,f,a,h,y,p=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),b=new s(Array.prototype.slice.call(e)),_=new Uint8Array(t.byteLength),d=new Int32Array(_.buffer);for(n=r[0],i=r[1],o=r[2],u=r[3],y=0;y<p.length;y+=4)c=l(p[y]),f=l(p[y+1]),a=l(p[y+2]),h=l(p[y+3]),b.decrypt(c,f,a,h,d,y),d[y]=l(d[y]^n),d[y+1]=l(d[y+1]^i),d[y+2]=l(d[y+2]^o),d[y+3]=l(d[y+3]^u),n=c,i=f,o=a,u=h;return _},a=function(){function t(e,r,n,i){var s=t.STEP,o=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength),f=0;for(this.asyncStream_=new c,this.asyncStream_.push(this.decryptChunk_(o.subarray(f,f+s),r,n,u)),f=s;f<o.length;f+=s)n=new Uint32Array([l(o[f-4]),l(o[f-3]),l(o[f-2]),l(o[f-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(f,f+s),r,n,u));this.asyncStream_.push(function(){
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).aesDecrypter={})}(this,(function(t){"use strict";function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t},r=null,i=function(){function t(t){var e,n,i;r||(r=function(){var t,e,n,r,i,s,o,u,l=[[[],[],[],[],[]],[[],[],[],[],[]]],c=l[0],f=l[1],a=c[4],h=f[4],y=[],p=[];for(t=0;t<256;t++)p[(y[t]=t<<1^283*(t>>7))^t]=t;for(e=n=0;!a[e];e^=r||1,n=p[n]||1)for(s=(s=n^n<<1^n<<2^n<<3^n<<4)>>8^255&s^99,a[e]=s,h[s]=e,u=16843009*y[i=y[r=y[e]]]^65537*i^257*r^16843008*e,o=257*y[s]^16843008*s,t=0;t<4;t++)c[t][e]=o=o<<24^o>>>8,f[t][s]=u=u<<24^u>>>8;for(t=0;t<5;t++)c[t]=c[t].slice(0),f[t]=f[t].slice(0);return l}()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];var s=this._tables[0][4],o=this._tables[1],u=t.length,l=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");var c=t.slice(0),f=[];for(this._key=[c,f],e=u;e<4*u+28;e++)i=c[e-1],(e%u==0||8===u&&e%u==4)&&(i=s[i>>>24]<<24^s[i>>16&255]<<16^s[i>>8&255]<<8^s[255&i],e%u==0&&(i=i<<8^i>>>24^l<<24,l=l<<1^283*(l>>7))),c[e]=c[e-u]^i;for(n=0;e;n++,e--)i=c[3&n?e:e-4],f[n]=e<=4||n<4?i:o[0][s[i>>>24]]^o[1][s[i>>16&255]]^o[2][s[i>>8&255]]^o[3][s[255&i]]}return t.prototype.decrypt=function(t,e,n,r,i,s){var o,u,l,c,f=this._key[1],a=t^f[0],h=r^f[1],y=n^f[2],p=e^f[3],b=f.length/4-2,d=4,_=this._tables[1],v=_[0],g=_[1],m=_[2],w=_[3],A=_[4];for(c=0;c<b;c++)o=v[a>>>24]^g[h>>16&255]^m[y>>8&255]^w[255&p]^f[d],u=v[h>>>24]^g[y>>16&255]^m[p>>8&255]^w[255&a]^f[d+1],l=v[y>>>24]^g[p>>16&255]^m[a>>8&255]^w[255&h]^f[d+2],p=v[p>>>24]^g[a>>16&255]^m[h>>8&255]^w[255&y]^f[d+3],d+=4,a=o,h=u,y=l;for(c=0;c<4;c++)i[(3&-c)+s]=A[a>>>24]<<24^A[h>>16&255]<<16^A[y>>8&255]<<8^A[255&p]^f[d++],o=a,a=h,h=y,y=p,p=o},t}();var s=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e},o=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var n=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(n,1),n>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var n=e.length,r=0;r<n;++r)e[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),s=e.length,o=0;o<s;++o)e[o].apply(this,i)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",(function(e){t.push(e)}))},t}(),u=function(t){function e(){var e;return(e=t.call(this,o)||this).jobs=[],e.delay=1,e.timeout_=null,e}s(e,t);var n=e.prototype;return n.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},e}(o);var l=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},c=function(t,e,n){var r,s,o,u,c,f,a,h,y,p=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),b=new i(Array.prototype.slice.call(e)),d=new Uint8Array(t.byteLength),_=new Int32Array(d.buffer);for(r=n[0],s=n[1],o=n[2],u=n[3],y=0;y<p.length;y+=4)c=l(p[y]),f=l(p[y+1]),a=l(p[y+2]),h=l(p[y+3]),b.decrypt(c,f,a,h,_,y),_[y]=l(_[y]^r),_[y+1]=l(_[y+1]^s),_[y+2]=l(_[y+2]^o),_[y+3]=l(_[y+3]^u),r=c,s=f,o=a,u=h;return d},f=function(){function t(e,n,r,i){var s=t.STEP,o=new Int32Array(e.buffer),c=new Uint8Array(e.byteLength),f=0;for(this.asyncStream_=new u,this.asyncStream_.push(this.decryptChunk_(o.subarray(f,f+s),n,r,c)),f=s;f<o.length;f+=s)r=new Uint32Array([l(o[f-4]),l(o[f-3]),l(o[f-2]),l(o[f-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(f,f+s),n,r,c));this.asyncStream_.push((function(){
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
var t;i(null,(t=u).subarray(0,t.byteLength-t[t.byteLength-1]))})}return t.prototype.decryptChunk_=function(t,e,r,n){return function(){var i=f(t,e,r);n.set(i,t.byteOffset)}},r(t,null,[{key:"STEP",get:function(){return 32e3}}]),t}();t.AsyncStream=c,t.Decrypter=a,t.decrypt=f,Object.defineProperty(t,"__esModule",{value:!0})});
var t;i(null,(t=c).subarray(0,t.byteLength-t[t.byteLength-1]))}))}return t.prototype.decryptChunk_=function(t,e,n,r){return function(){var i=c(t,e,n);r.set(i,t.byteOffset)}},n(t,null,[{key:"STEP",get:function(){return 32e3}}]),t}();t.AsyncStream=u,t.Decrypter=f,t.decrypt=c,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "aes-decrypter",
"version": "3.1.1",
"version": "3.1.2",
"description": "decrypt aes-128 content using a key",

@@ -50,16 +50,17 @@ "main": "dist/aes-decrypter.cjs.js",

"dependencies": {
"@babel/runtime": "^7.5.5",
"@babel/runtime": "^7.12.5",
"@videojs/vhs-utils": "^3.0.0",
"global": "^4.3.2",
"global": "^4.4.0",
"pkcs7": "^1.0.4"
},
"devDependencies": {
"rollup": "^1.19.4",
"@videojs/generator-helpers": "~1.2.0",
"karma": "^4.0.0",
"sinon": "^7.2.2",
"videojs-generate-karma-config": "~5.3.1",
"videojs-generator-verify": "~2.0.0",
"videojs-generate-rollup-config": "~5.0.1",
"videojs-standard": "^8.0.3"
"@rollup/plugin-replace": "^2.3.4",
"@videojs/generator-helpers": "~2.0.1",
"karma": "^5.2.3",
"rollup": "^2.36.1",
"sinon": "^9.2.3",
"videojs-generate-karma-config": "~7.0.0",
"videojs-generate-rollup-config": "~6.1.0",
"videojs-generator-verify": "~3.0.1",
"videojs-standard": "^8.0.4"
},

@@ -94,11 +95,5 @@ "generator-videojs-plugin": {

"lint-staged": {
"*.js": [
"vjsstandard --fix",
"git add"
],
"README.md": [
"doctoc --notitle",
"git add"
]
"*.js": "vjsstandard --fix",
"README.md": "doctoc --notitle"
}
}
const generate = require('videojs-generate-rollup-config');
const replace = require('@rollup/plugin-replace');

@@ -11,2 +12,19 @@ // see https://github.com/videojs/videojs-generate-rollup-config

return defaults;
},
primedPlugins(defaults) {
// when using "require" rather than import
// require cjs module
defaults.replace = replace({
// single quote replace
"require('@videojs/vhs-utils/es": "require('@videojs/vhs-utils/cjs",
// double quote replace
'require("@videojs/vhs-utils/es': 'require("@videojs/vhs-utils/cjs'
});
return defaults;
},
plugins(defaults) {
defaults.module.unshift('replace');
return defaults;
}

@@ -13,0 +31,0 @@ };

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc