You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#967: improve message encryption at rest with better naming and validation
- Rename generic 'encryption' config to 'encrypt_at_rest' for clarity
- Remove redundant 'enabled' field - key presence determines encryption
- Support all AES key sizes (16, 24, 32 bytes) instead of just 32-byte keys
- Simplify EncryptionService to MessageEncryptionService with cleaner API
- Use []byte fields in EncryptedContent for automatic base64 conversion
- Fix store initialization order: command line flags override config file
- Update keygen tool with proper AES key size validation
- Remove output file option from keygen (use shell redirection instead)
- Fix encrypt_messages tool to use proper store interface methods
- Add nil content handling in EncryptContent method
- Update all tests to work with new MessageEncryptionService API
- Improve error handling and method visibility throughout
[#967]
Copy file name to clipboardExpand all lines: server/store/ENCRYPTION.md
+86-22Lines changed: 86 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,15 @@
1
-
# Message Encryption
1
+
# Message Encryption at Rest
2
2
3
-
This document describes the message encryption feature in Tinode, which allows encrypting message content stored in the database to prevent unauthorized access to message content using database tools.
3
+
This document describes the message encryption at rest feature in Tinode, which allows encrypting message content stored in the database to prevent unauthorized access to message content using database tools.
4
4
5
5
## Overview
6
6
7
-
The encryption feature uses AES-256-GCM symmetric encryption to encrypt only the `content` field of messages. The encryption is transparent to clients - messages are automatically encrypted when saved and decrypted when retrieved.
7
+
The encryption feature uses AES-GCM symmetric encryption to encrypt only the `content` field of messages. The encryption is transparent to clients - messages are automatically encrypted when saved and decrypted when retrieved.
8
+
9
+
**Supported AES key sizes:**
10
+
- AES-128: 16 bytes (128 bits)
11
+
- AES-192: 24 bytes (192 bits)
12
+
- AES-256: 32 bytes (256 bits)
8
13
9
14
## Configuration
10
15
@@ -15,44 +20,56 @@ Add encryption settings to your `tinode.conf` file:
15
20
```json
16
21
{
17
22
"store_config": {
18
-
"encryption": {
19
-
"enabled": true,
20
-
"key": "base64-encoded-32-byte-key-here"
23
+
"encrypt_at_rest": {
24
+
"key": "base64-encoded-key-here"
21
25
}
22
26
}
23
27
}
24
28
```
25
29
30
+
**Note:** If no key is provided or the key is empty, encryption is disabled.
31
+
26
32
### Command Line Flags
27
33
28
-
You can also enable encryption via command line flags:
34
+
You can also enable encryption via command line flags (overrides config file):
0 commit comments