简体   繁体   English

如何在Android中安全存储EC私钥?

[英]How can I securely store EC private key in Android?

I have a fixed EC private key to sign some message when my app is running. 我有固定的EC私钥,可在我的应用程序运行时对某些消息进行签名。 I can't hard code the private key in my code as there are some potential safety issues. 由于存在一些潜在的安全问题,因此我无法对代码中的私钥进行硬编码。 So how can I safely store and use the private key in Android? 那么,如何在Android中安全地存储和使用私钥?

Well, there is actually no way to hide these credentials. 好吧,实际上没有办法隐藏这些凭据。 One common workaround I used to use is to generate the key by code in native layer (C-extension) then compile into .so to call from the app through Java JNI wrapper. 我过去使用的一种常见解决方法是通过本机层中的代码(C扩展名)生成密钥,然后编译为.so以通过Java JNI包装程序从应用程序中调用。 This seems to hide the actual code in another layer, but I'm sure there will definitely some ways to break this. 这似乎将实际代码隐藏在另一层中,但是我敢肯定,肯定会有一些方法可以打破这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM