Hima Chat is a secure chat application built specifically to demonstrate and apply cryptography concepts in real-world communication systems.
The project focuses on encryption, key sharing, and secure message storage, rather than UI design or clean-code practices.
The main goal of this project is to:
- Apply cryptographic algorithms in a real chat scenario
- Protect sensitive data from attackers by storing encrypted messages only
- Simulate secure key agreement between sender and receiver
- Design the system to be extensible for adding new encryption algorithms
⚠️ This project is cryptography-oriented.
Topics such as clean code, advanced architecture patterns, or UI optimization are out of scope.
- Symmetric Key Encryption
- Shared Secret Keys
- Plain Text → Cipher Text Transformation
- Secure Data Storage (Encrypted at Rest)
- Decryption Only with Matching Key & Algorithm
- C#
- ASP.NET Core MVC
- Razor Pages
- HTML / CSS
- SQL Server
- Visual Studio
The system is divided into two main cryptography-related modules:
- Sender and Receiver must:
- Choose the same encryption algorithm
- Use the same secret key
- This shared configuration represents the cryptographic agreement
- Messages are encrypted before being stored
- Only encrypted data (Cipher Text) is saved in the database
- Decryption is possible only if:
- The correct key is used
- The correct encryption algorithm is selected
| Column | Description |
|---|---|
| User identifier | |
| FName | First Name |
| LName | Last Name |
| Password | Stored securely |
| Column | Description |
|---|---|
| EmailFrom | Sender |
| EmailTo | Receiver |
| Key | Shared secret key |
| EncryptionType | Selected algorithm |
| Time | Chat creation time |
| Column | Description |
|---|---|
| Id | Message ID |
| EmailFrom | Sender |
| EmailTo | Receiver |
| CipherText | Encrypted message |
| TimeMessage | Timestamp |
⚠️ No plain text messages are stored in the database.
1️⃣ User logs in
2️⃣ Sender creates a new chat
3️⃣ Sender & Receiver agree on:
- Encryption Algorithm
- Secret Key
4️⃣ Sender writes a message (Plain Text)
5️⃣ System encrypts the message → Cipher Text
6️⃣ Cipher Text is stored in the database
7️⃣ Receiver: - Uses the same key & algorithm
- Decrypts Cipher Text → Plain Text
✔️ Without the correct key and algorithm, messages are unreadable
The system is designed to make adding new encryption algorithms simple and scalable.
1️⃣ Create a new class with the same name as the encryption type
2️⃣ Implement the following static methods:
public static string Encrypt(string plainText, string key);
public static string Decrypt(string cipherText, string key);

