Releases: migchat/cli
Release list
v0.3.1 - Critical Ephemeral Key Bug Fix
Critical Bug Fix
This release fixes the root cause of MAC verification failures that occurred even with brand new accounts.
What Was Fixed
The ephemeral_key field in encrypted messages was incorrectly set to the sender's identity key instead of the actual ephemeral key generated during session establishment. This caused the sender and receiver to compute different shared secrets, resulting in MAC verification failures.
Changes
- Added
our_ephemeral_keyfield to Session struct to store the real ephemeral key - Updated
establish_session()to store the ephemeral key during session creation - Updated
encrypt_message()to include the real ephemeral key from the session - Both sender and receiver now use the same ephemeral key in DH operations, computing identical shared secrets
Impact
- β Fixes MAC verification failures for ALL accounts (new and existing)
- β Ensures proper X3DH key agreement protocol implementation
- β Both sender and receiver can now successfully decrypt messages
Installation
Download the appropriate binary for your platform below, make it executable, and run it.
π€ Generated with Claude Code
v0.3.0 - Fix Encryption Bugs & Add Message Caching
π Major Encryption Fixes
This release fixes critical encryption bugs that were causing "MAC verification failed" errors and preventing users from viewing their conversation history.
β¨ What's New
Message Cache System
- Implemented encrypted message cache for persistent conversation history
- Messages are cached with password protection using ChaCha20-Poly1305
- View your entire conversation history without decryption issues
Bug Fixes
- Fixed Session Establishment: Corrected X3DH key agreement to use signed prekey properly
- Fixed Ratchet Synchronization: Messages can now be viewed multiple times
- Sent Messages Visible: Your own sent messages now appear in conversations
- Removed Unused Code: Cleaned up wasteful ephemeral key generation
New Features
- Cache management UI in security menu
- View Cache Status (message count and size)
- Clear Message Cache option
- Automatic session establishment from incoming messages
- Better error messages for encryption failures
π Upgrade Notes
This release is backward compatible with existing sessions and messages. The message cache will be built gradually as you view conversations.
π Related
- Must be deployed with server v0.1.1 for full fix
- See PR #11 for technical details
π Bugs Fixed
- MAC verification failures when viewing conversations multiple times
- Unable to see sent messages in conversation history
- Session establishment computing different shared secrets
- Ratchet state breaking on repeated message views
Release v0.2.3
MigChat CLI v0.2.3
Major Encryption Fixes
π Fixed Receiver-Side Session Establishment
- Implemented proper X3DH protocol for receivers to establish sessions from incoming messages
- Receivers now automatically derive matching session keys from sender's ephemeral key
- This fixes the "MAC verification failed" error when receiving encrypted messages
π¨ Fixed Sent Message Display
- Sent messages are now displayed as
[Your encrypted message]instead of attempting decryption - This is correct E2E encryption behavior - you cannot decrypt your own sent messages after the ratchet advances
- Received messages from others decrypt properly using the receiver-side session
πͺ Fixed Windows PowerShell Installer (from v0.2.2)
- Simplified color output for better compatibility
- Better error reporting
How It Works Now
-
Sending a message:
- You establish a session with recipient's key bundle
- Message is encrypted and ratchet advances
- Encrypted message is sent to server
-
Receiving a message:
- If no session exists, receiver automatically establishes one from the encrypted message
- Both parties now have matching session keys
- Message decrypts successfully
-
Viewing conversations:
- Your sent messages show as
[Your encrypted message] - Received messages decrypt and show plaintext
- Your sent messages show as
Installation
Quick Install (Linux/macOS):
```bash
curl -fsSL https://raw.githubusercontent.com/migchat/cli/main/install.sh | bash
```
Quick Install (Windows):
```powershell
irm https://raw.githubusercontent.com/migchat/cli/main/install.ps1 | iex
```
Supported Platforms
- Linux x86_64, aarch64/ARM64
- macOS x86_64 (Intel), aarch64 (Apple Silicon)
- Windows x86_64, aarch64/ARM64
Testing
To test encryption between two accounts:
- Create two accounts
- Send a message from Account A to Account B
- View the conversation on Account B - message should decrypt
- View the conversation on Account A - sent message shows as
[Your encrypted message]
Release v0.2.2
MigChat CLI v0.2.2
Critical Bug Fixes
π Fixed MAC Verification Failure (Issue with all encrypted messages)
- Fixed critical bug where encryption used a random nonce but decryption used a zero nonce
- This caused "MAC verification failed" errors even with newly created accounts
- Now properly prepends nonce (12 bytes) to ciphertext and extracts it during decryption
- MAC computation now includes nonce+ciphertext consistently on both sides
- All users should upgrade immediately - this fixes message decryption for all encrypted conversations
πͺ Fixed Windows PowerShell Installer
- Simplified color output functions for better compatibility when piped through `iex`
- Replaced box-drawing characters with ASCII for better terminal compatibility
- Added detailed error output with stack traces for debugging
- Added `-UseBasicParsing` to API calls for better compatibility
- Installer should now work reliably in all PowerShell environments
Installation
Quick Install (Linux/macOS):
```bash
curl -fsSL https://raw.githubusercontent.com/migchat/cli/main/install.sh | bash
```
Quick Install (Windows):
```powershell
irm https://raw.githubusercontent.com/migchat/cli/main/install.ps1 | iex
```
Manual Installation:
- Download the binary for your platform below
- Rename it to `migchat` or `migchat.exe` (remove platform suffix)
- (Unix only) Make it executable: `chmod +x migchat`
- Move it to a directory in your PATH
Supported Platforms
- Linux x86_64 (with desktop notifications)
- Linux aarch64/ARM64 (with desktop notifications)
- macOS x86_64 (Intel)
- macOS aarch64 (Apple Silicon)
- Windows x86_64
- Windows aarch64/ARM64
Breaking Changes
Release v0.2.1 - Fix Message Decryption
MigChat CLI v0.2.1 - Message Decryption Fix
This is a patch release that fixes a critical bug where encrypted messages were not being decrypted when viewing conversations.
π Bug Fix
Fixed: Messages Showing as Encrypted Base64
Issue: When viewing conversations, messages were displaying as encrypted base64 text instead of decrypted plaintext.
Root Cause: The current_password was None when viewing conversations if the user was already logged in from a previous session. The password is only captured during login or account creation, not when starting an already-logged-in session.
Impact: Users couldn't read their encrypted messages - they would only see the raw base64 ciphertext like:
eyJ2ZXJzaW9uIjoxLCJzZW5k...
Solution
- Added
ensure_password()method that prompts for password when needed for decryption - Updated
print_message()to useensure_password()instead of assuming password exists - Better error handling to show specific decryption failures
- Backward compatibility maintained for unencrypted messages
π§ How It Works Now
- When you view a conversation with encrypted messages
- If password isn't cached, you'll be prompted once to enter it
- Password is cached for the session
- All subsequent messages decrypt automatically
- If decryption fails, you see a clear error message instead of raw base64
π Changes Since v0.2.0
Bug Fixes
- Fixed message decryption not working when viewing conversations
- Fixed borrow checker errors in password handling
- Fixed type comparison issues after cloning current_user
Commits
6c0f7be: Fix message decryption in conversationsdf308fd: Fix borrow checker error in print_messagec6a9fa0: Fix type comparison after cloning current_user
Full Changelog: v0.2.0...v0.2.1
β οΈ Known Issue from v0.2.0
If you upgraded to v0.2.0, you may have seen this decryption issue. Upgrading to v0.2.1 fixes it completely.
π Installation
Upgrading from v0.2.0:
- Download the new binary for your platform
- Replace your existing binary
- When viewing conversations, you'll be prompted for your password once
Quick Install (Linux/macOS):
curl -fsSL https://raw.githubusercontent.com/migchat/cli/main/install.sh | bashQuick Install (Windows):
irm https://raw.githubusercontent.com/migchat/cli/main/install.ps1 | iexManual Installation:
- Download the binary for your platform below
- Rename it to
migchatormigchat.exe(remove platform suffix) - (Unix only) Make it executable:
chmod +x migchat - Move it to a directory in your PATH
π¦ What's in v0.2.x
v0.2.0 (Previous Release)
- CRITICAL SECURITY FIX: Per-account encryption keys
- Each account now has unique encryption keys
- Account isolation enforced
v0.2.1 (This Release)
- Bug Fix: Message decryption now works properly
- Password prompting when needed
- Better error handling
π Security
All security features from v0.2.0 remain:
- β Per-account encryption keys
- β Account isolation
- β Unique fingerprints per account
- β Signal Protocol/X3DH implementation
- β ChaCha20-Poly1305 encryption
- β Perfect forward secrecy
Type: Bug Fix
Priority: P1 - High (affects usability)
Recommendation: Upgrade if you experienced decryption issues in v0.2.0
Release v0.2.0 - CRITICAL SECURITY FIX: Per-Account Encryption
MigChat CLI v0.2.0 - CRITICAL SECURITY FIX
π΄ CRITICAL: Per-Account Encryption Keys
This is a major security release that fixes a critical vulnerability where all accounts shared the same encryption keys.
Security Issue Fixed
Severity: CRITICAL π΄
CVE: N/A (internal discovery)
Affects: v0.1.8, v0.1.9
All user accounts on the same machine were sharing identical encryption keys, meaning:
- β All accounts had the same fingerprint
- β Any account could decrypt messages meant for other accounts
- β Key verification was meaningless (all verified the same key)
- β If one account was compromised, ALL accounts were compromised
Solution
Each account now has unique encryption keys stored separately:
Before (INSECURE):
~/.config/migchat/keys/ # β Shared by ALL accounts
βββ identity_key.enc
βββ signed_prekey.enc
After (SECURE):
~/.config/migchat/keys/
βββ alice/ # β
Alice's unique keys
β βββ identity_key.enc
β βββ signed_prekey.enc
βββ bob/ # β
Bob's unique keys
βββ identity_key.enc
βββ signed_prekey.enc
π What's Fixed
Per-Account Encryption
- β Each account has unique encryption keys
- β
Keys stored in
~/.config/migchat/keys/{username}/ - β
Sessions isolated per account:
~/.config/migchat/sessions/{username}/ - β Different accounts have different fingerprints
- β Account isolation enforced
- β Multi-account setup is now secure
Architecture Changes
Core Crypto Modules:
- Added
EncryptionManager::for_account(username)method - Added
KeyManager::for_account(username)method - Added
SessionManager::for_account(username)method
UI Updates:
- Changed
encryption: EncryptionManagerβOption<EncryptionManager> - Encryption manager switches when switching accounts
- Account-specific initialization on login/creation
- Safe access via
ensure_encryption()helpers
π Changes
Security Fixes
- [CRITICAL] Per-account encryption keys (#9, #10)
- [CRITICAL] Account isolation for encryption sessions
Bug Fixes
- Fixed compilation errors in encryption implementation
- Fixed borrow checker issues with token handling
- Fixed type mismatches in API method calls
Commits Since v0.1.9
21bf295: Complete per-account encryption implementation3aa5543: Fix compilation errors in per-account encryptionf8b271a: Fix all remaining compilation errorsb4db547: Bump version to 0.2.0
Full Changelog: v0.1.9...v0.2.0
π¨ Action Required for Existing Users
Single-Account Users
- β No action needed - Your setup will continue to work
- Your keys will remain in the default location
Multi-Account Users
β οΈ Important: Your old accounts may have been using shared keys- Recommended Actions:
- Download the new v0.2.0 binary
- Log into each account
- Generate new keys (log out and log back in)
- Verify your new fingerprints with contacts
- Consider rotating keys if you suspect compromise
Migration Details
First account to log in:
- May retain old global keys (backward compatible)
Subsequent accounts:
- Will generate new unique keys automatically
Best Practice:
- Regenerate keys for all accounts to ensure proper isolation
- Verify fingerprints with all contacts after upgrade
π Security Best Practices
After upgrading:
- β Log out and log back into each account to ensure keys are per-account
- β View your fingerprint (Security β View My Fingerprint)
- β Verify it's different for each account
- β Share new fingerprints with your contacts
- β Have contacts verify your new fingerprints
π Testing
Verified functionality:
- β Each account generates unique keys
- β Different accounts have different fingerprints
- β Account isolation enforced
- β Multi-account encryption works securely
- β Backward compatibility with single-account setups
- β All builds passing on all platforms
π‘οΈ Security Properties
Before v0.2.0
- π΄ Shared keys across all accounts
- π΄ No account isolation
- π΄ Compromised security model
v0.2.0 and Later
- β Unique keys per account
- β Full account isolation
- β Secure multi-account support
- β Proper fingerprint verification
- β Forward secrecy maintained
π¦ Installation
Upgrading from v0.1.x:
- Download the new binary for your platform
- Replace your existing binary
- Important: Log out and log back in to each account
Quick Install (Linux/macOS):
curl -fsSL https://raw.githubusercontent.com/migchat/cli/main/install.sh | bashQuick Install (Windows):
irm https://raw.githubusercontent.com/migchat/cli/main/install.ps1 | iexπ Related Issues
- Closes #9: CRITICAL: All accounts share the same encryption keys
- PR #10: Per-account encryption implementation
Priority: P0 - Critical Security Fix
Type: Security, Breaking Change (internal)
Impact: All users with multiple accounts
Recommendation: Upgrade immediately if using multiple accounts
Release v0.1.9 - Fix Encryption Key Generation
MigChat CLI v0.1.9 - Encryption Key Generation Fix
This is a hotfix release that resolves an issue where users couldn't view their encryption fingerprint or use encryption features.
π Bug Fix
Fixed: "No such file or directory" Error on Fingerprint View
Issue: Users who created accounts before v0.1.8 (or who didn't have local encryption keys) encountered this error when trying to view their fingerprint:
βββ Your Encryption Fingerprint βββ
β Failed to get fingerprint: No such file or directory (os error 2)
Root Cause: Encryption keys were only generated during new account creation. When logging into existing accounts, the CLI assumed keys already existed, causing failures for users without local keys.
Solution: The CLI now automatically generates encryption keys when logging into existing accounts if they don't exist locally. This matches the behavior of new account creation.
π§ What's Changed
Automatic Key Generation on Login
- Added key existence check when logging into existing accounts
- Automatically generates encryption keys if they don't exist
- Uploads public keys to server
- Displays fingerprint after generation
- Provides better error messages with guidance
Improved User Experience
- Seamless: No manual intervention required
- Backwards compatible: Doesn't affect users with existing keys
- Consistent: Same key generation flow as account creation
π Changes
Full Changelog: v0.1.8...v0.1.9
Merged PRs
- #8: Fix: Generate encryption keys automatically on login
Commits
π Upgrade Instructions
- Download the new binary for your platform below
- Replace your existing binary
- For existing users without keys: Simply log out and log back in
- Your encryption keys will be automatically generated
- You'll see your fingerprint displayed
- All encryption features will work normally
π Encryption Features
All v0.1.8 encryption features remain available:
- End-to-end encryption with Signal Protocol/X3DH
- ChaCha20-Poly1305 authenticated encryption
- Perfect forward secrecy
- Key fingerprint verification
- Secure key backups
Note: If you're upgrading from v0.1.7 or earlier, see the v0.1.8 release notes for full details on the encryption features added.
Release v0.1.8 - End-to-End Encryption
MigChat CLI v0.1.8 - End-to-End Encryption
This release introduces end-to-end encryption for all messages, providing strong security guarantees for user communications.
π Major Features
End-to-End Encryption
- Signal Protocol/X3DH key agreement implementation
- ChaCha20-Poly1305 authenticated encryption for all messages
- X25519 Diffie-Hellman key exchange
- Ed25519 digital signatures for authentication
- Perfect forward secrecy with one-time prekeys
- Argon2 password-based key encryption for local storage
Phase 3 Security Features
- Key Fingerprint Verification: SHA256-based fingerprints for out-of-band verification
- Key Change Warnings: Alerts when a contact's keys change
- Secure Key Backup: Export and import encrypted key backups
Encryption Architecture
Client-side:
- Identity keys (X25519 keypair)
- Signed prekeys (X25519 keypair + Ed25519 signature)
- 100 one-time prekeys for forward secrecy
- Password-encrypted local key storage
- Session management with automatic key derivation
Server-side:
- Public key storage and distribution
- Key upload/retrieval API endpoints
- One-time prekey pool management
π― Security Properties
- β Confidentiality: Only sender and recipient can read messages
- β Authenticity: Cryptographic verification of sender identity
- β Forward Secrecy: Past messages remain secure if keys compromised
- β Deniability: No proof of message authorship to third parties
π¦ What's Changed
New Features
- Added complete crypto module (
src/crypto/) with:keys.rs- Key generation, storage, and fingerprintssession.rs- X3DH protocol and session managementencrypt.rs- High-level encryption API
- New "Security & Encryption" menu with:
- View your fingerprint
- Verify contact fingerprints
- Export/import key backups
- Automatic encryption for all new messages (π indicator)
- Seamless handling of legacy unencrypted messages
API Changes
- New endpoints:
POST /api/keys/upload,GET /api/keys/:username - Enhanced message model to support encrypted content
Dependencies Added
x25519-dalek- Elliptic curve Diffie-Hellmaned25519-dalek- Digital signatureschacha20poly1305- AEAD cipherhkdf- Key derivationhmac- Message authenticationargon2- Password hashingzeroize- Secure memory clearing
π§ Technical Details
Key Storage:
- Location:
~/.config/migchat/keys/ - Files:
identity_key.enc,signed_prekey.enc,one_time_prekeys.enc - Encryption: Argon2 with user password
Migration Strategy:
- Hard cutover: All new messages encrypted
- Backward compatible: Can read old unencrypted messages
- Clear user messaging: "End-to-end encryption enabled" notification
π§ͺ Testing
Comprehensive testing completed:
- β CLI encryption setup and key generation
- β API infrastructure for key storage/retrieval
- β Real cryptographic key verification
- β Multi-user encryption scenarios
- β Message encryption and delivery
See full test results: Encryption Test Report
π Commits
- d813e6c: Merge PR #7 - E2E encryption feature
- 15ad86a: Fix borrow checker errors in session management
- 38e29c0: Merge PR #6 - E2E encryption feature
- f141c84: Fix Rust compilation errors in crypto module
- 40b6b7c: Merge PR #5 - E2E encryption feature
- 857a8c4: Add end-to-end encryption support with Phase 3 features
π Upgrade Instructions
- Download the new binary for your platform
- First login after upgrade will generate encryption keys
- You'll see your fingerprint displayed - save it for verification
- All new messages will be automatically encrypted
Note: Your existing message history remains unencrypted, but all new messages will use E2E encryption.
π Documentation
For more information on using the encryption features:
- View your fingerprint: Security & Encryption β View Fingerprint
- Verify contacts: Security & Encryption β Verify Contact
- Backup keys: Security & Encryption β Export Backup
Full Changelog: v0.1.7...v0.1.8
Release v0.1.7
MigChat CLI v0.1.7
What's New
- Fixed Unread Message Tracking: Unread counts now properly decrease when you view conversations
- API Improvements: Added support for marking messages as read and fetching filtered conversations
- Better Performance: Optimized message loading for individual conversations
Installation
Quick Install (Linux/macOS):
curl -fsSL https://raw.githubusercontent.com/migchat/cli/main/install.sh | bashQuick Install (Windows):
irm https://raw.githubusercontent.com/migchat/cli/main/install.ps1 | iexManual Installation:
- Download the binary for your platform below
- Rename it to
migchatormigchat.exe(remove platform suffix) - (Unix only) Make it executable:
chmod +x migchat - Move it to a directory in your PATH
Supported Platforms
- Linux x86_64 (with desktop notifications)
- Linux aarch64/ARM64 (with desktop notifications)
- macOS x86_64 (Intel)
- macOS aarch64 (Apple Silicon)
- Windows x86_64
- Windows aarch64/ARM64
Full Changelog
Commits:
- Add client support for unread message tracking
- Bump version to 0.1.7
Release v0.1.6
MigChat CLI v0.1.6
New Features
- β¨ Cancel/Back option in Send Message screen - Can now exit the send message flow without sending by selecting "β Cancel" or leaving fields empty
- β¨ Cancel/Back option in Change Username screen - Can now exit the change username flow without making changes
- π§ Fixed GitHub Actions workflow - Auto-runs on pushes to main and creates releases reliably
Improvements
- Better UX with titled sections ("βββ Send Message βββ" and "βββ Change Username βββ")
- Shows context before performing actions (current username, replying to user)
- Multiple ways to cancel operations (menu option or empty input)
- Clear screen and proper formatting for better user experience
Bug Fixes
- Fixed release workflow that was failing on artifact uploads
- Release workflow now properly flattens artifact directories for reliable uploads
- Workflow now triggers on both main pushes (builds only) and tag pushes (builds + release)
Previous Features (from v0.1.5)
- Show version in header
- Navigable conversations with interactive selection
- Send response in conversation thread
- Change username functionality
- Polling for new messages (Linux: with desktop notifications)
- Auto-update option with GitHub release integration
Installation
Quick Install (Linux/macOS):
curl -fsSL https://raw.githubusercontent.com/migchat/cli/main/install.sh | bashQuick Install (Windows):
irm https://raw.githubusercontent.com/migchat/cli/main/install.ps1 | iexManual Installation:
- Download the binary for your platform below
- Rename it to
migchatormigchat.exe(remove platform suffix) - (Unix only) Make it executable:
chmod +x migchat - Move it to a directory in your PATH
Supported Platforms
- Linux x86_64 (with desktop notifications)
- Linux aarch64/ARM64 (with desktop notifications)
- macOS x86_64 (Intel)
- macOS aarch64 (Apple Silicon)
- Windows x86_64
- Windows aarch64/ARM64
What's Changed
Full Changelog: v0.1.5...v0.1.6