AES-256 and PKCS7Padding fails in Java

前端 未结 1 556
野性不改
野性不改 2020-12-16 06:17

I have a couple of library, C#, PHP and Android where they all encrypt/decrypt a string in the same way so they are all compatible with each other, i.e. C# writes and encryp

相关标签:
1条回答
  • 2020-12-16 06:46

    First, in Java, the standard padding name is PKCS5Padding, not PKCS7Padding. Java is actually performing PKCS #7 padding, but in the JCA specification, PKCS5Padding is the name given.

    Next, you are trying to use AES-256, so you'll need to install the Unlimited Strength Jurisdiction policy files.

    Hopefully this is just an example and you aren't using the same IV for every message, right?

    0 讨论(0)
提交回复
热议问题