🐛 Do not skip encryption header in decryptChunk
This commit is contained in:
parent
213fcf91f7
commit
02f4d3ecb5
1 changed files with 1 additions and 4 deletions
|
@ -10,10 +10,7 @@ export default function decryptChunk(encryptedChunk: Buffer, [key0, key1, key2]:
|
|||
const keyPart = (key2 | 2) & 0xFFFF;
|
||||
const decryptedByte = (keyPart * (keyPart ^ 1)) >>> 8;
|
||||
curChar ^= decryptedByte & 0xFF;
|
||||
//Skip the first 12 bytes (random encryption header)
|
||||
if (i >= 12) {
|
||||
dvOut.setUint8(i - 12, curChar);
|
||||
}
|
||||
dvOut.setUint8(i, curChar);
|
||||
|
||||
//update keys
|
||||
[key0, key1, key2] = updateKeys([key0, key1, key2], curChar);
|
||||
|
|
Loading…
Reference in a new issue