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).
217
+
- 6-part: `salt:nonce:ciphertext:mem:iterations:parallelism` (custom memory, iterations, and parallelism).
218
+
- Versioned 7-part: `v1:salt:nonce:ciphertext:mem:iterations:parallelism` (explicit version prefixing for modern tuned bundles).
219
+
220
+
#### Parameter Bounds & Safety Constraints
221
+
222
+
-**Memory Cost (`mem`)**: Min 8,192 KiB (8 MiB), Max 2,097,152 KiB (2 GiB).
223
+
-**Iterations (`iterations`)**: Min 1, Max 100.
224
+
-**Parallelism (`parallelism`)**: Min 1, Max 64 threads.
225
+
226
+
#### Per-Wallet Metadata & Safe Upgrades
227
+
228
+
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:
229
+
230
+
```bash
231
+
# Tune KDF parameters for a specific wallet
232
+
starforge wallet tune-kdf alice --mem 65536 --iterations 4 --parallelism 2
233
+
234
+
# Upgrade wallet KDF to global configuration settings
235
+
starforge wallet tune-kdf alice --use-global
236
+
```
237
+
238
+
The upgrade procedure enforces zero-data-loss safety:
239
+
1. Validates existing password against current bundle before making any changes.
240
+
2. Validates new KDF parameters against security bounds.
241
+
3. Re-encrypts secret key with new parameters.
242
+
4. Performs a verification decryption round-trip on the new bundle before persisting changes to disk and database.
243
+
5. If any validation or decryption step fails, the original encrypted secret and metadata remain completely unchanged.
0 commit comments