在 iPhone 操作系统中加密 SQLite 数据库文件 [英] Encrypting SQLite Database file in iPhone OS

查看:31
本文介绍了在 iPhone 操作系统中加密 SQLite 数据库文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iPhone 上的任何 SQLite 数据库都只是一个与应用程序捆绑在一起的文件.任何人提取这个文件并查询它都相对简单.

Any SQLite database on the iPhone is simply a file bundled with the application. It is relatively simple for anyone to extract this file and query it.

您对加密文件或存储在数据库中的数据有什么建议.

What are your suggestions for encrypting either the file or the data stored within the database.

该应用程序是一款与其他用户对战的游戏.有关用户相对优势和劣势的信息将存储在数据库中.我不希望用户能够越狱手机以提高他们的声誉/权力等,然后赢得锦标赛/联赛等(注意:由于这个想法是保密的,所以尽量含糊不清).

The App is a game that will be played against other users. Information about a users relative strengths and weaknesses will be stored in the DB. I don't want a user to be able to jail-break the phone up their reputation/power etc then win the tournament/league etc (NB: Trying to be vague as the idea is under NDA).

我不需要军事加密,我只是不想以纯文本形式存储东西.

I don't need military encryption, I just don't want to store things in plain text.

编辑 2: 再澄清一点,我的主要目标是

Edit 2: A little more clarification, my main goals are

  1. 让破解敏感数据变得非常重要
  2. 有一个简单的方法来发现数据是否已被更改(某种校验和)

推荐答案

您不能信任客户,句号.如果您的独立应用程序可以解密它,那么它们也可以.要么将数据放在服务器上,要么不要打扰,因为真正破解它以增强统计数据的人数将微不足道,无论如何,他们的努力应该会得到回报!

You cannot trust the client, period. If your standalone app can decrypt it, so will they. Either put the data on a server or don't bother, as the number of people who actually crack it to enhance stats will be minuscule, and they should probably be rewarded for the effort anyway!

在数据库中输入一个字符串请不要作弊".

Put a string in the database saying "please don't cheat".

这篇关于在 iPhone 操作系统中加密 SQLite 数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆