5

Is the OpenSSL included in Android? If so, how can I call OpenSSL functions such as AES encryption?

Ry-
  • 218,210
  • 55
  • 464
  • 476
user2642459
  • 507
  • 3
  • 10
  • 18
  • 2
    My question is whether the android include the OpenSSL code basically, not to support crypto package. I read how to build OpenSSL for android many times. I heard from someone that we can call a OpenSSL function without building, but I can't find the comment about it. I'm wondering it's true or not. – user2642459 Aug 06 '13 at 05:04
  • Do you actually need OpenSSL, or do you just want to do AES encryption? If you just need AES, Android has better options than OpenSSL. – divegeek Feb 03 '19 at 11:10

4 Answers4

4

Here are some of the Helpful Links : How to use Open SSL in Android. For AES encryption take a look at javax.crypto package which android supports. javax.crypto supports AES algorithm as well. Here is the link for that javax.crypto in Android. Make sure you do some research before asking question. At least try to present what you have tried and be specific about your problem.

Community
  • 1
  • 1
Peshal
  • 1,508
  • 1
  • 12
  • 22
2

The answer to your question "Is the OpenSSL included in Android?" is "No". OpenSSL is apparently not included by default in Android.

Lelanthran
  • 1,510
  • 12
  • 18
1

Also, you can easily compile the latest openSSL yourself if you're interested to go in this direction. You can follow my build instructions here

Community
  • 1
  • 1
mchiasson
  • 2,452
  • 25
  • 27
1

You can find that by using below code:

 StringBuilder builder = new StringBuilder();
for (Provider provider : Security.getProviders()) {
    builder.append("provider: ")
              .append(provider.getName())
            .append(" ")
            .append(provider.getVersion())
            .append("(")
            .append(provider.getInfo())
            .append(")\n");
}
String providers = builder.toString();
//now display the string on the screen or in the logs for debugging.

which will give you result like:

provider: GmsCore_OpenSSL1.0 (Android's OpenSSL-backed security provider)
provider: AndroidOpenSSL1.0 (Android's OpenSSL-backed security provider)
provider: DRLCertFactory1.0 (ASN.1, DER, PkiPath, PKCS7)
provider: BC1.49 (BouncyCastle Security Provider v1.49)
provider: Crypto1.0 (HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature))
provider: HarmonyJSSE1.0 (Harmony JSSE Provider)
provider: AndroidKeyStore1.0 (Android AndroidKeyStore security provider)

Also if want to implement you can compile your own openssl libarary(latest) and you have to write your own ndk code(in c/c++) with static import of this compiled openssl library .

Rahul_Pawar
  • 572
  • 1
  • 8
  • 16