Skip to content

feat: add --password to soul export for AES-256-GCM encryption at rest#294

Open
sshekhar563 wants to merge 2 commits into
qbtrix:devfrom
sshekhar563:feat/export-password
Open

feat: add --password to soul export for AES-256-GCM encryption at rest#294
sshekhar563 wants to merge 2 commits into
qbtrix:devfrom
sshekhar563:feat/export-password

Conversation

@sshekhar563

Copy link
Copy Markdown
Collaborator

Description

This PR implements Phase 2 of the encryption feature by wiring the --password flag through the soul export CLI command. The underlying AES-256-GCM encryption and scrypt key derivation logic was already implemented in the runtime/export/crypto.py layer; this PR surfaces it securely to the user.

Key Changes

  • Secure Interactive Prompts: The --password option is implemented as a prompt-only flag (is_flag=True). This prevents users from passing passwords inline (e.g. --password mysecret), ensuring passwords do not leak into shell history or process listings.
  • Dependency Guard: Added a user-friendly error message if the cryptography package is missing.
  • Manifest Readability: The manifest.json file remains unencrypted so readers can inspect metadata and see the "encrypted": true flag without needing the password.
  • Documentation: Updated docs/cli-reference.md with the new option and an example of its interactive usage.
  • Testing: Added tests/test_cli/test_export_password.py with 9 tests covering archive structure, interactive prompt simulation, mismatched confirmation handling, format warnings, and async encryption/decryption round-trips.

Verification

  • ruff check and ruff format --check pass.
  • 9/9 tests pass in tests/test_cli/test_export_password.py.

- Changed --password to be a prompt-only flag (is_flag=True) so passwords aren't passed inline and leaked to shell history

- Tests now use interactive prompts for export

- Added warning when password is used with non-soul format

- Added missing cryptography dependency check
@sshekhar563 sshekhar563 requested a review from prakashUXtech July 4, 2026 08:02
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.

1 participant