First of all, thanks so much for your help guys.
OK. I have figured out that the command line tool is not encrypting
or decrypting. My original database that I was trying to open and was
created with my app is indeed encrypted. See below.
MyComputers-MacBook-Pro:bin mycomputer$ hexdump -C /Users/mycomputer/
Tracker.sqlite
00000000 97 c4 9f b2 e7 d2 0f 1a eb 55 94 fa 72 03 88 b7
|.........U..r...|
00000010 77 ef f5 10 e6 c9 bb 5c 25 d0 eb 40 ad d3 be e1 |w......\
%..@....|
00000020 2b 61 46 13 5c e5 c9 a0 a3 f3 be 4d dd 4c 9b b3 |+aF.
\......M.L..|
00000030 e7 6f d4 d1 36 9f 8d dc bb 7b b8 a6 56 25 7f b7 |.o..6....
{..V%..|
00000040 1e b6 9c c1 77 bb 90 9e cd 0c 9f 9a bc ed 09 a2
|....w...........|
00000050 b6 29 00 cd 05 e4 0b 4e ff da c0 66 7b 01 f7 cb
|.).....N...f{...|
00000060 d0 d4 b5 a1 7e f1 67 98 7a 08 3e 60 c9 db fe 81
|....~.g.z.>`....|
00000070 c5 e0 e4 6b 88 a8 94 67 ac c9 e2 a5 d8 ea 0b 51
|...k...g.......Q|
00000080 cb 8c 95 99 1e 05 3b 07 16 fc 5d 78 69 d8 56 ca
|......;...]xi.V.|
00000090 2c f5 ee e3 54 32 fd ba 61 2d 7a 5c a9 e8 44 5a |,...T2..a-
z\..DZ|
000000a0 e4 35 4e 2d 57 2d 45 af 4d f1 c1 df 72 62 1d 4a |.5N-W-
E.M...rb.J|
I must not have set up the command line sqlcipher correctly.
Can someone please send me the exact instructions on how to install
and compile it for use by command line? I have tried piecing together
many different instructions from various posts.
What should my directory structure look like for openssl and
sqlcipher? What commands should I execute to compile it?
On May 16, 2:03 pm, Stephen Lombardo <
sjlomba...@zetetic.net> wrote:
> Hello,
>
> If the suggestions by Billy and Steven don't work, also double check to make sure that the database you are opening is *actually encrypted*. Either try running a query on the command line without running PRAGMA key first, or hexdump -C the database file and make sure it's actually encrypted.
>
> If the database is not encrypted by your application (due to a build problem or configuration problem in your app) then executing PRAGMA key on the command line with any value would cause that error.
>
> Cheers,
> Stephen
>
>
>
> On Monday, May 16, 2011 at 1:49 PM, Steven Parkes wrote:
> > I do this routinely, so it's something in your setup.
>
> > Either the host-side binary isn't working (try creating a db with the cli with and without a key and make sure it's encrypted, e.g., can't be opened w/o the key). This would verify Billy's statement. I forget that sqlite3 ignores pragmas it doesn't understand.
>
> > Otherwise, the keys aren't the same. Your key had better be an ascii string to work via the cli, i.e., make sure you're passing it an ascii/UTF8 string on the iOS side (not an NSString).
>
> > And if you're doing that and using sqlite_key, make sure you're passing the number of characters correctly. I presume that means you don't include the null in the length, but I don't use sqlite_key so I couldn't say if it's getting that wrong.