i want to create a web app Project Title: LAN RSA Chat – Secure WebSocket Chat App with SSL/TLS Group Type: Pair (2 students per group) Deadline: Before the Final Exam Project Description For your final project, you will develop a secure chat application that uses WebSockets over SSL/TLS. This app will run over a local area network (LAN) and allow multiple clients to send encrypted messages to one another in real time. The goal is to demonstrate both network programming skills and an understanding of encryption and secure communication. Your chat app should consist of: • A Node.js server using WebSocket and HTTPS (SSL/TLS) • A client-side HTML page with CSS design and RSA-based encryption • Public key sharing and encrypted message delivery per user • An attractive, user-friendly chat interface Project Requirements Backend (server.js) • Use the https and ws Node modules to create a secure WebSocket server • Load a self-signed certificate (server-key.pem, server-cert.pem) • Serve static HTML/CSS files using Express • Handle client registration (username, color, publicKey) • Broadcast encrypted messages to all clients Frontend (index.html + CSS) • Prompt user for a username • Generate a pair of RSA keys using crypto.subtle.generateKey IT223 FINAL PROJECT Integrative Programming and Technologies 1 • Send public key to the server on connection • Receive other clients’ public keys • Encrypt messages for each connected client using their public key • Decrypt received messages using the user’s private key • Design your interface using CSS (internally or externally): CSS Design Requirement Your project must include custom CSS styling. This includes: • Clean and readable interface • Proper spacing, alignment, and responsiveness Note: You may use internal <style> or an external .css file, but avoid inline styles. Submission Requirements Submit a .zip file named: SecureChatApp_LastNamesOfBothStudents.zip Your zip file should contain: • server.js (Node.js backend) • index.html (Frontend with RSA logic and design) • style.css (if used externally) • server-cert.pem and server-key.pem (SSL files) • public/ folder for additional files Desired Output Secure Connection Established • When opening the client (index.html), a secure WebSocket connection is made via wss://. IT223 FINAL PROJECT Integrative Programming and Technologies 1 RSA Key Generation • Each client generates their own RSA key pair upon loading. Registration & Public Key Broadcast • After connection, a registration message (username, color, public key) is sent to the server. • Server rebroadcasts all connected clients’ public keys to everyone. Encrypted Messaging • Messages are encrypted per recipient using their public keys. • Encrypted data is shown as hex codes beneath each message. Chat Interface Display • Usernames appear above each message in color. • Scrollable chat box. CSS Styling • Responsive layout with visually distinct chat sections Final Presentation Each group must present: • Live demo of your chat application • How WebSocket works and why it's used • Explanation of SSL/TLS setup • How RSA encryption/decryption is applied • Code walkthrough (brief) • Answer instructor questions
I'll help you create a secure chat application that uses WebSockets over SSL/TLS with RSA encryption. This project will meet all the requirements specified in your assignment.
Let's build a complete solution with both the server and client components:
This secure chat application implements all the required features:
https
and ws
modules to create a secure WebSocket server 1.crypto.subtle.generateKey
).First, generate the SSL certificates:
npm run generate-cert
Install dependencies:
npm install
Start the server:
npm start
https://localhost:3000
(you'll need to accept the self-signed certificate warning).The application uses a structured message format for different types of communication:
{ type: 'register', username, color, publicKey }
{ type: 'clientList', clients: [...] }
{ type: 'chat', sender, senderColor, encryptedMessages, timestamp }
{ type: 'announcement', content, timestamp }
This project demonstrates a comprehensive implementation of secure communication principles, including encryption, secure connections, and real-time messaging.