1- == SQLCipher ==
1+ ## SQLCipher
22
33SQLCipher is an SQLite extension that provides transparent 256-bit AES encryption of
44database files. Pages are encrypted before being written to disk and are decrypted
@@ -11,7 +11,7 @@ SQLCipher was initially developed by Stephen Lombardo at Zetetic LLC
1111(
[email protected] ) as the encrypted database layer for Strip,
1212an iPhone data vault and password manager (http://getstrip.com ).
1313
14- [ Features]
14+ ## Features
1515
1616- Fast performance with as little as 5-15% overhead for encryption on many operations
1717- 100% of data in the database file is encrypted
@@ -20,7 +20,7 @@ an iPhone data vault and password manager (http://getstrip.com).
2020- Algorithms provided by the peer reviewed OpenSSL crypto library.
2121- Configurable crypto providers
2222
23- [ Compiling]
23+ ## Compiling
2424
2525Building SQLCipher is almost the same as compiling a regular version of
2626SQLite with two small exceptions:
@@ -30,57 +30,56 @@ SQLite with two small exceptions:
3030
3131Example Static linking (replace /opt/local/lib with the path to libcrypto.a)
3232
33- $ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
34- LDFLAGS="/opt/local/lib/libcrypto.a"
35- $ make
33+ $ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
34+ LDFLAGS="/opt/local/lib/libcrypto.a"
35+ $ make
3636
3737Example Dynamic linking
3838
39- $ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
40- LDFLAGS="-lcrypto"
41- $ make
39+ $ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
40+ LDFLAGS="-lcrypto"
41+ $ make
4242
43- [ Encrypting a database]
43+ ## Encrypting a database
4444
4545To specify an encryption passphrase for the database via the SQL interface you
4646use a pragma. The passphrase you enter is passed through PBKDF2 key derivation to
4747obtain the encryption key for the database
4848
49- PRAGMA key = 'passphrase';
49+ PRAGMA key = 'passphrase';
5050
5151Alternately, you can specify an exact byte sequence using a blob literal. If you
5252use this method it is your responsibility to ensure that the data you provide a
535364 character hex string, which will be converted directly to 32 bytes (256 bits) of
5454key data without key derivation.
5555
56- PRAGMA key = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
56+ PRAGMA key = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
5757
5858To encrypt a database programatically you can use the sqlite3_key function.
5959The data provided in pKey is converted to an encryption key according to the
6060same rules as PRAGMA key.
6161
62-
63- int sqlite3_key(sqlite3 * db, const void * pKey, int nKey);
62+ int sqlite3_key(sqlite3 *db, const void *pKey, int nKey);
6463
6564PRAGMA key or sqlite3_key should be called as the first operation when a database is open.
6665
67- [ Changing a database key]
66+ ## Changing a database key
6867
6968To change the encryption passphrase for an existing database you may use the rekey pragma
7069after you've supplied the correct database password;
7170
72- PRAGMA key = 'passphrase'; -- start with the existing database passphrase
73- PRAGMA rekey = 'new-passphrase'; -- rekey will reencrypt with the new passphrase
71+ PRAGMA key = 'passphrase'; -- start with the existing database passphrase
72+ PRAGMA rekey = 'new-passphrase'; -- rekey will reencrypt with the new passphrase
7473
7574The hexrekey pragma may be used to rekey to a specific binary value
7675
77- PRAGMA rekey = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
76+ PRAGMA rekey = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
7877
7978This can be accomplished programtically by using sqlite3_rekey;
8079
81- sqlite3_rekey(sqlite3 * db, const void * pKey, int nKey)
80+ sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey)
8281
83- [ Support]
82+ ## Support
8483
8584The primary avenue for support and discussions is the SQLCipher users mailing list:
8685
@@ -97,7 +96,7 @@ posts about SQLCipher as we do not monitor them frequently.
9796If you are using SQLCipher in your own software please let us know at
98979998
100- [ License]
99+ ## License
101100
102101Copyright (c) 2008, ZETETIC LLC
103102All rights reserved.
@@ -128,7 +127,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
128127
129128This directory contains source code to
130129
131- SQLite: An Embeddable SQL Database Engine
130+ SQLite: An Embeddable SQL Database Engine
132131
133132To compile the project, first create a directory in which to place
134133the build products. It is recommended, but not required, that the
@@ -138,7 +137,7 @@ script found at the root of the source tree. Then run "make".
138137
139138For example:
140139
141- tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
140+ tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
142141 mkdir bld ;# Build will occur in a sibling directory
143142 cd bld ;# Change to the build directory
144143 ../sqlite/configure ;# Run the configure script
164163
165164Contacts:
166165
167- http://www.sqlite.org/
166+ http://www.sqlite.org/
0 commit comments