0

How to protect Sqlite file during reverse engineering?

IS is possible to encrypt the complete sqlite file in document directory or we have to encrypt the attribute of core data?

  • That depends very much on what you're trying to achieve. Encrypting the file itself is unlikely to help much. – Wain Feb 11 '14 at 10:19
  • Encryption of Attributes is always recommended and much safe than encrypting the whole sqlite file. – Aniket Kote Feb 11 '14 at 10:38

1 Answers1

4

iOS has on disk encryption that will prevent someone from gaining access to the data. However, that will not protect the data from someone opening up their own backup files.

Encrypting the entire SQLite file is problematic. You run into situations where the file needs to be decrypted but that takes time so other things need to wait and the end result is a fairly poor user experience at best and at worst an unstable application.

If your entire database needs to be encrypted (because all of the data is secret) then I would suggest looking into the iOS built-in encryption and then make sure your SQLite file is not included in back-ups.

If you only need to encrypt a small subset of the data then encrypting at the attribute level will make more sense. You will gain more overall performance and only take a performance hit on those attributes that need to be protected.

Marcus S. Zarra
  • 46,571
  • 9
  • 101
  • 182