mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
vericrypt: Update to support DEK. (#10005)
* vericrypt: Update to support DEK. Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> * vericrypt: Clear account data on restart. Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> * Update apps/vericrypt/src/components/decrypted-result.tsx Co-authored-by: Abdullah Atta <thecodrr@protonmail.com> Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> * docs: Update data encryption documentation to be accurate with the current client versions. Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> * docs: Explain what happens better. Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> * Fix typo in encryption key generation section Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> * Update docs/help/contents/how-is-my-data-encrypted.md Co-authored-by: Abdullah Atta <thecodrr@protonmail.com> Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> * docs: update wording Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> --------- Signed-off-by: Chloe Oletto <NeedsChloesure@riseup.net> Co-authored-by: Abdullah Atta <thecodrr@protonmail.com>
This commit is contained in:
@@ -41,13 +41,7 @@ This process is repeated every time you sign in.
|
||||
|
||||
### 2. Key generation
|
||||
|
||||
After you are signed in, the app requests your user data which includes, among other things, your salt.
|
||||
|
||||
> info Salt generation
|
||||
>
|
||||
> When you create an account, the server generates a cryptographically secure random salt for you. This salt is used for key generation.
|
||||
|
||||
You password & salt is then used to derive a strong irreversible key using Argon2 as the password key derivation function (PKDF).
|
||||
When you first sign up for an account, your client generates two encryption keys. One is a unique data encryption key that encrypts all your notes and other data. The second is your master encryption key, this is derived by your password and predictable salt. This key protects all your encryption keys, like the aforementioned data encryption key. If you change your password, your client will re-encrypt your existing data encryption key with your new master key.
|
||||
|
||||
### 3. Encryption key storage
|
||||
|
||||
@@ -55,7 +49,7 @@ You password & salt is then used to derive a strong irreversible key using Argon
|
||||
|
||||
Instead of storing the key as plain text (and allowing anyone to copy/move it), we use browser's `IndexedDB` to store the key as a `CryptoKey`.
|
||||
|
||||
`CryptoKey` is stored securely by the browser and cannot be exported, viewed, copied except by the app & browser.
|
||||
`CryptoKey` is stored securely by the browser and cannot be exported, viewed, or copied except by the app & browser.
|
||||
|
||||
# [Mobile](#/tab/mobile)
|
||||
|
||||
@@ -70,7 +64,7 @@ Encryption only takes place when you sync. Each item in the database is encrypte
|
||||
#### How it works
|
||||
|
||||
1. The item is read from the database as JSON object and stringified (i.e. converted to a string).
|
||||
2. The string is encrypted using the encryption key generated earlier.
|
||||
2. The string is encrypted using the data encryption key generated earlier.
|
||||
3. The result is a JSON object which contains:
|
||||
1. A base64 encoded `cipher`
|
||||
2. A 192-bit nonce (`iv`)
|
||||
@@ -83,3 +77,9 @@ Encryption only takes place when you sync. Each item in the database is encrypte
|
||||
> See the whole process in action [here.](https://vericrypt.notesnook.com/)
|
||||
|
||||
This object is then sent to the server for storage. The server performs no further operation on this data (because it can't).
|
||||
|
||||
## Faqs
|
||||
|
||||
### I am an old user of Notesnook, I don't have a data encryption key.
|
||||
|
||||
Your data encryption key will be created when you change your password.
|
||||
|
||||
Reference in New Issue
Block a user