iOS 钥匙串安全

发布于 2024-09-15 15:22:45 字数 165 浏览 11 评论 0 原文

我们希望使用 iPhone 上的证书来对 MS Exchange Sync 进行身份验证。我们不确定如何实施安全概念来保护此证书。

例如,如果没有启用 ScreenLock,是否可以在 iPhone 上获得“完全”钥匙串访问? (或使用越狱的 iPhone)。

有人有这方面的链接吗?

we want to use certificates on the iPhone to authenticate for MS Exchange Sync. We are not sure how the security concept is implemented to protect this certificates.

e.g. is it possible to get "full" Keychain access on the iPhone if no ScreenLock is enabled?
(or with an Jailbroken iPhone).

Does anybody has some links about this?

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

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

发布评论

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

评论(4

爱你是孤单的心事 2024-09-22 15:22:45

Fraunhofer 关于 iOS 钥匙串安全性的研究:

据我所知,iOS 有两个级别的加密钥匙扣用途。第一级使用锁屏密码作为加密密钥。第二级使用由设备生成并存储在设备上的密钥。

弗劳恩霍夫的研究人员已经找到了绕过第二层的方法。这是“更容易”绕过的级别,因为加密密钥存储在设备上。因此,在 iOS4 上,他们的方法仅适用于不使用 kSecAttrAccessibleWhenUnlocked 或 kSecAttrAccessibleWhenUnlockedThisDeviceOnly 的钥匙串条目,因为这些条目驻留在内存中,并且第一级已解密 - 即使手机已锁定。

  • 从 iOS 4 开始,具有 kSecAttrAccessibleWhenUnlocked 和 kSecAttrAccessibleWhenUnlockedThisDeviceOnly 的密钥受到额外加密级别的保护
  • 在 iOS 3.x 及更早版本上,无论使用什么辅助功能属性,所有密钥都可以使用 Fraunhofer 方法解密
  • 根本没有密码的设备仍然容易受到攻击
  • 密码较弱(少于六位数)的设备仍然容易受到攻击

每次密码尝试 50 毫秒; → 每秒 20 次尝试; → 50% 约 1.7 年
更改猜测 6 位字母数字的正确密码
以 36 为基数的代码。4 位数字的标准简单代码将
不到 9 分钟就被暴力破解。基于以下假设
iOS 中错误尝试的计数器可以被绕过,因为它不是
基于硬件

Apple Inc. WWDC 2010,核心操作系统,第 209 场“保护应用程序数据”,幻灯片 24

底线:
如果必须存储敏感数据,最好使用自己的加密。并且不要将密钥存储在设备上。

编辑:
有许多新闻文章引用了弗劳恩霍夫研究并向读者保证不会除非他们的设备被盗,否则不用担心,因为这种攻击只能通过物理访问设备来完成。

我有点怀疑。研究人员通过物理访问手机进行测试的事实似乎只是简化问题的一种方法,而不是一种限制。这是他们对解密钥匙串条目所做的描述:

使用越狱工具后,为了访问命令 shell,我们
运行一个小脚本来访问和解密在
钥匙链。解密是在提供的函数的帮助下完成的
由操作系统本身。

使用过ijilbreak.me 的人都知道,越狱不需要对设备进行物理访问。理论上,修改 Jailbreak.me 代码并让它自动执行以下操作应该很简单:

  1. 正常执行越狱(这一切只需要用户打开恶意制作的 PDF)
  2. 越狱完成后运行 Fraunhofer 的脚本
  3. 发送密码网络到攻击者可以读取它的位置

所以再次要小心你放在钥匙串中的内容。

Fraunhofer's study on iOS keychain security:

From what I can tell, there are two levels of encryption that the iOS keychain uses. The first level uses the lock screen passcode as the encryption key. The second level uses a key generated by and stored on the device.

Fraunhofer's researchers have figured out how to get around the second level. This is the "easier" level to get around, since the encryption key is stored on the device. So on iOS4, their method only works with keychain entries which do NOT use kSecAttrAccessibleWhenUnlocked or kSecAttrAccessibleWhenUnlockedThisDeviceOnly, because those entries reside in memory with the first level decrypted--even when the phone is locked.

  • Starting from iOS 4, keys with kSecAttrAccessibleWhenUnlocked and kSecAttrAccessibleWhenUnlockedThisDeviceOnly are protected by an extra level of encryption
  • On iOS 3.x and earlier, all keys can be decrypted using Fraunhofer's method, regardless of accessibility attribute used
  • Devices with no passcodes at all will still be vulnerable
  • Devices with weak passcodes (less than six digits) will still be somewhat vulnerable

≈50ms per password try; → ≈20 tries per second; → ≈1.7 years for a 50%
change of guessing the correct passcode for a 6-digit alphanumeric
code with base 36. The standard simple code of 4 numeric digits would
be brute-forced in less than 9 minutes. Based on the assumption that
the counter for wrong tries in the iOS can be bypassed, as it is not
hardware-based

Apple Inc. WWDC 2010, Core OS, Session 209 "Securing Application Data", Slide 24

Bottom line:
If you must store sensitive data, better use your own encryption. And don't store the key on the device.

Edit:
There are numerous news articles which cite the Fraunhofer study and reassure their readers not to worry unless their devices are stolen, because this attack can only be done with physical access to the device.

I'm somehow doubtful. The fact the researchers did their tests with physical access to the phone seems to have just been a way to simplify the problem, as opposed to being a limitation. This is their description of what they did to decrypt the keychain entries:

After using a jailbreaking tool, to get access to a command shell, we
run a small script to access and decrypt the passwords found in the
keychain. The decryption is done with the help of functions provided
by the operating system itself.

As anyone who has used jailbreak.me knows, jailbreaking does not require physical access to the device. Theoretically it should be trivial to modify the jailbreak.me code and have it automate the following:

  1. Perform the jailbreak as normal (all this requires is for the user open a maliciously crafted PDF)
  2. Run Fraunhofer's scripts after the jailbreak is complete
  3. Send the passwords over the network to a location the attacker can read it from

So once again, be cautious about what you put in the keychain.

や莫失莫忘 2024-09-22 15:22:45

通常,钥匙串是存储此类证书的推荐方式。然而,人们发现越狱可以用来绕过钥匙串的安全性(文章)。

Normally, the keychain would be the recommended way to store such a certificate. However, it has been discovered that jailbreaking can be used to bypass the security of the keychain (article).

回忆凄美了谁 2024-09-22 15:22:45

Franhofer 对 iPhone 钥匙串的安全性进行了研究:

http://www .sit.fraunhofer.de/Images/sc_iPhone%20Passwords_tcm501-80443.pdf

Franhofer did a study on the safety of the iPhone Keychain :

http://www.sit.fraunhofer.de/Images/sc_iPhone%20Passwords_tcm501-80443.pdf

活雷疯 2024-09-22 15:22:45

我可以回答你的部分问题,但由于另一部分仍然未知,我对这个问题进行投票,因为我也渴望知道答案。

我可以回答的部分是:“如果没有启用屏幕锁,应用程序可以获得完整的钥匙串访问权限”。不,每个应用程序在 iPhone 上都有自己的钥匙串区域,这意味着应用程序只能访问自己的秘密。这些秘密并未针对应用程序本身锁定,因此无法对应用程序本身隐藏钥匙串条目。总结一下:应用程序可以读取自己的条目,而不能读取其他条目。

但我有兴趣知道越狱设备上会发生什么。设备越狱后,所有应用程序的钥匙串是否都会暴露?

I can answer part of your question, but since the other part is still unknown, I'm voting the question up as I'm also eager to know the answer.

The part that I can answer is: 'can an app get full keychain access if no screenlock is enabled'. No, every app has its own keychain area on the iphone, which means an app can only get access to its own secrets. These secrets are not locked for the app itself, so there's no way to hide the keychain entries from the app itself. So to summarize: an app can read its own entries, and no other entries.

What I'm interested to know though is what happens on jailbroken devices. Are the keychains of all apps exposed once a device has a jailbreak?

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