gpt4 book ai didi

ios - 将 .txt 安全地保存在设备上

转载 作者:行者123 更新时间:2023-11-28 21:39:51 25 4
gpt4 key购买 nike

如何将 .txt 文件安全地保存到 ios 设备中?我不希望用户使用 iExplorer 或类似工具来操纵它。到目前为止,我的代码只是在 ApplicationSupportDirectry 中写入基本数据,它看起来像这样:

///写入文件:

do{
try stringFile.writeToFile(filePath, atomically: false, encoding: NSUTF8StringEncoding)

}catch{}

最佳答案

创建/更新文件时加密,读取文件时解密。 Store the encryption key in the keychain而且你会比明文更安全。 Documentation about symmetric encryption which is available to iOS and OSX .

关于ios - 将 .txt 安全地保存在设备上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32603294/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com