Alright. Thanks. I've gone with the first idea of opening the database and 
checking for the 401 error code.

On Thursday, September 10, 2015 at 10:32:15 PM UTC-6, Jens Alfke wrote:
>
>
> > On Sep 10, 2015, at 5:38 PM, Brendan Duddridge <[email protected] 
> <javascript:>> wrote: 
> > 
> > What's the best way to detect if a database file is encrypted? Is it 
> just a matter of trying to open it up with no key provided? 
>
> Yes. You’ll get a 401 status. (Under the hood, the only way to tell a 
> SQLCipher database is encrypted is to try to open it and get a 
> SQLITE_CORRUPT error when SQLite can’t find the header block. There’s no 
> readable data in an encrypted database file; it looks like pure noise.) 
>
> > You also mentioned somewhere (I've forgotten where now) that there will 
> be a file created called "encrypted" or something to indicate if a database 
> file has been encrypted. 
>
> That’s in the attachments directory, to handle some edge cases with 
> adding/removing encryption. It’s an implementation detail and I’d 
> discourage using it. 
>
> —Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/fcae1c11-274b-46af-a9be-0b53bb7f60e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to