Using openSSL for encryption in Android NDK

瀏覽次數:1,750 次
跳到第一則未讀訊息

Nader Baydoun

未讀,
2021年3月12日 上午10:45:492021/3/12
收件者:android-ndk
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 :)

mic _

未讀,
2021年3月12日 上午10:59:022021/3/12
收件者:andro...@googlegroups.com
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).

--
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 android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/b0242178-def6-4591-9102-150565a06f3dn%40googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息