fahad_sust
fahad_sust

Reputation: 546

AES-256 CBC Encryption/Decryption string using OpenSSL in Android

I am trying to write an application which is simply encrypt a string and decrypt it using OpenSSL native library through JNI interface. I build libcrypto.so and libssl.so. But i could not make the jni interface for this. Please someone help me to find out specific methods for accomplish this. I am very weak in C and C++.

Upvotes: 0

Views: 4437

Answers (1)

AOSP_junkie
AOSP_junkie

Reputation: 71

Android stopped using OpenSSL with Lollipop and now uses a library called BoringSSL. Sure you can build it and make a jni, but there are easier ways to do what you want to do.

There are Android APIs for doing exactly what you want to do.

http://developer.android.com/reference/javax/crypto/Cipher.html

https://trivedihardik.wordpress.com/tag/android-aes-example/

http://iamvijayakumar.blogspot.de/2013/10/android-example-for-encrypt-and-decrypt.html

Upvotes: 3

Related Questions