#aes encrypt with Android Jni based by openssl evp api this is a project process aes encrypt and decrpty , JNI packed, and use OPENSSL EVP api.
##folder tree:
|
|-sosec (the root folder of ndk build)
|--myApp (main cpp folder)
|--libs (the output armeabi/armeabi-v7a so files folder)
|--...
|
|-testAES (the root folder of android project)
|--src (the source folder contains test main function)
|--libs (the so files created by sosec/libs)
|--...
##QuickStart:
- download the latest NDK from developer.google.com and install it on path /home/NDK , in this example ,the ndk version is r10d-linux64, so after installed ,the NDK path is /home/NDK/android-ndk-r10d
- to check NDK installed ,entry the ndk path ,type ndk-build cmd in bash .
- copy sosec folder to path /home/sosec ,in this example ,the path is /home/sosec
- entry the sosec path in your bash (cd home/sosec)
- :~/sosec$../NDK/android-ndk-r10d/ndk-build
- it will notice ": libsosec.so => libs/armeabi/libsosec.so" , copy this libsosec.so to libs path in your android project, then use JniHelp.java in the example code to use this so library.
the main source code is in path sosec/myApp/, pls modify the code under this path ,don't modify the code outside myApp
##Use:
final String srouce = "12374488";
final String key = "abcdefg12345";
String ciphterText = JniHelp.aesEncrypt(srouce, key);
String plaintText = JniHelp.aesDecrypt(ciphterText, key);