Converted readme to valid markdown

This commit is contained in:
Tim Helfensdörfer
2014-08-18 10:13:07 -05:00
committed by Nick Parker
parent 4e3ffe8c11
commit 4ed24011b2
+23 -24
View File
@@ -1,4 +1,4 @@
== SQLCipher ==
## SQLCipher
SQLCipher is an SQLite extension that provides transparent 256-bit AES encryption of
database 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
(sjlombardo@zetetic.net) as the encrypted database layer for Strip,
an iPhone data vault and password manager (http://getstrip.com).
[Features]
## Features
- Fast performance with as little as 5-15% overhead for encryption on many operations
- 100% of data in the database file is encrypted
@@ -20,7 +20,7 @@ an iPhone data vault and password manager (http://getstrip.com).
- Algorithms provided by the peer reviewed OpenSSL crypto library.
- Configurable crypto providers
[Compiling]
## Compiling
Building SQLCipher is almost the same as compiling a regular version of
SQLite with two small exceptions:
@@ -30,57 +30,56 @@ SQLite with two small exceptions:
Example Static linking (replace /opt/local/lib with the path to libcrypto.a)
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
LDFLAGS="/opt/local/lib/libcrypto.a"
$ make
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
LDFLAGS="/opt/local/lib/libcrypto.a"
$ make
Example Dynamic linking
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
LDFLAGS="-lcrypto"
$ make
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
LDFLAGS="-lcrypto"
$ make
[Encrypting a database]
## Encrypting a database
To specify an encryption passphrase for the database via the SQL interface you
use a pragma. The passphrase you enter is passed through PBKDF2 key derivation to
obtain the encryption key for the database
PRAGMA key = 'passphrase';
PRAGMA key = 'passphrase';
Alternately, you can specify an exact byte sequence using a blob literal. If you
use this method it is your responsibility to ensure that the data you provide a
64 character hex string, which will be converted directly to 32 bytes (256 bits) of
key data without key derivation.
PRAGMA key = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
PRAGMA key = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
To encrypt a database programatically you can use the sqlite3_key function.
The data provided in pKey is converted to an encryption key according to the
same rules as PRAGMA key.
int sqlite3_key(sqlite3 *db, const void *pKey, int nKey);
int sqlite3_key(sqlite3 *db, const void *pKey, int nKey);
PRAGMA key or sqlite3_key should be called as the first operation when a database is open.
[Changing a database key]
## Changing a database key
To change the encryption passphrase for an existing database you may use the rekey pragma
after you've supplied the correct database password;
PRAGMA key = 'passphrase'; -- start with the existing database passphrase
PRAGMA rekey = 'new-passphrase'; -- rekey will reencrypt with the new passphrase
PRAGMA key = 'passphrase'; -- start with the existing database passphrase
PRAGMA rekey = 'new-passphrase'; -- rekey will reencrypt with the new passphrase
The hexrekey pragma may be used to rekey to a specific binary value
PRAGMA rekey = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
PRAGMA rekey = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";
This can be accomplished programtically by using sqlite3_rekey;
sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey)
sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey)
[Support]
## Support
The primary avenue for support and discussions is the SQLCipher users mailing list:
@@ -97,7 +96,7 @@ posts about SQLCipher as we do not monitor them frequently.
If you are using SQLCipher in your own software please let us know at
support@zetetic.net!
[License]
## License
Copyright (c) 2008, ZETETIC LLC
All rights reserved.
@@ -128,7 +127,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This directory contains source code to
SQLite: An Embeddable SQL Database Engine
SQLite: An Embeddable SQL Database Engine
To compile the project, first create a directory in which to place
the 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".
For example:
tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
mkdir bld ;# Build will occur in a sibling directory
cd bld ;# Change to the build directory
../sqlite/configure ;# Run the configure script
@@ -164,4 +163,4 @@ AWK.
Contacts:
http://www.sqlite.org/
http://www.sqlite.org/