PointyCastle / pointycastle

Moved into the Bouncy Castle project: https://github.com/bcgit/pc-dart
MIT License
270 stars 76 forks source link

aes decrypt result error #179

Closed chinabrant closed 5 years ago

chinabrant commented 5 years ago

My function.

static List<int> aes128Decode(List<int> data) {

    BlockCipher cipher = ECBBlockCipher(AESFastEngine());
    cipher.init(false, KeyParameter(Uint8List.fromList('15helloTCJTALK20'.runes.toList())));

    final result = cipher.process(Uint8List.fromList(data)).toList();

    print('result: ${String.fromCharCodes(result)}');

    return result;
  }

console output:

flutter: result: {"moment":{"url"

The result should be a json. but i just got 16 characters. What's wrong?

Help, thanks.

christophewang commented 5 years ago

@chinabrant Did you solve your problem ? I'm currently having the same issue when I try to decrypt using AES. I'm expecting 32 bytes but I only get the 16 first bytes.

chinabrant commented 5 years ago

https://github.com/leocavalcante/encrypt/issues/32