PointyCastle / pointycastle

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

Using ISO padding? #200

Closed AKushWarrior closed 5 years ago

AKushWarrior commented 5 years ago

The README notes state that you can use ISO7816-4 as a padding. How would this be achieved with AES? My code currently looks like this to encrypt:

var key = utf8.encode(key32);
var ivLocal = utf8.encode(iv);
CipherParameters params = PaddedBlockCipherParameters(ParametersWithIV(KeyParameter(key), ivLocal), null);
PaddedBlockCipherImpl cipherImpl = PaddedBlockCipherImpl(Padding('ISO7816-4'), CBCBlockCipher(AESFastEngine()));
cipherImpl.init(true, params);
return cipherImpl.process(utf8.encode(input));

I know this package is mostly inactive, but could anyone help me out?

AKushWarrior commented 5 years ago

Note: key, ivLocal, and input are all parameters for the helper function above.

AKushWarrior commented 5 years ago

Never mind, figured it out. You need to import the github instead of the pub version.