在Android应用程序中保护ECC密钥 [英] Protection of an ECC Key in an Android Application

查看:400
本文介绍了在Android应用程序中保护ECC密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用ECC密钥对完成了Android应用程序.当我去年开发它时,我想在Android Keystore中创建ECC密钥.不幸的是,由于 ECDH ,而Android Keystore不支持 ECDH (这就是我在这里所说的: ECDH与Android密钥库中的密钥)

I have done an Android Application using an ECC Key pair. When I have developed it last year, I wanted to create the ECC key in the Android Keystore. Unfortunately, this ECC key is used to generate a session key thanks to ECDH, and ECDH is not supported by Android Keystore (this is what I have been said here: ECDH with key in Android Key Store )

我遵循了建议:我在Android KeyStore中创建了一个AES密钥,并在将其存储在SharedPreferences中之前使用它对ECC密钥进行了加密. Android KeyStore确保无法提取AES密钥,并且只有我的应用程序可以使用它来解密ECC密钥.

I have followed the recommendations: I have created an AES key in the Android KeyStore and I have used it to encrypt the ECC key before storing it in the SharedPreferences. Android KeyStore ensures that the AES key cannot be extracted and that only my application can use it to decrypt the ECC key.

我现在有一个需要您提出建议的问题:

I now have a concern for which I would like your advices:

如果有人在根电话上安装了我的应用程序,获取了APK,对其进行了反编译和修改以在读取并解密该密钥后将其打印出来,该怎么办?我没有这个技能,但我想有些黑客可以. 如果可行,则表示我使用的保护措施无效.

What if someone install my application on a rooted phone, gets the APK, uncompile and modify it to print the ECC key after that has been read and decrypted? I don’t have this skill but I guess that some hackers do. If that’s feasible, it means that the protection that I have used is not efficient.

在我的情况下使用ECDH是不可商议的,那么我必须采用什么解决方案来保护我的ECC密钥对?

Using ECDH is non-negotiable in my case so what solution do I have to secure my ECC key pair?

谢谢

推荐答案

除非有安全的硬件支持,否则无法确保密钥不可提取.

There is no way to ensure that the key is non-extractable unless it's backed by secure hardware.

对于植根的手机壳,攻击者无需修改并重新安装APK即可使用您的密钥.该设备上具有root权限的任何应用程序都可以挂接到您的应用程序,并具有类似的行为.即使在受信任的环境中,他们也可以使用您的硬件支持密钥.他们唯一不能做的就是从设备中提取密钥.

And for the rooted phone case, attacker doesn't need to modify and reinstall your APK in order to use your key. Any app on that device with the root permission can hook into your app and behaves like it. Even in trusted environment they can use your hardware backed key. Only thing they can't do is, extracting the key from the device.

您可能想阅读有关TEE和AndroidKeyStore的相对较旧的文章: http://www.cs.ru.nl/~joeri/papers/spsm14.pdf .尤其是设备绑定结果概述"

You may want to read the relatively old paper about TEE and AndroidKeyStore: http://www.cs.ru.nl/~joeri/papers/spsm14.pdf . Especially "Overview of the results for Device-binding"

为了减少攻击面,您可以:

In order to reduce attack surface, you can:

这篇关于在Android应用程序中保护ECC密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆