console info, cipher object

This commit is contained in:
ReznoRMichael 2021-01-23 13:48:34 +01:00
parent 1cf904b331
commit 566f3bcdfa

View file

@ -98,8 +98,8 @@ function ProcessFileObject() {
// alert(`Decoded String: ${decodedString}`); // alert(`Decoded String: ${decodedString}`);
// alert(`Array Buffer: ${inputArrayBuffer}`); // alert(`Array Buffer: ${inputArrayBuffer}`);
} catch (error) { } catch (error) {
alert(`The file cannot be decoded. Error: ${error}`); alert(`The file cannot be decoded. ${error}`);
console.info(`The file cannot be decoded. Error: ${error}`); console.info(`The file cannot be decoded. ${error}`);
} }
} }
@ -171,7 +171,7 @@ function Base64Decode(buffer) {
* @param {Uint8Array} buffer Uint8Array buffer to decrypt * @param {Uint8Array} buffer Uint8Array buffer to decrypt
* @returns {Uint8Array} * @returns {Uint8Array}
*/ */
function AESDecryption(buffer) { function AESDecryption(buffer, cipherObject = ECB_STREAM_CIPHER) {
let output = ECB_STREAM_CIPHER.decrypt(buffer); let output = cipherObject.decrypt(buffer);
return output.subarray(0, -output[output.length - 1]); return output.subarray(0, -output[output.length - 1]);
} }