iOS 5:如何加密捆绑包中的属性列表?
我将专有信息(公式等)存储在应用程序附带的属性列表中。 属性列表将由 Xcode 中的属性列表编辑器创建和编辑。
如何在 iOS 5 中对该属性列表进行加密以避免用户读取属性列表公式?我正在寻找一种非常透明且易于实施的解决方案。
I have proprietary information (formulas etc) stored in a property list which is shipped with the app.
The property list will be created and edited by the property list editor in Xcode.
How can this property list be encrypted in iOS 5 to avoid reading the property list formulas by the user? I am looking for a solution that is very transparent and easy to implement.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,这是“如何防止我的应用程序被逆向工程”问题的一种非常具体的形式。答案是你不知道。您可以实施一些基本的操作来尝试向攻击者隐藏信息。但是,没有办法将您的代码提供给完全控制其运行硬件的攻击者,并且仍然可以防止其被逆向工程。有关此问题的一般讨论,请参阅混淆 Cocoa。 iPhone 应用程序到网页的安全 https 加密中列出了此问题的更多版本。
因此,真正的问题是如何向偶然的攻击者隐藏您的信息,并意识到专门的攻击者会挫败您的计划。当你以这种方式提出问题时,你会意识到答案的一部分是“尽可能简单,因为如果不会取得很大成功,那么花费大量精力去做这件事是愚蠢的。”
因此,使用长的、随机的共享秘密来打乱文件。将共享的秘密写入您的代码中,然后继续生活。如果你想要一个好的工具,我推荐 CommonCrypto 因为它是内置的。请记住,这只是混淆。只要密钥在软件中,你就不能认为它是“加密”。
如果您的秘密足够有价值,以至于您拥有大量持续的技术和法律资源来保护它们,那么请给我发送更多详细信息,我们可以讨论如何在您的组织内创建反盗版和商业秘密保护团队(我有有这样做的经验,并很乐意提供咨询专业知识)。但请记住,苹果从上到下控制着 iPhone,并花费了大量资金来保护它。还是越狱了。除非您打算以类似的规模应用资源,否则您不应期望获得更好的结果。在几乎所有情况下,您最好将资源用于改进产品,而不是保护已发货的产品。
First, this is a very specific form of the question "how do I prevent my application from being reverse engineered." The answer is you don't. You can implement some basic things to try to hide the information from an attacker. But there is no way to give your code to an attacker who has complete control of the hardware it runs on and still prevent it from being reverse engineered. For general discussion about this, see Obfuscating Cocoa. More versions of this question are listed in Secure https encryption for iPhone app to webpage.
So the real question is how to hide your information from the casual attacker, realizing that the dedicated attacker will defeat your scheme. When you ask the question that way, you realize that part of the answer is "as easily as possible because it would be silly to spend a lot of effort doing it if it's not going to be highly successful."
So shuffle the file with a long, random shared secret. Stick the shared secret in your code, and press on with life. If you want a good tool, I recommend CommonCrypto since it's built-in. Just remember that this is just obfuscation. As long as the key is in the software, you can't consider it "encryption."
If your secrets are valuable enough that you you have significant ongoing technical and legal resources to protect them, then mail me some more details and we can talk about how you create an anti-piracy and trade-secret protection team within your organization (I have experience doing that and would be happy to provide consultation expertise). But remember, Apple controls the iPhone top to bottom and has spent serious money to secure it. It's still jailbroken. Unless you are going to apply resources on a similar scale, you shouldn't expect a better result. In almost all cases, you are better off spending your resources making your product better than in protecting what you've shipped.
示例位于 iOS 开发人员库中。
https://developer.apple.com/library/ios/#documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html#//apple_ref/doc/uid/TP40001358-CH208
Examples are in the iOS Developer Library.
https://developer.apple.com/library/ios/#documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html#//apple_ref/doc/uid/TP40001358-CH208