简体   繁体   English

其他程序可以读取我的NSUserDefaults设置吗?

[英]Can other programs read my NSUserDefaults settings?

On the iPhone, not including jail-broken phones, can other apps read the values you've set using NSUserDefaults ? 在iPhone(不包括越狱的手机)上,其他应用程序可以读取您使用NSUserDefaults设置的值吗? I'm considering saving the customer's userid/password for our service and want to make sure it is secure. 我正在考虑将客户的用户名/密码保存为我们的服务,并希望确保其安全性。

No, other applications cannot see your data. 否,其他应用程序看不到您的数据。 That said, you should probably consider using the keychain on the iPhone to store sensitive data like usernames and passwords. 也就是说,您可能应该考虑使用iPhone上的钥匙串来存储敏感数据,例如用户名和密码。

First of all, you should be saving userid/password in the keychain , not the user defaults. 首先,您应该将用户名/密码保存在钥匙串中 ,而不是用户默认值。

Secondly, yes, other applications can read the NSUserDefaults. 其次,是的,其他应用程序可以读取NSUserDefaults。 The defaults are unix style user defaults not application defaults. 默认值为UNIX样式的用户默认值,而不是应用程序的默认值。 Under the old NextStep OS, an individual users defaults would follow them from networked machine to networked machine. 在旧的NextStep操作系统下,单个用户的默认设置将在网络计算机与网络计算机之间遵循它们。 The idea is that users have preferences for things like default fonts that all applications should use. 这个想法是用户对所有应用程序都应使用的默认字体之类的东西有偏好。

The iPhone inherited that by being a slimmed down version of MacOS X. I am not sure how thorough the sandboxing on iPhone apps is that regard. iPhone是瘦身版的MacOS X继承了这一点。我不确定在这方面iPhone应用程序的沙箱功能有多彻底。 It might be possible to worm a way through the system if you knew the proper keys for domains and values. 如果您知道域和值的正确密钥,则可能会在系统中蠕动。

Certainly, Apple strongly discourages keeping any sensitive information in the user defaults. 当然,苹果强烈建议不要将任何敏感信息保留在用户默认设置中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM