Android存储密钥、反编译恐惧

发布于 2024-08-17 03:35:45 字数 99 浏览 9 评论 0原文

我正在使用令人惊叹的 FPS,并且必须将密钥存储在 java 代码中。但是我担心有人会反编译我的 apk 并找到密钥。我自己反编译了apk,找不到密钥,但我不是VM专家。有什么帮助吗?

I'm using amazing FPS and I have to store the secret key in the java code. However I am afraid that someone would decompile my apk and find the key. I have decompiled the apk myself and could not find the key, but I am not a VM expert. Any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无人问我粥可暖 2024-08-24 03:35:45

您不能将加密密钥放入应用程序中并期望它保持秘密。所需要的只是一位坚定的程序员对其进行反编译并找到密钥,然后他们就可以与全世界分享。

非对称/公钥加密正是您想要的解决方案。创建公钥/私钥对,然后将公钥放入您的应用程序中,并自行保留私钥。然后您可以做两件事:

  • 您的应用程序可以使用公钥加密消息,该消息只能使用私钥解密。
  • 或者,您可以使用私钥签署消息,该消息可以使用应用程序中的公钥进行身份验证。

You can't put your encryption key into your application and expect it to remain a secret. All it takes is for one determined programmer to decompile it and find the key, and they can share it with the world.

Asymmetric/public-key cryptography is exactly the solution you want. Create a public/private key pair, then put the public key in your application and keep the private key yourself. Then you can do two things:

  • Your application can encrypt a message using the public key, that can only be decrypted using the private key.
  • Or, you can sign a message using the private key, that can be authenticated using the public key in your application.
后eg是否自 2024-08-24 03:35:45

一个足够坚定的人将能够提取你的密钥,对此确实无能为力。您可以尝试以某种方式混淆密钥(提高它们需要确定的标准),但您无法阻止他们获取密钥。

但是,根据您需要存储密钥的原因,您也许可以使用 非对称密钥加密。您将能够存储仅限于加密(而非解密)或身份验证目的的公钥,同时能够保证私钥的安全。

A determined enough individual will be able to extract your key, and there really isn't that much that can be done about it. You can attempt to obfuscate the keys somehow (raising the bar on how determined they need to be), but you can't keep them from getting the key.

However, depending on why you need to store the secret key, you might be able to use Asymmetric Key Cryptography. You'll be able to store a public key that may be limited to encryption (not decryption) or authentication purposes, while being able to keep the private key safe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文