-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/09/2015 02:54 AM, Dominique Devienne wrote:
> Adding PRAGMAs is not possible to a true SQLite "extension" I
> thought,

It is however possible to add functions.  eg encryption_mode could be
added and called like this:

  select encryption_mode('aes-512', 3);

> My question then for Dr. Hipp is why such DB-encryption cannot not
> be implemented as a true "extension"? And the changes necessary to
> allow it? (like allowing user-defined PRAGMAs for example?).

The biggest problem with encryption (or compression) is that you want
to store extra information per page.  For example encryption will want
per page IV or similar key info.  Compression may result in the data
being larger than the page (eg if it is uncompressible you need need
at least one more bit to indicate that).  Storing the information
separate from the page results in all sorts of data sync issues.

The SQLite file format allows specifying how many bytes are reserved
per page which can then be used for storing this extra information.
However trying to do this as a generic extension is not possible
because APIs aren't exposed that way, and would be awkward if they were.

You can do all this by defining SQLITE_HAS_CODEC and then providing
various functions, but you'll want to compile SQLite and the
encryption code at the same time.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlTZHdEACgkQmOOfHg372QSmWACgibDcuPzVsyfFiFcdPZSNMN6B
CnkAoMQuNGoNqr2uhuNnWOkh/UiuKQ42
=qvhW
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to