Convert code in src/core/crypto.js to use "normal" classes

All of this code predates the existence of native JS classes, however we can now clean this up a bit. This patch thus let us remove some variable "shadowing" from the code.
This commit is contained in:
Jonas Jenwald 2021-02-26 15:51:45 +01:00
parent b884757873
commit 6b4c4f80e4

View File

@ -28,9 +28,8 @@ import {
import { isDict, isName, Name } from "./primitives.js"; import { isDict, isName, Name } from "./primitives.js";
import { DecryptStream } from "./stream.js"; import { DecryptStream } from "./stream.js";
var ARCFourCipher = (function ARCFourCipherClosure() { class ARCFourCipher {
// eslint-disable-next-line no-shadow constructor(key) {
function ARCFourCipher(key) {
this.a = 0; this.a = 0;
this.b = 0; this.b = 0;
var s = new Uint8Array(256); var s = new Uint8Array(256);
@ -50,8 +49,7 @@ var ARCFourCipher = (function ARCFourCipherClosure() {
this.s = s; this.s = s;
} }
ARCFourCipher.prototype = { encryptBlock(data) {
encryptBlock: function ARCFourCipher_encryptBlock(data) {
var i, var i,
n = data.length, n = data.length,
tmp, tmp,
@ -72,13 +70,16 @@ var ARCFourCipher = (function ARCFourCipherClosure() {
this.a = a; this.a = a;
this.b = b; this.b = b;
return output; return output;
}, }
};
ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock;
ARCFourCipher.prototype.encrypt = ARCFourCipher.prototype.encryptBlock;
return ARCFourCipher; decryptBlock(data) {
})(); return this.encryptBlock(data);
}
encrypt(data) {
return this.encryptBlock(data);
}
}
var calculateMD5 = (function calculateMD5Closure() { var calculateMD5 = (function calculateMD5Closure() {
// prettier-ignore // prettier-ignore
@ -180,28 +181,29 @@ var calculateMD5 = (function calculateMD5Closure() {
return hash; return hash;
})(); })();
var Word64 = (function Word64Closure() {
// eslint-disable-next-line no-shadow class Word64 {
function Word64(highInteger, lowInteger) { constructor(highInteger, lowInteger) {
this.high = highInteger | 0; this.high = highInteger | 0;
this.low = lowInteger | 0; this.low = lowInteger | 0;
} }
Word64.prototype = {
and: function Word64_and(word) { and(word) {
this.high &= word.high; this.high &= word.high;
this.low &= word.low; this.low &= word.low;
}, }
xor: function Word64_xor(word) {
xor(word) {
this.high ^= word.high; this.high ^= word.high;
this.low ^= word.low; this.low ^= word.low;
}, }
or: function Word64_or(word) { or(word) {
this.high |= word.high; this.high |= word.high;
this.low |= word.low; this.low |= word.low;
}, }
shiftRight: function Word64_shiftRight(places) { shiftRight(places) {
if (places >= 32) { if (places >= 32) {
this.low = (this.high >>> (places - 32)) | 0; this.low = (this.high >>> (places - 32)) | 0;
this.high = 0; this.high = 0;
@ -209,9 +211,9 @@ var Word64 = (function Word64Closure() {
this.low = (this.low >>> places) | (this.high << (32 - places)); this.low = (this.low >>> places) | (this.high << (32 - places));
this.high = (this.high >>> places) | 0; this.high = (this.high >>> places) | 0;
} }
}, }
shiftLeft: function Word64_shiftLeft(places) { shiftLeft(places) {
if (places >= 32) { if (places >= 32) {
this.high = this.low << (places - 32); this.high = this.low << (places - 32);
this.low = 0; this.low = 0;
@ -219,9 +221,9 @@ var Word64 = (function Word64Closure() {
this.high = (this.high << places) | (this.low >>> (32 - places)); this.high = (this.high << places) | (this.low >>> (32 - places));
this.low = this.low << places; this.low = this.low << places;
} }
}, }
rotateRight: function Word64_rotateRight(places) { rotateRight(places) {
var low, high; var low, high;
if (places & 32) { if (places & 32) {
high = this.low; high = this.low;
@ -233,14 +235,14 @@ var Word64 = (function Word64Closure() {
places &= 31; places &= 31;
this.low = (low >>> places) | (high << (32 - places)); this.low = (low >>> places) | (high << (32 - places));
this.high = (high >>> places) | (low << (32 - places)); this.high = (high >>> places) | (low << (32 - places));
}, }
not: function Word64_not() { not() {
this.high = ~this.high; this.high = ~this.high;
this.low = ~this.low; this.low = ~this.low;
}, }
add: function Word64_add(word) { add(word) {
var lowAdd = (this.low >>> 0) + (word.low >>> 0); var lowAdd = (this.low >>> 0) + (word.low >>> 0);
var highAdd = (this.high >>> 0) + (word.high >>> 0); var highAdd = (this.high >>> 0) + (word.high >>> 0);
if (lowAdd > 0xffffffff) { if (lowAdd > 0xffffffff) {
@ -248,9 +250,9 @@ var Word64 = (function Word64Closure() {
} }
this.low = lowAdd | 0; this.low = lowAdd | 0;
this.high = highAdd | 0; this.high = highAdd | 0;
}, }
copyTo: function Word64_copyTo(bytes, offset) { copyTo(bytes, offset) {
bytes[offset] = (this.high >>> 24) & 0xff; bytes[offset] = (this.high >>> 24) & 0xff;
bytes[offset + 1] = (this.high >> 16) & 0xff; bytes[offset + 1] = (this.high >> 16) & 0xff;
bytes[offset + 2] = (this.high >> 8) & 0xff; bytes[offset + 2] = (this.high >> 8) & 0xff;
@ -259,15 +261,13 @@ var Word64 = (function Word64Closure() {
bytes[offset + 5] = (this.low >> 16) & 0xff; bytes[offset + 5] = (this.low >> 16) & 0xff;
bytes[offset + 6] = (this.low >> 8) & 0xff; bytes[offset + 6] = (this.low >> 8) & 0xff;
bytes[offset + 7] = this.low & 0xff; bytes[offset + 7] = this.low & 0xff;
}, }
assign: function Word64_assign(word) { assign(word) {
this.high = word.high; this.high = word.high;
this.low = word.low; this.low = word.low;
}, }
}; }
return Word64;
})();
var calculateSHA256 = (function calculateSHA256Closure() { var calculateSHA256 = (function calculateSHA256Closure() {
function rotr(x, n) { function rotr(x, n) {
@ -521,8 +521,7 @@ var calculateSHA512 = (function calculateSHA512Closure() {
new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a),
new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)];
function hash(data, offset, length, mode384) { function hash(data, offset, length, mode384 = false) {
mode384 = !!mode384;
// initial hash values // initial hash values
var h0, h1, h2, h3, h4, h5, h6, h7; var h0, h1, h2, h3, h4, h5, h6, h7;
if (!mode384) { if (!mode384) {
@ -687,28 +686,20 @@ var calculateSHA512 = (function calculateSHA512Closure() {
return hash; return hash;
})(); })();
var calculateSHA384 = (function calculateSHA384Closure() {
function hash(data, offset, length) { function calculateSHA384(data, offset, length) {
return calculateSHA512(data, offset, length, true); return calculateSHA512(data, offset, length, /* mode384 = */ true);
}
class NullCipher {
decryptBlock(data) {
return data;
} }
return hash; encrypt(data) {
})();
var NullCipher = (function NullCipherClosure() {
// eslint-disable-next-line no-shadow
function NullCipher() {}
NullCipher.prototype = {
decryptBlock: function NullCipher_decryptBlock(data) {
return data; return data;
}, }
encrypt: function NullCipher_encrypt(data) { }
return data;
},
};
return NullCipher;
})();
class AESBaseCipher { class AESBaseCipher {
constructor() { constructor() {
@ -1262,41 +1253,25 @@ class AES256Cipher extends AESBaseCipher {
} }
} }
var PDF17 = (function PDF17Closure() { class PDF17 {
// eslint-disable-next-line no-shadow checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) {
function PDF17() {}
PDF17.prototype = {
checkOwnerPassword: function PDF17_checkOwnerPassword(
password,
ownerValidationSalt,
userBytes,
ownerPassword
) {
var hashData = new Uint8Array(password.length + 56); var hashData = new Uint8Array(password.length + 56);
hashData.set(password, 0); hashData.set(password, 0);
hashData.set(ownerValidationSalt, password.length); hashData.set(ownerValidationSalt, password.length);
hashData.set(userBytes, password.length + ownerValidationSalt.length); hashData.set(userBytes, password.length + ownerValidationSalt.length);
var result = calculateSHA256(hashData, 0, hashData.length); var result = calculateSHA256(hashData, 0, hashData.length);
return isArrayEqual(result, ownerPassword); return isArrayEqual(result, ownerPassword);
}, }
checkUserPassword: function PDF17_checkUserPassword(
password, checkUserPassword(password, userValidationSalt, userPassword) {
userValidationSalt,
userPassword
) {
var hashData = new Uint8Array(password.length + 8); var hashData = new Uint8Array(password.length + 8);
hashData.set(password, 0); hashData.set(password, 0);
hashData.set(userValidationSalt, password.length); hashData.set(userValidationSalt, password.length);
var result = calculateSHA256(hashData, 0, hashData.length); var result = calculateSHA256(hashData, 0, hashData.length);
return isArrayEqual(result, userPassword); return isArrayEqual(result, userPassword);
}, }
getOwnerKey: function PDF17_getOwnerKey(
password, getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {
ownerKeySalt,
userBytes,
ownerEncryption
) {
var hashData = new Uint8Array(password.length + 56); var hashData = new Uint8Array(password.length + 56);
hashData.set(password, 0); hashData.set(password, 0);
hashData.set(ownerKeySalt, password.length); hashData.set(ownerKeySalt, password.length);
@ -1304,12 +1279,9 @@ var PDF17 = (function PDF17Closure() {
var key = calculateSHA256(hashData, 0, hashData.length); var key = calculateSHA256(hashData, 0, hashData.length);
var cipher = new AES256Cipher(key); var cipher = new AES256Cipher(key);
return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));
}, }
getUserKey: function PDF17_getUserKey(
password, getUserKey(password, userKeySalt, userEncryption) {
userKeySalt,
userEncryption
) {
var hashData = new Uint8Array(password.length + 8); var hashData = new Uint8Array(password.length + 8);
hashData.set(password, 0); hashData.set(password, 0);
hashData.set(userKeySalt, password.length); hashData.set(userKeySalt, password.length);
@ -1317,10 +1289,8 @@ var PDF17 = (function PDF17Closure() {
var key = calculateSHA256(hashData, 0, hashData.length); var key = calculateSHA256(hashData, 0, hashData.length);
var cipher = new AES256Cipher(key); var cipher = new AES256Cipher(key);
return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));
}, }
}; }
return PDF17;
})();
var PDF20 = (function PDF20Closure() { var PDF20 = (function PDF20Closure() {
function calculatePDF20Hash(password, input, userBytes) { function calculatePDF20Hash(password, input, userBytes) {
@ -1370,13 +1340,12 @@ var PDF20 = (function PDF20Closure() {
} }
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
function PDF20() {} class PDF20 {
hash(password, concatBytes, userBytes) {
PDF20.prototype = {
hash: function PDF20_hash(password, concatBytes, userBytes) {
return calculatePDF20Hash(password, concatBytes, userBytes); return calculatePDF20Hash(password, concatBytes, userBytes);
}, }
checkOwnerPassword: function PDF20_checkOwnerPassword(
checkOwnerPassword(
password, password,
ownerValidationSalt, ownerValidationSalt,
userBytes, userBytes,
@ -1388,24 +1357,17 @@ var PDF20 = (function PDF20Closure() {
hashData.set(userBytes, password.length + ownerValidationSalt.length); hashData.set(userBytes, password.length + ownerValidationSalt.length);
var result = calculatePDF20Hash(password, hashData, userBytes); var result = calculatePDF20Hash(password, hashData, userBytes);
return isArrayEqual(result, ownerPassword); return isArrayEqual(result, ownerPassword);
}, }
checkUserPassword: function PDF20_checkUserPassword(
password, checkUserPassword(password, userValidationSalt, userPassword) {
userValidationSalt,
userPassword
) {
var hashData = new Uint8Array(password.length + 8); var hashData = new Uint8Array(password.length + 8);
hashData.set(password, 0); hashData.set(password, 0);
hashData.set(userValidationSalt, password.length); hashData.set(userValidationSalt, password.length);
var result = calculatePDF20Hash(password, hashData, []); var result = calculatePDF20Hash(password, hashData, []);
return isArrayEqual(result, userPassword); return isArrayEqual(result, userPassword);
}, }
getOwnerKey: function PDF20_getOwnerKey(
password, getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {
ownerKeySalt,
userBytes,
ownerEncryption
) {
var hashData = new Uint8Array(password.length + 56); var hashData = new Uint8Array(password.length + 56);
hashData.set(password, 0); hashData.set(password, 0);
hashData.set(ownerKeySalt, password.length); hashData.set(ownerKeySalt, password.length);
@ -1413,12 +1375,9 @@ var PDF20 = (function PDF20Closure() {
var key = calculatePDF20Hash(password, hashData, userBytes); var key = calculatePDF20Hash(password, hashData, userBytes);
var cipher = new AES256Cipher(key); var cipher = new AES256Cipher(key);
return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));
}, }
getUserKey: function PDF20_getUserKey(
password, getUserKey(password, userKeySalt, userEncryption) {
userKeySalt,
userEncryption
) {
var hashData = new Uint8Array(password.length + 8); var hashData = new Uint8Array(password.length + 8);
hashData.set(password, 0); hashData.set(password, 0);
hashData.set(userKeySalt, password.length); hashData.set(userKeySalt, password.length);
@ -1426,20 +1385,19 @@ var PDF20 = (function PDF20Closure() {
var key = calculatePDF20Hash(password, hashData, []); var key = calculatePDF20Hash(password, hashData, []);
var cipher = new AES256Cipher(key); var cipher = new AES256Cipher(key);
return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));
}, }
}; }
return PDF20; return PDF20;
})(); })();
var CipherTransform = (function CipherTransformClosure() { class CipherTransform {
// eslint-disable-next-line no-shadow constructor(stringCipherConstructor, streamCipherConstructor) {
function CipherTransform(stringCipherConstructor, streamCipherConstructor) {
this.StringCipherConstructor = stringCipherConstructor; this.StringCipherConstructor = stringCipherConstructor;
this.StreamCipherConstructor = streamCipherConstructor; this.StreamCipherConstructor = streamCipherConstructor;
} }
CipherTransform.prototype = { createStream(stream, length) {
createStream: function CipherTransform_createStream(stream, length) {
var cipher = new this.StreamCipherConstructor(); var cipher = new this.StreamCipherConstructor();
return new DecryptStream( return new DecryptStream(
stream, stream,
@ -1448,14 +1406,16 @@ var CipherTransform = (function CipherTransformClosure() {
return cipher.decryptBlock(data, finalize); return cipher.decryptBlock(data, finalize);
} }
); );
}, }
decryptString: function CipherTransform_decryptString(s) {
decryptString(s) {
var cipher = new this.StringCipherConstructor(); var cipher = new this.StringCipherConstructor();
var data = stringToBytes(s); var data = stringToBytes(s);
data = cipher.decryptBlock(data, true); data = cipher.decryptBlock(data, true);
return bytesToString(data); return bytesToString(data);
}, }
encryptString: function CipherTransform_encryptString(s) {
encryptString(s) {
const cipher = new this.StringCipherConstructor(); const cipher = new this.StringCipherConstructor();
if (cipher instanceof AESBaseCipher) { if (cipher instanceof AESBaseCipher) {
// Append some chars equal to "16 - (M mod 16)" // Append some chars equal to "16 - (M mod 16)"
@ -1490,10 +1450,8 @@ var CipherTransform = (function CipherTransformClosure() {
let data = stringToBytes(s); let data = stringToBytes(s);
data = cipher.encrypt(data); data = cipher.encrypt(data);
return bytesToString(data); return bytesToString(data);
}, }
}; }
return CipherTransform;
})();
var CipherTransformFactory = (function CipherTransformFactoryClosure() { var CipherTransformFactory = (function CipherTransformFactoryClosure() {
// prettier-ignore // prettier-ignore
@ -1684,8 +1642,67 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
var identityName = Name.get("Identity"); var identityName = Name.get("Identity");
function buildObjectKey(num, gen, encryptionKey, isAes = false) {
var key = new Uint8Array(encryptionKey.length + 9),
i,
n;
for (i = 0, n = encryptionKey.length; i < n; ++i) {
key[i] = encryptionKey[i];
}
key[i++] = num & 0xff;
key[i++] = (num >> 8) & 0xff;
key[i++] = (num >> 16) & 0xff;
key[i++] = gen & 0xff;
key[i++] = (gen >> 8) & 0xff;
if (isAes) {
key[i++] = 0x73;
key[i++] = 0x41;
key[i++] = 0x6c;
key[i++] = 0x54;
}
var hash = calculateMD5(key, 0, i);
return hash.subarray(0, Math.min(encryptionKey.length + 5, 16));
}
function buildCipherConstructor(cf, name, num, gen, key) {
if (!isName(name)) {
throw new FormatError("Invalid crypt filter name.");
}
var cryptFilter = cf.get(name.name);
var cfm;
if (cryptFilter !== null && cryptFilter !== undefined) {
cfm = cryptFilter.get("CFM");
}
if (!cfm || cfm.name === "None") {
return function cipherTransformFactoryBuildCipherConstructorNone() {
return new NullCipher();
};
}
if (cfm.name === "V2") {
return function cipherTransformFactoryBuildCipherConstructorV2() {
return new ARCFourCipher(
buildObjectKey(num, gen, key, /* isAes = */ false)
);
};
}
if (cfm.name === "AESV2") {
return function cipherTransformFactoryBuildCipherConstructorAESV2() {
return new AES128Cipher(
buildObjectKey(num, gen, key, /* isAes = */ true)
);
};
}
if (cfm.name === "AESV3") {
return function cipherTransformFactoryBuildCipherConstructorAESV3() {
return new AES256Cipher(key);
};
}
throw new FormatError("Unknown crypto method");
}
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
function CipherTransformFactory(dict, fileId, password) { class CipherTransformFactory {
constructor(dict, fileId, password) {
var filter = dict.get("Filter"); var filter = dict.get("Filter");
if (!isName(filter, "Standard")) { if (!isName(filter, "Standard")) {
throw new FormatError("unknown encryption method"); throw new FormatError("unknown encryption method");
@ -1694,7 +1711,10 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
var algorithm = dict.get("V"); var algorithm = dict.get("V");
if ( if (
!Number.isInteger(algorithm) || !Number.isInteger(algorithm) ||
(algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) (algorithm !== 1 &&
algorithm !== 2 &&
algorithm !== 4 &&
algorithm !== 5)
) { ) {
throw new FormatError("unsupported encryption algorithm"); throw new FormatError("unsupported encryption algorithm");
} }
@ -1715,13 +1735,18 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
var handlerDict = cfDict.get(streamCryptoName.name); var handlerDict = cfDict.get(streamCryptoName.name);
keyLength = (handlerDict && handlerDict.get("Length")) || 128; keyLength = (handlerDict && handlerDict.get("Length")) || 128;
if (keyLength < 40) { if (keyLength < 40) {
// Sometimes it's incorrect value of bits, generators specify bytes. // Sometimes it's incorrect value of bits, generators specify
// bytes.
keyLength <<= 3; keyLength <<= 3;
} }
} }
} }
} }
if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { if (
!Number.isInteger(keyLength) ||
keyLength < 40 ||
keyLength % 8 !== 0
) {
throw new FormatError("invalid key length"); throw new FormatError("invalid key length");
} }
@ -1827,8 +1852,8 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
if (isDict(cf)) { if (isDict(cf)) {
// The 'CF' dictionary itself should not be encrypted, and by setting // The 'CF' dictionary itself should not be encrypted, and by setting
// `suppressEncryption` we can prevent an infinite loop inside of // `suppressEncryption` we can prevent an infinite loop inside of
// `XRef_fetchUncompressed` if the dictionary contains indirect objects // `XRef_fetchUncompressed` if the dictionary contains indirect
// (fixes issue7665.pdf). // objects (fixes issue7665.pdf).
cf.suppressEncryption = true; cf.suppressEncryption = true;
} }
this.cf = cf; this.cf = cf;
@ -1838,65 +1863,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
} }
} }
function buildObjectKey(num, gen, encryptionKey, isAes) { createCipherTransform(num, gen) {
var key = new Uint8Array(encryptionKey.length + 9),
i,
n;
for (i = 0, n = encryptionKey.length; i < n; ++i) {
key[i] = encryptionKey[i];
}
key[i++] = num & 0xff;
key[i++] = (num >> 8) & 0xff;
key[i++] = (num >> 16) & 0xff;
key[i++] = gen & 0xff;
key[i++] = (gen >> 8) & 0xff;
if (isAes) {
key[i++] = 0x73;
key[i++] = 0x41;
key[i++] = 0x6c;
key[i++] = 0x54;
}
var hash = calculateMD5(key, 0, i);
return hash.subarray(0, Math.min(encryptionKey.length + 5, 16));
}
function buildCipherConstructor(cf, name, num, gen, key) {
if (!isName(name)) {
throw new FormatError("Invalid crypt filter name.");
}
var cryptFilter = cf.get(name.name);
var cfm;
if (cryptFilter !== null && cryptFilter !== undefined) {
cfm = cryptFilter.get("CFM");
}
if (!cfm || cfm.name === "None") {
return function cipherTransformFactoryBuildCipherConstructorNone() {
return new NullCipher();
};
}
if (cfm.name === "V2") {
return function cipherTransformFactoryBuildCipherConstructorV2() {
return new ARCFourCipher(buildObjectKey(num, gen, key, false));
};
}
if (cfm.name === "AESV2") {
return function cipherTransformFactoryBuildCipherConstructorAESV2() {
return new AES128Cipher(buildObjectKey(num, gen, key, true));
};
}
if (cfm.name === "AESV3") {
return function cipherTransformFactoryBuildCipherConstructorAESV3() {
return new AES256Cipher(key);
};
}
throw new FormatError("Unknown crypto method");
}
CipherTransformFactory.prototype = {
createCipherTransform: function CipherTransformFactory_createCipherTransform(
num,
gen
) {
if (this.algorithm === 4 || this.algorithm === 5) { if (this.algorithm === 4 || this.algorithm === 5) {
return new CipherTransform( return new CipherTransform(
buildCipherConstructor( buildCipherConstructor(
@ -1916,13 +1883,18 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
); );
} }
// algorithms 1 and 2 // algorithms 1 and 2
var key = buildObjectKey(num, gen, this.encryptionKey, false); var key = buildObjectKey(
num,
gen,
this.encryptionKey,
/* isAes = */ false
);
var cipherConstructor = function buildCipherCipherConstructor() { var cipherConstructor = function buildCipherCipherConstructor() {
return new ARCFourCipher(key); return new ARCFourCipher(key);
}; };
return new CipherTransform(cipherConstructor, cipherConstructor); return new CipherTransform(cipherConstructor, cipherConstructor);
}, }
}; }
return CipherTransformFactory; return CipherTransformFactory;
})(); })();