Using openSSL for encryption in Android NDK

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using openSSL for encryption in Android NDK

Nader Baydoun
Hello everyone,
I have started developing with android using java a while ago and I have made a handful of fully functioning apps but this is the first time I find myself in need of using NDK and C++.

I am using this plugin to store some API keys: https://github.com/klaxit/hidden-secrets-gradle-plugin. 

In the documentation, they mention that I can make things more secure by adding my own encryption algorithm, which I would like to do but I never touched C++ nor am I an expert at encryption so I figured if I can fit in the OpenSSL library for CPP, it comes with lots of pre-built cryptography functions I can use that.

I have found this: https://github.com/emileb/OpenSSL-for-Android-Prebuilt
Which is prebuilt code for the library for android.

My first issue is why does CPP need to be built this way? I am used to Java where I can click run and do not understand why you have to dig in and compile the code yourself with flags and all that. Also, pertaining to the library I have found, I do not exactly know what to do with this code...I already have a CMake file and some libraries in my android project because of the plugin installation. 

-Do I just grab the pre-built files and drop them into my CPP resource directory?
-What changes do I have to make to my CMake file to tell the system those files are there?
-I am saving my encrypted key into the environment variables, and the decryption function will make it readable, if the decryption function requires a decryption key, what would be the best way to hide this decryption key?

Thank you all kindly for your time :)

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/b0242178-def6-4591-9102-150565a06f3dn%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Using openSSL for encryption in Android NDK

mic _
Note that Google provides dependencies with prebuilt versions of OpenSSL (see https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html). So you don't have to grab them from some random person's github (not to mention that 1.0.2 is really old).

On Fri, Mar 12, 2021 at 4:45 PM Nader Baydoun <[hidden email]> wrote:
Hello everyone,
I have started developing with android using java a while ago and I have made a handful of fully functioning apps but this is the first time I find myself in need of using NDK and C++.

I am using this plugin to store some API keys: https://github.com/klaxit/hidden-secrets-gradle-plugin

In the documentation, they mention that I can make things more secure by adding my own encryption algorithm, which I would like to do but I never touched C++ nor am I an expert at encryption so I figured if I can fit in the OpenSSL library for CPP, it comes with lots of pre-built cryptography functions I can use that.

Which is prebuilt code for the library for android.

My first issue is why does CPP need to be built this way? I am used to Java where I can click run and do not understand why you have to dig in and compile the code yourself with flags and all that. Also, pertaining to the library I have found, I do not exactly know what to do with this code...I already have a CMake file and some libraries in my android project because of the plugin installation. 

-Do I just grab the pre-built files and drop them into my CPP resource directory?
-What changes do I have to make to my CMake file to tell the system those files are there?
-I am saving my encrypted key into the environment variables, and the decryption function will make it readable, if the decryption function requires a decryption key, what would be the best way to hide this decryption key?

Thank you all kindly for your time :)

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/b0242178-def6-4591-9102-150565a06f3dn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJwpw3ZL7NBF-9QwVR2CMFv_PMEyKqzZbAFiUdagbRviqfBTWw%40mail.gmail.com.