From 3de6f5142745d7254c2c439b150d8c002e43d439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Jul 2021 09:12:57 +0200 Subject: [PATCH] Document that cipher_plaintext_header_size disables the salt --- Documentation/SharingADatabase.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/SharingADatabase.md b/Documentation/SharingADatabase.md index 087dd7ec8..ad51fe7ab 100644 --- a/Documentation/SharingADatabase.md +++ b/Documentation/SharingADatabase.md @@ -175,7 +175,7 @@ do { See https://developer.apple.com/library/archive/technotes/tn2151/_index.html for more information about this exception. -1. If you use SQLCipher, use SQLCipher 4+, and call the `cipher_plaintext_header_size` pragma from your database preparation function: +1. If you use SQLCipher, use SQLCipher 4+, and call the [`cipher_plaintext_header_size` pragma](https://www.zetetic.net/sqlcipher/sqlcipher-api/#cipher_plaintext_header_size) from your database preparation function: ```swift var configuration = Configuration() @@ -186,7 +186,13 @@ See https://developer.apple.com/library/archive/technotes/tn2151/_index.html for let dbPool = try DatabasePool(path: ..., configuration: configuration) ``` - This will avoid https://github.com/sqlcipher/sqlcipher/issues/255. + This will avoid this issue: https://github.com/sqlcipher/sqlcipher/issues/255. + + This will also disable a SQLCipher security feature: the salt. As described by https://www.zetetic.net/sqlcipher/design/: + + > The salt is used for key derivation and it ensures that even if two databases are created using the same password, they will not have the same encryption key. + + Applications are responsible for managing the salt themselves and providing it to SQLCipher. See https://www.zetetic.net/sqlcipher/sqlcipher-api/#cipher_plaintext_header_size for instructions. 2. [**:fire: EXPERIMENTAL**](../README.md#what-are-experimental-features) In each process that wants to write in the database: