Skip to content

Commit 08a2c0b

Browse files
committed
Merge pull request #19 from developernotes/master
Project Update
2 parents b9080f7 + a6f071f commit 08a2c0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1684
-320
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ TAGS
22
external/libs
33
jni/libs
44
obj/
5+
.DS_Store
6+
local.properties
7+
build.xml
8+
proguard.cfg
9+
bin/
10+
gen/

Makefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
.DEFAULT_GOAL := all
3+
4+
init:
5+
git submodule update --init
6+
android update project -p .
7+
8+
all: build-external build-jni build-java
9+
10+
build-external:
11+
cd external/ && \
12+
make -f Android.mk build-local-hack && \
13+
ndk-build && \
14+
make -f Android.mk copy-libs-hack
15+
16+
build-jni:
17+
cd jni/ && ndk-build
18+
19+
build-java:
20+
ant compile && \
21+
cd bin/classes && \
22+
jar -cvf sqlcipher.jar .

README renamed to README.org

+45-34
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11

22
Current SDK distro for developers, with the jar’s, .so’s and a quick sample can be found here:
3-
https://github.com/guardianproject/android-database-sqlcipher/downloads
3+
[[https://github.com/guardianproject/android-database-sqlcipher/downloads]]
44

55
A full demonstration app with the bundled SQLCipher R1 release is here:
6-
https://github.com/guardianproject/notepadbot
6+
[[https://github.com/guardianproject/notepadbot]]
77

88
SQLCipher for Android project source repo is here:
9-
https://github.com/guardianproject/android-database-sqlcipher
9+
[[https://github.com/guardianproject/android-database-sqlcipher]]
1010

11-
Update May 2011:
11+
*** Update May 2011:
1212

1313
After some major breakthroughs during last week’s development sprint, we’re extremely excited to announce SQLCipher for Android, Developer Preview r1. SQLCipher is an SQLite extension that provides transparent 256-bit AES encryption of database files. To date, it has been open-sourced, sponsored and maintained by Zetetic LLC, and we are glad to be able to extend their efforts to a new mobile platform. In the mobile space, SQLCipher has enjoyed widespread use in Apple’s iOS, as well as Nokia / QT for quite some time. Given that Android by default provides integrated support for SQLite databases, our goal was to create an almost identical API for SQLCipher, so that developers of all skill level could use it, without a steep learning curve.
1414

1515
In an environment where mobile data privacy is increasingly in the headlines, this project will make it easier than ever for mobile developers to properly secure their local application data, and in turn better protect the privacy of their users. The data stored by Android apps protected by this type of encryption will be less vulnerable to access by malicious apps, protected in case of device loss or theft, and highly resistant to mobile data forensics tools that are increasingly used to mass copy a mobile device during routine traffic stops.
1616

1717
However, while the core SQLCipher database is vetted and market-ready, the Android support libraries in this release are still very much alpha quality, hence the Developer Preview label. This R1 release should not be integrated into critical or production software. Our goal is to give Android developers early access to the technology, so they can provide feedback on our approach, and help us deliver the right offering for securing mobile data. We expect to release a market-ready version this summer, and will be publicly iterating through the codebase until then.
1818

19-
An Illustrative Terminal Listing
19+
*** An Illustrative Terminal Listing
2020

2121
A typical SQLite database in unencrypted, and visually parseable even as encoded text. The following example shows the difference between hexdumps of a standard SQLite db and one implementing SQLCipher.
2222

23-
~ sjlombardo$ hexdump -C sqlite.db
24-
00000000 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 |SQLite format 3.|
25-
26-
000003c0 65 74 32 74 32 03 43 52 45 41 54 45 20 54 41 42 |et2t2.CREATE TAB|
27-
000003d0 4c 45 20 74 32 28 61 2c 62 29 24 01 06 17 11 11 |LE t2(a,b)$…..|
28-
29-
000007e0 20 74 68 65 20 73 68 6f 77 15 01 03 01 2f 01 6f | the show…./.o|
30-
000007f0 6e 65 20 66 6f 72 20 74 68 65 20 6d 6f 6e 65 79 |ne for the money|
31-
32-
~ $ sqlite3 sqlcipher.db
33-
sqlite> PRAGMA KEY=’test123′;
34-
sqlite> CREATE TABLE t1(a,b);
35-
sqlite> INSERT INTO t1(a,b) VALUES (‘one for the money’, ‘two for the show’);
36-
sqlite> .quit
37-
38-
~ $ hexdump -C sqlite.db
39-
00000000 84 d1 36 18 eb b5 82 90 c4 70 0d ee 43 cb 61 87 |.?6.?..?p.?C?a.|
40-
00000010 91 42 3c cd 55 24 ab c6 c4 1d c6 67 b4 e3 96 bb |.B?..?|
41-
00000bf0 8e 99 ee 28 23 43 ab a4 97 cd 63 42 8a 8e 7c c6 |..?(#C??.?cB..|?|
42-
43-
~ $ sqlite3 sqlcipher.db
44-
sqlite> SELECT * FROM t1;
45-
Error: file is encrypted or is not a database
23+
: ~ sjlombardo$ hexdump -C sqlite.db
24+
: 00000000 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 |SQLite format 3.|
25+
:
26+
: 000003c0 65 74 32 74 32 03 43 52 45 41 54 45 20 54 41 42 |et2t2.CREATE TAB|
27+
: 000003d0 4c 45 20 74 32 28 61 2c 62 29 24 01 06 17 11 11 |LE t2(a,b)$…..|
28+
:
29+
: 000007e0 20 74 68 65 20 73 68 6f 77 15 01 03 01 2f 01 6f | the show…./.o|
30+
: 000007f0 6e 65 20 66 6f 72 20 74 68 65 20 6d 6f 6e 65 79 |ne for the money|
31+
:
32+
: ~ $ sqlite3 sqlcipher.db
33+
: sqlite> PRAGMA KEY=’test123′;
34+
: sqlite> CREATE TABLE t1(a,b);
35+
: sqlite> INSERT INTO t1(a,b) VALUES (‘one for the money’, ‘two for the show’);
36+
: sqlite> .quit
37+
:
38+
: ~ $ hexdump -C sqlite.db
39+
: 00000000 84 d1 36 18 eb b5 82 90 c4 70 0d ee 43 cb 61 87 |.?6.?..?p.?C?a.|
40+
: 00000010 91 42 3c cd 55 24 ab c6 c4 1d c6 67 b4 e3 96 bb |.B?..?|
41+
: 00000bf0 8e 99 ee 28 23 43 ab a4 97 cd 63 42 8a 8e 7c c6 |..?(#C??.?cB..|?|
42+
:
43+
: ~ $ sqlite3 sqlcipher.db
44+
: sqlite> SELECT * FROM t1;
45+
: Error: file is encrypted or is not a database
4646

4747
(example courtesy of SQLCipher)
4848

49-
Details for Developers
49+
*** Details for Developers
5050

5151
We’ve packaged up a very simple SDK for any Android developer to add SQLCipher into their app with the following three steps:
5252

@@ -57,23 +57,34 @@ SQLiteDatabase.loadLibs(this); //first init the db libraries with the context
5757
SQLiteOpenHelper.getWritableDatabase(“thisismysecret”):
5858
*Note: we are working on some dialog builder helper methods for password and PIN input, password caching, and other features that we would like to standardize across all applications that use SQLCipher.
5959

60-
Compatibility
60+
*** Compatibility
6161

6262
The Developer Preview implements SQLCipher v1, is compatible with Android 2.2 & 2.3, and works only within one process (you can’t pass a Cursor from a remote Service to an Activity).
6363

6464
Notepad + SQLCipher = Notepadbot
6565

6666
Notepadbot is a sample application pulled from the standard Android samples code and updated to use SQLCipher. You can browse the source here and download the apk here.
6767

68+
*** Building
6869

69-
Final Notes
70+
In order to build android-database-sqlcipher from source you will need both the Android SDK as well as Android NDK. Once you have cloned the repo, change directory into the root of the repository and run the following commands:
71+
72+
: # this only needs to be done once
73+
: make init
74+
75+
: # to build the source
76+
: make
77+
78+
Copy =libsqlcipher_android.so= in =external/libs/armeabi= and =libdatabase_sqlcipher.so= in =jni/libs/armeabi= to your application =libs/armeabi= folder. Copy the =sqlcipher.jar= file in =bin/classes= to your =libs= directory. Copy the =icudt44l.zip= file in the =assets= directory to your =assets= directory. Finally, you will need to copy =commons-codec.jar= and =guava-r09.jar= located in the =libs= directory into your application =libs= directory.
79+
80+
*** Final Notes
7081

7182
It’s important to note that this project is not intended to be a distinct, long-term fork of SQLCipher. We’ve been working closely with the SQLCipher team at Zetetic and fully intent to closely maintain the project as SQLCipher evolves, re-integrating changes in upcoming releases such as SQLCipher v2.
7283

7384
The Android support libraries are licensed under Apache 2.0, in line with the Android OS code on which they are based. The SQLCipher code itself is licensed under a BSD-style license from Zetetic LLC. Finally, the original SQLite code itself is in the public domain.
7485

75-
Downloads and Source
86+
*** Downloads and Source
7687

77-
SQLCipher for Android project source repo is here: https://github.com/guardianproject/android-database-sqlcipher
78-
Current SDK distro for developers, with the jar’s, .so’s and a quick sample can be found here: https://github.com/guardianproject/android-database-sqlcipher/downloads
88+
SQLCipher for Android project source repo is here: [[https://github.com/guardianproject/android-database-sqlcipher]]
89+
Current SDK distro for developers, with the jar’s, .so’s and a quick sample can be found here: [[https://github.com/guardianproject/android-database-sqlcipher/downloads]]
7990

0 commit comments

Comments
 (0)