开发者

iPhone = How to check iPhone Sqlite database is modified externally

I am making an iPhone application, in that my all the content is stored in the sqlite database.

Now there is always threat of Jailbreaking and other Spam activity. So Came to know that Mac/windows can access the application directory directly using some softwares.

So I want to keep my database secure as well as If a开发者_C百科ny one shall modify / replace the database then when I start my application I should be get notified using codes that Some changes are made with the database.

With iPhone how this things will be performed can any one suggest ? any tutorial or code ?

I am going to store data in encrypted formate with some Encryption algorithm but how to protect SQLITE database from modification that I want to know.

thanks in advance.


You really can't know.

If you want to make a best-effort, you could do something like compute an sha512 or sha256 checksum of the database, and store that in another file, but it'd require reading the entire database at every application startup and shutdown, which would probably not please the user. That takes time, more time than just letting SQLite3 do its magic on reads and writes.

And someone malicious could modify the stored checksum, too. (It'd be easy enough to figure out how you're doing it, if they have access to your program's object code, so there's no real point in trying to obfuscate a hypothetical hash checking routine.)

Anyway, it's their data, right? :) so if they want to fiddle around behind the scenes, let them have at it. You need to make sure that any inputs you accept on your servers are treated with the same distrust you would use when accepting input from a web browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜