Skip to content

Fix: Issue #14 wallet exports no longer write plaintext#30

Merged
Nanle-code merged 3 commits into
StarsForges:masterfrom
Enniwealth:nano
Jun 28, 2026
Merged

Fix: Issue #14 wallet exports no longer write plaintext#30
Nanle-code merged 3 commits into
StarsForges:masterfrom
Enniwealth:nano

Conversation

@Enniwealth

Copy link
Copy Markdown
Contributor

Summary

Closes #14

Wallet exports no longer write plaintext secret keys to disk. starforge wallet export now always encrypts the full backup JSON into a v2 envelope, even when individual wallets were created without --encrypt.

  • Always-encrypted exports: The wallet JSON payload is encrypted with Argon2 key derivation and AES-256-GCM before being written to the output file.
  • v2 backup envelope: Exported files use a structured JSON envelope with version, backup_id (UUID v4), encrypted_payload, kdf_params, and an HMAC-SHA256 integrity tag over the ciphertext.
  • Strict passphrase by default: Export enforces strong passphrases (zxcvbn "Strong" or better) unless --no-strict is passed.
  • Backward-compatible import: starforge wallet import --file detects v2 envelopes and decrypts them. Legacy v1 plaintext JSON and colon-separated encrypted backups still work but emit deprecation warnings recommending re-export.
  • Network path warning: A warning is printed when the export output path appears to be on a network-mounted filesystem.

v2 backup file format

{
  "version": "2",
  "backup_id": "<uuid-v4>",
  "encrypted_payload": "<base64(nonce || aes-gcm-ciphertext)>",
  "kdf_params": {
    "salt": "<base64>",
    "mem": 19456,
    "iterations": 2,
    "parallelism": 1
  },
  "hmac": "<base64(hmac-sha256)>"
}

@Nanle-code Nanle-code merged commit 6bc42a8 into StarsForges:master Jun 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

starforge wallet export Does Not Encrypt the Backup File

2 participants