如何在客户端二进制文件中保留敏感信息?
我期待开发一个 Android / iPhone 应用程序,这些应用程序将使用带有嵌入式客户端密钥的私有 API(非免费)。
现在,因为可以对应用程序二进制文件进行逆向工程并删除字符串。我担心会丢失客户端密钥,并将私有 API 暴露给攻击者。
如何管理这个?您能否提供讨论此类情况的文章链接?
考虑到我可以开发私有 API,我可以在其中内置什么机制来保护整个系统的隐私。
I look forward to develop an Android / iPhone application, those will be using a private API (Non-Free) with embedded client-key.
Now, since it is possible to reverse-engineer application binaries and scrap out strings. I am worried of losing my client-key and there by exposing the private API to the attacker.
How to manage this ? Can you provide links to articles discussing such situations ?
Considering I have development access to the private API, what mechanism can I built in to that to preserve the privacy of the whole system.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有权访问应用程序代码,则始终可以使用私有 API(请参阅 这个线程也是如此)。不过,你可以让它变得更难。您可以通过以下选项限制 API 的使用
1) 如果它不是“您的”API,请勿将密钥放入应用程序中,而是放入您正在运行的服务器中,以充当外部服务的代理(您可能仍然需要另一个密钥让您的服务器进入应用程序,然后)
2)加密/扰乱密钥,使其不易被获取:
3)如果这是您的服务或者您设置了代理,请限制每个客户端/IP 的使用次数或通过代理仅提供部分服务
注意, 选项如果您有禁止公开密钥的合同,甚至可能需要 1。
It will always be possible to use the private API if you have access to your applications code (see this thread as well). You can make it harder, though. And you can restrict the use of the API with the following options
1) if it's not "your" API, don't put the key into the app but into a server you are running to serve as proxy for the foreign service (you probably still want another key for your server to go into the app then)
2) encrypt/scramble the key so it is not grabbed easily:
3) if it's your service or you have a proxy set up, restrict the number of uses per client/IP or offer only parts of the service over your proxy
Note, option 1 may even be required if you have a contract which forbids to make your key public.