This project implements a secure chat application with end-to-end encryption, ensuring privacy and security for user communications. You can read more about the details of this project in the REPORT.md file.
- Go (version 1.22.5 or later)
- Protocol Buffers compiler (protoc)
- SQLite
- fyne.io/fyne/v2 v2.5.0
- golang.org/x/crypto v0.23.0
- google.golang.org/protobuf v1.26.0
- github.com/joho/godotenv v1.5.1
- golang.org/x/crypto v0.25.0
- google.golang.org/protobuf v1.34.2
- github.com/mattn/go-sqlite3 v1.14.22
-
Clone the repository:
git clone https://github.com/tcivie/GolangSecuredChat.git cd GolangSecuredChat
-
Generate Protocol Buffers code:
protoc --go_out=client --go_opt=paths=source_relative resources/proto/packet.proto protoc --go_out=server --go_opt=paths=source_relative resources/proto/packet.proto
-
Set up the server:
cd server go mod tidy cd ..
-
Set up the client:
cd client go mod tidy cd ..
-
Generate TLS certificates for the server:
openssl req -x509 -newkey rsa:4096 -keyout resources/auth/server-key.pem -out resources/auth/server-cert.pem -days 365 -nodes
-
Set the SERVER_ADDRESS environment variable for the clients:
export SERVER_ADDRESS=localhost:8080
-
Start the server:
cd server/cmd go run main.go
-
In a new terminal, start a client:
cd client/cmd go run main.go
-
Repeat step 2 for each additional client you want to run.
- When you start a client, you'll be prompted to enter a username and select a private key file.
- If you're a new user, select "Register" to create a new account.
- If you're an existing user, select "Login" to access your account.
- Once logged in, you can view the list of online users and select a user to start a chat.
- Enter your messages in the chat window. All messages are end-to-end encrypted for security.
- TLS encryption for all server-client communications
- Public-key authentication for users
- End-to-end encryption for all chat messages
- Secure key exchange for establishing encrypted communication channels
- One-way encryption of usernames in the server database
After login you can see the list of online users
And the chat window (Which you can go back from and select other chat)
If someone sends you a message it would be saved in the chat with him so you can switch chats without worrying about losing the messages
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Fyne: GUI toolkit for Go
- Protocol Buffers: Data serialization format
- SQLite: Embedded database
- godotenv: Environment variable loader