Objective-c AES encryption doesn't look like java AES encryption

一笑奈何 提交于 2019-12-03 17:44:35

I've never done any Objective-C programming, but I'm almost positive that you're using AES in different modes in your code. You need to make sure these are consistent. The default is probably Cipher Block Chaining (CBC) mode. Make sure you set this option in your Java code.

By the way, CBC mode should have a randomized Initialization Vector (IV) rather than NULL (which I assume uses all zeros). This too would need to be consistent across both.

I'm obliged to give standard disclaimer with cryptography that it's usually much safer to use a higher level protocol that handles this stuff for you like SSL/TLS for data in transit and something like Keyczar for data at rest. Getting crypto right is really hard and a tiny error (like picking a bad mode) can totally destroy the security of the system.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!