On 8/22/05, Edwin Knoppert <[EMAIL PROTECTED]> wrote: > Hmm, but every known file format has an header. > Sqlite has a string, not really a header as it seems. > Maybe for v4 to implement a real header (if not yet) > A header doesn't need to be encrypted. > (A bit for testing if it's encrypted might have it use as well)
In fact, I was wondering about this very issue when I was working on my own encryption layer for Mozilla's storage use. Does the reliable format of the first page (known sqlite header string, various other fields that are very likely to be zero or in some way related to the size of the DB file) not make known-plaintext attacks on the encrypted database much easier? Given that the encryption is limited to a page at a time due to the pager implementation (and placement of the hooks in sqlite), it would seem that that would be fairly worrisome. I can mitigate it a bit by having the page number affect the key selection, but I'm still sort of nervous about it. Mike