Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

So you say it is encrypted eh?

Tasdik Rahman edited this page Feb 11, 2016 · 3 revisions

As I said the database is encrypted(in the case of linux systems)

Motivation?

I am taking a random database file called test.db which uses sqlite3 as the database engine. Doing a hexdump over it

tasdik at Acer in ~/Dropbox/dabble/sqlite3 on master
$ hexdump -C test.db | head -n 20
00000000  53 51 4c 69 74 65 20 66  6f 72 6d 61 74 20 33 00  |SQLite format 3.|
00000010  04 00 01 01 00 40 20 20  00 00 00 03 00 00 00 04  |.....@  ........|
00000020  00 00 00 00 00 00 00 00  00 00 00 03 00 00 00 04  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 01 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 03  |................|
00000060  00 2d e6 06 0d 00 00 00  03 02 a8 00 03 83 03 0a  |.-..............|
00000070  02 a8 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000002a0  00 00 00 00 00 00 00 00  60 03 07 17 21 21 01 81  |........`...!!..|
000002b0  0b 74 61 62 6c 65 70 65  72 73 6f 6e 5f 70 65 74  |.tableperson_pet|
000002c0  70 65 72 73 6f 6e 5f 70  65 74 04 43 52 45 41 54  |person_pet.CREAT|
000002d0  45 20 54 41 42 4c 45 20  70 65 72 73 6f 6e 5f 70  |E TABLE person_p|
000002e0  65 74 28 0a 20 70 65 72  73 6f 6e 5f 69 64 20 49  |et(. person_id I|
000002f0  4e 54 45 47 45 52 2c 20  0a 20 70 65 74 5f 69 64  |NTEGER, . pet_id|
00000300  20 49 4e 54 45 47 45 52  0a 29 77 02 07 17 13 13  | INTEGER.)w.....|
00000310  01 81 55 74 61 62 6c 65  70 65 74 70 65 74 03 43  |..Utablepetpet.C|
00000320  52 45 41 54 45 20 54 41  42 4c 45 20 70 65 74 28  |REATE TABLE pet(|
00000330  0a 20 69 64 20 49 4e 54  45 47 45 52 20 50 52 49  |. id INTEGER PRI|

tasdik at Acer in ~/Dropbox/dabble/sqlite3 on master

I can see the whole darn schema table!

With encryption

Now on the other end, let's do the same for the database file tnote uses to store your notes

(tnote)
tasdik at Acer in ~/.tnote
$ hexdump -C diary.db | head -n 20
00000000  ba 49 c2 e4 23 14 b5 9f  89 93 0d 28 fb 09 43 10  |.I..#......(..C.|
00000010  49 58 e3 aa b9 e9 29 30  86 cb 1f 34 61 36 d0 e1  |IX....)0...4a6..|
00000020  75 5d d5 a5 60 a8 79 72  53 60 da 4f 99 09 d1 6a  |u]..`.yrS`.O...j|
00000030  c4 f7 d4 06 a8 61 38 f4  02 94 f9 47 13 c4 47 a9  |.....a8....G..G.|
00000040  02 fe 27 34 d6 04 3f e1  24 23 cc e9 dd 2f 97 af  |..'4..?.$#.../..|
00000050  d4 c4 c9 35 49 66 d7 57  15 98 c8 59 e5 f3 0c c5  |...5If.W...Y....|
00000060  e5 f3 45 f4 35 57 cd eb  58 23 cf 2a 5b 74 ce b0  |..E.5W..X#.*[t..|
00000070  07 56 cf 5c bf 01 62 7e  de 8f 6f 00 a0 b8 db e2  |.V.\..b~..o.....|
00000080  c8 9c 27 e1 33 07 e7 2e  0c 52 cc 6c be 62 fa 23  |..'.3....R.l.b.#|
00000090  d8 6e 1e d8 84 48 b1 74  b7 aa d8 46 f0 c5 01 32  |.n...H.t...F...2|
000000a0  9c c8 14 9f 81 ba d0 32  31 e0 b3 34 e6 fa c3 42  |.......21..4...B|
000000b0  29 e2 31 f2 75 be be 10  6a 59 85 9e 3e 8f 0d 86  |).1.u...jY..>...|
000000c0  f0 a3 02 51 51 bb 93 3f  08 31 0d 2c 56 b8 03 9f  |...QQ..?.1.,V...|
000000d0  52 1f 92 db b3 be 90 f5  eb 7a 7b d0 61 e1 6e 3e  |R........z{.a.n>|
000000e0  ba da 0f c7 84 7f 60 aa  63 f5 eb 6a c2 e5 ef 75  |......`.c..j...u|
000000f0  bf 7e 5a 52 72 d3 b8 19  28 44 d1 c8 e5 72 91 79  |.~ZRr...(D...r.y|
00000100  11 32 3b b0 06 04 18 97  31 71 9e f5 5f 79 58 3b  |.2;.....1q.._yX;|
00000110  bb f4 0f 0a 59 79 bb 3b  e8 2f 15 17 da 15 e3 37  |....Yy.;./.....7|
00000120  4b 64 c1 7b c7 46 cd a6  4f 40 c7 6b 8e 26 6c 01  |Kd.{[email protected].&l.|
00000130  da d5 ea b6 0b bd b6 ef  bd dd 37 a5 11 dd 11 1b  |..........7.....|
(tnote)
tasdik at Acer in ~/.tnote
$

Nothing to interpret instead of garble!

Clone this wiki locally