简体   繁体   中英

Encrypt information on Java and Decrypt it on Objective-C/C++/C

I'm trying to encrypt a string on Java and send it to an iOS device, so far I'm able to encrypt easily the string using this functions but the hard part is on iOS.

On iOS I've been experimenting with different Blowfish libraries from http://www.schneier.com/blowfish-download.html but without success, the algorithms might not even be compatible with the Java output but I'm not sure so I'd like to ask for advice on decrypting this string on the device.

Use AES256 or AES512 . Put an eye on salt and seed . Or your encrypted string may not be readable after decrypting on other machine.

As the others have said, use AES instead of Blowfish. Even Schneier says not to use Blowfish - if you require extra security then use Serpent, otherwise use the standard.

In addition to using AES, I also recommend that you use Counter Mode - this encryption mode doesn't require padding, so that's one less thing you need to worry about when matching up your encryption and decryption methods. However, you're fine with using any of the other NIST modes other than Electronic Codebook.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM