diglol/crypto

AES/CBC/PKCS5Padding vs AES/CBC/PKCS7Padding

Closed this issue · 4 comments

Hi first of all great library!

I want to use AES/CBC/PKCS7Padding and I noticed that the jvm implementation uses AES/CBC/PKCS5Padding where the darwin one uses AES/CBC/PKCS7Padding

Any reason for that? would you accept a PR where the padding is passed as parameter and the user can specify which padding to use ? thanks!

I've actually just now noticed that only platform.CoreCrypto.kCCOptionPKCS7Padding padding is supported making the darwin implementation impossible for the PKCS5Padding, but still looks like is incompatible with the JVM counterpart?

probably this answers my question?

tldr: in java implementation AES/CBC/PKCS5Padding is synonymous of AES/CBC/PKCS7Padding

I guess I'll auto-close my issue 😅
AES/CBC/PKCS7Padding does not exist in java and AES/CBC/PKCS5Padding is the same algorithm
https://stackoverflow.com/a/29234136

Yes, thanks for the clarification, I had the same confusion before.