Emotion-Aware Encryption — Encrypt messages with AES-256-GCM while embedding an emotional fingerprint (EmoTag) inside the ciphertext. Emotions are detected before encryption and recovered after decryption with no external storage.
Built for the UnsaidTalks Hackathon (Theme: AI + NLP + Encryption Logic).
- Emotion detection — Lexicon-weighted scoring over 8 emotions (Plutchik-style): Joy, Sadness, Anger, Fear, Surprise, Disgust, Trust, Anxiety
- EmoVault protocol — Custom payload: version + EmoTag byte (primary + secondary emotion nibbles) + AES-256-GCM(iv, authTag, ciphertext)
- REST API —
POST /api/analyze,POST /api/encrypt,POST /api/decrypt - React frontend — Analyze, Encrypt, Decrypt with emotion pills and cipher display
# Install root + frontend
npm run install:all
# Start backend (port 3000)
npm start
# In another terminal: frontend dev (port 5173, proxies /api to 3000)
cd frontend && npm run devOpen http://localhost:5173. For production, build the frontend and serve from the same server:
npm run build
npm start
# Frontend at http://localhost:3000├── server.js # Express server
├── api/routes.js # /api/analyze, /encrypt, /decrypt
├── emotion_codec.js # Emotion labels ↔ EmoTag byte
├── emotion_lexicon.js # Weighted word → emotion
├── emotion_engine.js # Lexicon-based emotion detection
├── emovault.js # AES-256-GCM + steganography
└── frontend/ # Vite + React SPA
- POST /api/analyze — Body:
{ "text": "..." }. Returns{ emotions, scores, primary, secondary, emoTag, confidence }. - POST /api/encrypt — Body:
{ "text": "...", "password": "optional" }. Returns{ ciphertextBase64, ivBase64, emotions }. - POST /api/decrypt — Body:
{ "ciphertextBase64": "...", "password": "optional" }. Returns{ plaintext, emotions }.
The default password is default-key when omitted. For real use, require a strong user password and consider a proper key derivation flow (e.g. Argon2) and secure storage.