Decrypting data that was AES encrypted with Objective-C with Java

前端 未结 3 727
没有蜡笔的小新
没有蜡笔的小新 2021-02-03 15:25

I try to decrypt data that was originally encrypted with Objective-C in Java.

There are other questions mentioning this but they are really cluttered and many of them a

3条回答
  •  心在旅途
    2021-02-03 16:23

    You potentially have a bunch of issues.

    When doing any encryption/decryption you need to ensure:

    • string encoding is identical (you're using UTF8 in both, thats good)
    • padding scheme is identical (you have pkcs5 on one and pkcs7 on the other)
    • initialisation vector is identical (you have null on one and empty bytes on the other)

    ..and of course the encryption scheme is identical. Confusingly your encryption seems to be using AES128, although the comments discuss using AES256. Not sure what the Java version is using

提交回复
热议问题