AKushWarrior / steel_crypt

A collection of high-level API's exposing PointyCastle to perform hashing and encrypting in popular/secure algorithms.
https://pub.dev/packages/steel_crypt
Mozilla Public License 2.0
40 stars 10 forks source link

Invalid argument(s): Invalid or corrupted pad block #29

Closed YDJSZY closed 4 years ago

AKushWarrior commented 4 years ago

Could you provide any more context? I assume you're using AESCrypt(). What arguments did you pass?

YDJSZY commented 4 years ago

I encrypt data then send it to server, the server return success and other encrypt data,but I decrypt fail. var iv = xxx; var key = xxx; var aesEncrypter = AesCrypt(key, 'cbc', 'pkcs7'); String encrypted = aesEncrypter.encrypt(data, iv) Map postData = { "params": encrypted, xxx, xxx }; var res = await request.login(postData); final myResData = aesEncrypter.decrypt(res, iv); throw error Invalid or corrupted pad block. I don‘t know what's wrong

YDJSZY commented 4 years ago

Can you give me a favor ? I don‘t know what's wrong...

AKushWarrior commented 4 years ago

I don't know what is wrong either ;)

Can you give me an example set of data (with IV, realtext, key, and ciphertext)?

AKushWarrior commented 4 years ago

I can't look at what's going wrong without some actual data sets to work with.

AKushWarrior commented 4 years ago

I'll reopen if you can provide data.