Skip to content

Commit

Permalink
updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
juerg committed Dec 12, 2023
1 parent f02203f commit c90bee7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/readme/cryptography.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ on servers that do not provide hardware acceleration. Apple Silicon
does not seem to have AES hardware acceleration probably due to its
RISC nature.

**Salt, IV, Nonce, Counter**

While encrypting a file the random salt, IV, nonce and/or counter are
written to the start of the encrypted file and read before decrypting
the file:

```
AES256-GCM AES256-CBC ChaCha20 ChaCha20-BC
AES/GCM/NoPadding AES/CBC/PKCS5Padding (BouncyCastle)
+--------------------+ +--------------------+ +--------------------+ +--------------------+
| salt (16) | | salt (16) | | salt (16) | | iv (8) |
+--------------------+ +--------------------+ +--------------------+ +--------------------+
| IV (12) | | IV (12) | | nonce (12) | | data (n) |
+--------------------+ +--------------------+ +--------------------+ +--------------------+
| data (n) | | data (n) | | counter (4) |
+--------------------+ +--------------------+ +--------------------+
| data (n) |
+--------------------+
```


### Examples

Expand Down

0 comments on commit c90bee7

Please sign in to comment.