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
- 5-part: `salt:nonce:ciphertext:mem:iterations` (custom memory cost and iteration count).
192
+
- 6-part: `salt:nonce:ciphertext:mem:iterations:parallelism` (custom memory, iterations, and parallelism).
193
+
- Versioned 7-part: `v1:salt:nonce:ciphertext:mem:iterations:parallelism` (explicit version prefixing for modern tuned bundles).
194
+
195
+
#### Parameter Bounds & Safety Constraints
196
+
197
+
-**Memory Cost (`mem`)**: Min 8,192 KiB (8 MiB), Max 2,097,152 KiB (2 GiB).
198
+
-**Iterations (`iterations`)**: Min 1, Max 100.
199
+
-**Parallelism (`parallelism`)**: Min 1, Max 64 threads.
200
+
201
+
#### Per-Wallet Metadata & Safe Upgrades
202
+
203
+
KDF parameters are stored per wallet (`WalletEntry.kdf_options` and metadata embedded in `secret_key`). Wallet encryption parameters can be tuned or upgraded safely without data loss using:
204
+
205
+
```bash
206
+
# Tune KDF parameters for a specific wallet
207
+
starforge wallet tune-kdf alice --mem 65536 --iterations 4 --parallelism 2
208
+
209
+
# Upgrade wallet KDF to global configuration settings
210
+
starforge wallet tune-kdf alice --use-global
211
+
```
212
+
213
+
The upgrade procedure enforces zero-data-loss safety:
214
+
1. Validates existing password against current bundle before making any changes.
215
+
2. Validates new KDF parameters against security bounds.
216
+
3. Re-encrypts secret key with new parameters.
217
+
4. Performs a verification decryption round-trip on the new bundle before persisting changes to disk and database.
218
+
5. If any validation or decryption step fails, the original encrypted secret and metadata remain completely unchanged.
0 commit comments