2

I have a project to use OpenSSL in Android application. I am just a bit confused about this lib. I read that OpenSSL already exists on Android... Is this true ? If so, how do I use it...

If it does not, does this mean that I have to build or get the lib from somewhere... If I need to do that, does anyone know where I can find it, and how I would go about building for use with Android?

Can someone help me to understand what I need to get started... Please don't be afraid to give lot of details. :)

Thanks in advance !

UPDATE: What I want to do is:

  • Create the keypair
  • Get private key
  • Get public key
  • Encrypt a text
  • Decrypt the text (from another location)

I am using Mac OSX with Eclipse.

2
  • If you can tell us a little bit more about exactly what you are trying to accomplish it is more likely that you will get more detailed examples of how to do it. Commented May 20, 2011 at 13:36
  • Im using Mac OSX with Eclipse. Commented May 20, 2011 at 13:43

1 Answer 1

1

I read that OpenSSL already exists on Android... Is this true ? If so, how do I use it...

Yes, but its a down level version. I believe its OpenSSL 0.9.8, but I could be wrong. You should try to avoid it if possible. For example, you don't get a library capable of TLS 1.2 because that was introduced in OpenSSL 1.0.1.

OpenSSL is loaded into every Android process. Its a byproduct of the fork from Zygote. So you always have the down level version of OpenSSL whether you want it or not.

You access OpenSSL via JNI. There's lots of Stack Overflow questions and answers covering it.

To use a newer OpenSSL, you have to write a wrapper shared object and link to the static library version of OpenSSL. You then reach the newer version of OpenSSL through JNI via your wrapper.

What I want to do is:

  • Create the keypair
  • Get private key
  • Get public key
  • Encrypt a text
  • Decrypt the text

When you are ready, you should probably ask separate questions if you encounter trouble.


For cross-compiling instructions, see Android on the OpenSSL wiki.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.