This really depends on what you are trying to protect. Passwords are the
common data pieces that would be protected in this manner.

The easiest way to encrypt a specific row is to put the data through some
sort of one way hash function before you write the data to the table.
However since this is symmetric, anyone with the key can decrypt the data
easily. Also, depending on the strength of the hash function, anyone with
the hashed data could decrypt the data using a brute force attack. I believe
that Java and C both have basic hash functions. In terms of performance,
hashing is probably the most economical and widely accepted method. Use the
largest key strength possible without hindering performance. This will take
some trial and effort.

I would be remiss if I didn't mention that this is in no way a bullet proof
method of protecting data in a database. You have to first analyze the data
you are protecting, and determine the cost to you if someone were to
intercept the data. If the data is transmitted over the network in clear
text for example, anyone with a sniffer and a laptop can intercept and
change the data without you knowing about it. In that case, your hash
function has little or no effect. In the case of passwords, this is a most
dangerous method for password storage. You also have to consider the
security of the database itself. How is it accessed? Where is it stored? If
the data is widely accessible, then this is akin to closing the barn door
after the horse got out.


Timothy A. Sawyer, CISSP
Managing Director
MBD Solutions




-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kavita Raghunathan
Sent: Tuesday, May 04, 2010 12:19 PM
To: Discussion of SQLite Database
Subject: [sqlite] Encryption of sqlite DB

Hi,
What's the simplest way to encrypt only certain rows in an sqlite DB? If
there is no way to do this (for storing passwords etc), I would like to know
the best way to encrypt the whole sqlite DB. (Prefer only encrypting some
rows, but if this introduces complexity, I'm willing to encrypt the whole
database)
kavita
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to