AES256 related code on iOS and Android:
Http://www.tuicool.com/articles/RVFbmmU
You can download the relevant code inside.
The problem we are experiencing is:
Moving the Android code to the Java background appears to be unencrypted.
Have encountered the following 2 questions
1. No cipher getinstance support for aes/cbc/pkcs7padding
Solution: http://www.codeweblog.com/java-%E4%BD%BF%E7%94%A8aes-cbc-pkcs7padding-%E5%8A%A0%E8%A7%A3%E5%AF%86%E5%AD% 97%e7%ac%a6%e4%b8%b2/
2. AES256 cannot be encrypted (perhaps a Java environment issue)
Solution: Change AES256 to AES128
Related code:
iOS code: (I've re-optimized the relevant iOS code on GitHub)
Https://github.com/xzjxylophone/RXCategory
In the nsstring+rxutility:
-(nsstring *) Rx_transform_aes128encryptwithkey: (nsstring *) key;
-(nsstring *) Rx_transform_aes128decryptwithkey: (nsstring *) key;
Java code: (for Android and Java background)
In the Ase.java, put the following
Private final int key_length = n;
The 256 change to 128, so that Ios,android and the Java background are consistent.
The difference between AES128 and AES256
http://blog.csdn.net/newizan/article/details/45461347
That's almost it. 128 is enough.
Ios,android,jave background AES Encryption and decryption