user2642459
user2642459

Reputation: 507

OpenSSL in Android

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

Upvotes: 5

Views: 24672

Answers (4)

Rahul_Pawar
Rahul_Pawar

Reputation: 592

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 .

Upvotes: 1

Lelanthran
Lelanthran

Reputation: 1529

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

Upvotes: 2

mchiasson
mchiasson

Reputation: 2602

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

Upvotes: 1

Peshal
Peshal

Reputation: 1518

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.

Upvotes: 4

Related Questions