diff --git a/src/ssn/decryption/decryptChunk.ts b/src/ssn/decryption/decryptChunk.ts index 7966e81..b41ca26 100644 --- a/src/ssn/decryption/decryptChunk.ts +++ b/src/ssn/decryption/decryptChunk.ts @@ -6,7 +6,7 @@ export default function decryptChunk(encryptedChunk: Buffer, [key0, key1, key2]: const decryptedChunk = new Buffer(encryptedChunk.length); const dvOut = new DataView(decryptedChunk.buffer); - for (let i = 0; i < length; i += 1) { + for (let i = 0; i < encryptedChunk.length; i += 1) { //read and decrypt byte let curChar = dv.getUint8(i); const keyPart = (key2 | 2) & 0xFFFF;