hemisemidemipresent / NKsku

A multi-purpose library for decrypting Profile.save and other data, as well as making valid requests to NK's server
https://www.npmjs.com/package/nksku
13 stars 2 forks source link

Error: EVP_DecryptFinal_ex:wrong final block length #1

Closed dodieboy closed 2 years ago

dodieboy commented 2 years ago

Hey, i tried to unpack a DGDATA file (Profile.save) using the upacking code but it gets the following error below. I tried using nksku.dgdata.decode(bytes).toString('utf-8'); and the it work great with no decryption error. Any idea what I did wrong?

PS C:\Users\Alan\Desktop\SAS4\a> node --trace-warnings index.js 
Promise { <pending> }
(node:16788) UnhandledPromiseRejectionWarning: Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at Object.unpack (C:\Users\Alan\Desktop\SAS4\a\node_modules\nksku\nksave.js:46:30)
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:16788) Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at Object.unpack (C:\Users\Alan\Desktop\SAS4\a\node_modules\nksku\nksave.js:46:30)
(node:16788) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    at emitDeprecationWarning (internal/process/promises.js:180:11)
    at processPromiseRejections (internal/process/promises.js:249:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
hemisemidemipresent commented 2 years ago

Profile.save is not encoded in DGDATA, at least not Btd6's Profile.save

dodieboy commented 2 years ago

O, i see. Yup this is a SAS profile.save file