且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

以安全的格式存储游戏首选项和已保存的游戏

更新时间:2022-04-24 22:20:39

如果黑客已经确定并拥有适当的技能,那么无论存储方法如何,您的存储数据通常都会受到损害。它归结为您的应用程序的实际应用程序以及您愿意为保证数据安全所付出的时间和精力。以下是您可以考虑的一些选项:

If a hacker is determined enough and has the proper skill set, your stored data can be usually compromised regardless of storage method. It boils down to what your app's real-world applications are and the time and effort you are willing to put into keeping the data safe. Below are some options for you to consider:

NSUserDefaults

其中一个最常见,最简单的数据存储方式。数据未加密。

One of the most common and simplest ways to store data. Data is not encrypted.

将字符串保存到NSUserDefaults?

Plist文件

这也是存储数据的常用方法。数据未加密。

Also a common way to store data. Data is not encrypted.

从Plist存储和检索

CoreData

创建一个模型,管理不同类型对象之间的关系。默认情况下,数据未加密。

Creates a model, manage relationship between different types of objects. By default, data is not encrypted.

http://www.appcoda.com/introduction-to-core-data/

http://www.raywenderlich.com/85578/first-core-data-app-using-swift

钥匙串

可以说是最安全的数据存储方式在一个非越狱设备上。数据已加密。

Arguably the most secure way to store data on a non-jailbroken device. Data is encrypted.

https://***.com/questions/16459879/how-to-store-a-string-in-keychain-ios

NSCoding

正如Whirlwind指出的那样,这是另一种存储方法。

As Whirlwind pointed out, this is yet another storage method.

http://www.raywenderlich .com / 1914 / nscoding-tutorial-for-ios-how-to-save-your-app-data

http://nshipster.com/nscoding/

CommonCrypto Apple框架

低级C编码。数据已加密。

Low-level C coding. Data is encrypted.

https://developer.apple.com/library/ios/documentation/Security/Conceptual/cryptoservices/GeneralPurposeCrypto/GeneralPurposeCrypto.html

https://developer.apple.com /library/ios/samplecode/CryptoExercise/Listings/ReadMe_txt.html

自定义方法

将数据存储在云端,从而完全消除了设备上的数据。使用触摸ID功能对用户进行身份验证并下载云数据。

Store the data in the cloud thereby eliminate having it on the device altogether. Use the touch ID feature to authenticate the user and download the cloud data.

http://code.tutsplus.com/tutorials/ios-8-integrating-touch-id--cms-21949

https://developer.apple.com/library/ios/samplecode/KeychainTouchID/Introduction/Intro.html