Open-source proof-of-concept demonstrating encrypted chat storage in chuk_chat
This is a transparency tool that demonstrates how chats are encrypted in the chuk_chat application. It allows users to:
- Login with their chuk_chat credentials
- See your real chats from the chuk_chat app
- View encrypted data exactly as it's stored in the database
- Toggle between encrypted and decrypted views
- Verify that encryption is working properly with your actual chat data
This app exists to prove to users that:
- ✅ Their chats are encrypted client-side
- ✅ The server never sees plaintext messages
- ✅ Only the user's password can decrypt their chats
- ✅ Encryption uses industry-standard algorithms
| Component | Algorithm | Details |
|---|---|---|
| Encryption | AES-256-GCM | Advanced Encryption Standard with 256-bit keys |
| Key Derivation | PBKDF2-HMAC-SHA256 | 600,000 iterations (very secure!) |
| Nonce Generation | Cryptographically Secure Random | 12-byte nonces for GCM mode |
| MAC | GCM built-in authentication | Ensures data integrity |
1. User enters password
↓
2. PBKDF2 derives encryption key (600,000 iterations)
↓
3. Key is stored locally (never sent to server)
↓
4. Messages are encrypted with AES-256-GCM before storage
↓
5. Encrypted payload includes:
- Version number
- Nonce (random)
- Ciphertext (encrypted message)
- MAC (authentication tag)
When you toggle to "Encrypted" view, you'll see something like this:
{
"v": "1",
"nonce": "8Kx2mPqR3nF5tLwZ",
"ciphertext": "5YzN8pQr2hK9xM3vB7wL...",
"mac": "1FgT4hJ6kN9pR2sV5yB8..."
}This is exactly how your chats are stored on your device!
- Flutter 3.0 or higher
- An account on chuk_chat (or the demo Supabase instance)
# Clone the repository
git clone https://github.com/1337-Corp/chat_encryption_viewer.git
cd chat_encryption_viewer
# Get dependencies
flutter pub get
# Run the app
flutter run- Sign in with your chuk_chat email and password
- View demo chats with sensitive information
- Toggle between "Encrypted" and "Decrypted" views
- Inspect the encryption format
Clean, simple authentication interface.
Shows the raw encrypted JSON as it's stored on your device.
Shows the plaintext message (only visible with your password).
lib/
├── main.dart # Main app with login and viewer UI
├── encryption_demo_service.dart # Simplified encryption service
└── supabase_config.dart # Backend configuration
Demonstrates the same encryption used in chuk_chat:
- PBKDF2 key derivation (600,000 iterations)
- AES-256-GCM encryption/decryption
- Secure random nonce generation
Simple Flutter app that:
- Authenticates users
- Creates demo chats
- Shows encrypted vs decrypted views
- All encryption happens on your device
- Server only stores encrypted data
- Your password never leaves your device
- PBKDF2 with 600,000 iterations
- Makes brute-force attacks impractical
- Salt is unique per user
- GCM mode provides built-in authentication
- Detects any tampering with encrypted data
- Prevents bit-flipping attacks
- Each message uses a unique random nonce
- Prevents pattern analysis
- Ensures same message encrypts differently each time
This is an open-source transparency tool! Contributions are welcome:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This is a demonstration tool to show how encryption works. It uses simplified key storage (SharedPreferences) for demo purposes. The main chuk_chat app uses more secure storage (flutter_secure_storage).
- chuk_chat - The main chat application
A: Yes! Same algorithms (AES-256-GCM, PBKDF2), same parameters (600k iterations), same format.
A: No! Encryption happens on your device. The server only sees encrypted blobs.
A: Your data cannot be decrypted without your password. This is by design for security.
A: This makes brute-force attacks very expensive. Each password guess takes ~0.5 seconds on modern hardware.
A: Yes! That's the whole point of this app. You can see the encrypted data and verify it matches the encrypted view.
If you have questions or concerns about encryption in chuk_chat:
- Open an issue on this repository
- Review the source code (it's open source!)
- Test it yourself with this viewer app
- Supabase - Backend infrastructure
- Cryptography Package - Dart cryptography library
- Flutter - UI framework
Made with ❤️ for transparency and privacy