A secure terminal-based messaging application built with C# (.NET 9), featuring AES-256 encryption, PBKDF2 password hashing, and a beautiful Gruvbox-themed TUI.
- 🔒 AES-256 Encryption - All messages encrypted before storage
- 🔑 PBKDF2 Password Hashing - Secure user authentication (100k iterations)
- 📨 Real-time Messaging - Send, receive, edit, and delete messages
- 👑 Admin Panel - User management with protected accounts
- 🔔 Notification System - Badge indicators for unread messages
- 🔄 Manual Refresh - Check for new messages on-demand
- 🎨 Gruvbox Theme - Beautiful terminal interface with Spectre.Console
- 💾 SQLite Database - Lightweight with ADO.NET
- 🖥️ Cross-platform - Works on Windows, Linux, and macOS
# Clone the repository
git clone https://github.com/defaltastra/encrypted-messaging.git
cd encrypted-messaging
# Restore dependencies
dotnet restore
# Build and run
dotnet run- Register an account or Login
- Send encrypted messages to other users
- View received messages (auto-marked as read)
- Edit/delete your sent messages
- Use 🔄 Rafraîchir to check for new messages
- Username:
admin - Password:
admin
Admin capabilities:
- Create users with the
ADMIN_prefix - Modify/delete only admin-created accounts
- View system statistics
- Self-registered users are protected
EncryptedMessaging/
├── Models/ # User and Message entities
├── Security/ # AES encryption & password hashing
├── Data/ # SQLite repositories (ADO.NET)
├── Services/ # Business logic
└── UI/ # Spectre.Console interface
Users Table
- Id (INTEGER PRIMARY KEY)
- Username (TEXT UNIQUE)
- PasswordHash (TEXT)
- CreatedAt (TEXT)Messages Table
- Id (INTEGER PRIMARY KEY)
- SenderId (INTEGER FK)
- ReceiverId (INTEGER FK)
- EncryptedContent (TEXT)
- SentAt (TEXT)
- IsRead (INTEGER)- Encryption: AES-256-CBC with PKCS7 padding
- Password Hashing: PBKDF2-HMAC-SHA256 (100k iterations, 128-bit salt)
- Message Storage: All messages encrypted at rest
- Admin Protection: User-created accounts cannot be modified by admin
⚠️ Note: In production, encryption keys should be stored securely (Azure Key Vault, environment variables, etc.)
<PackageReference Include="Spectre.Console" Version="0.49.1" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="9.0.0" />Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
This project is licensed under the GPL License.
- Built with Spectre.Console
- Inspired by secure messaging principles
- Gruvbox color scheme
