参考:https://www.zetetic.net/sqlcipher/ios-tutorial/ 官方说明
https://github.com/sqlcipher/sqlcipher 源码
修改FMDataBase文件
(此种方式需要添加代码,个人感觉不是很好,可以使用下一篇文件,使用静态库的方式)
1、 修改FMDataBase中的文件,设置 setkey
2. 按照官方说明,一步步的配置即可
Adding SQLCipher to Xcode Projects
SQLite is already a popular API for persistent data storage in iOS apps so the upside for development is obvious. As a programmer you work with a stable, well-documented API that happens to have many good wrappers available in Objective-C, such as FMDB and Encrypted Core Data. All security concerns are cleanly decoupled from application code and managed by the underlying framework.
The framework code of the SQLCipher project is open source, so users can be confident that an application isn't using insecure or proprietary security code. In addition, SQLCipher can also be compiled on Android, Linux, OS X and Windows for those developing cross-platform applications.
Using SQLCipher in an iOS app is fairly straightforward. This document describes integrating SQLCipher into an existing iOS project using the Community Edition source code build process. This tutorial assumes some familiarity with basic iOS app development and a working install of Xcode (6.1.1). The same basic steps can be applied to OS X projects as well.