cryptography – How to decrypt large files (1 GB) with AES-CTR chunk by chunk in javascript (browsers)?

The only flaws in your implementation is actually the conversion between integer and byte array. Firstly, in JavaScript the maximum integer is 0x1FFFFFFFFFFFFFF, see here, secondly, even with smaller numbers the little endian order is used, but the WebCrypto API applies the big endian order. As a first step to a fix you could use … Read more