Skip to content

Secure multiplayer Tic-Tac-Toe game built with Python sockets, SSL encryption, and a Tkinter GUI. Real-time client-server communication over TLS.

Notifications You must be signed in to change notification settings

shreeraksha-cs/secure-tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Secure Tic-Tac-Toe Over SSL 🎮

A secure two-player Tic-Tac-Toe game using Python socket programming, SSL encryption, and Tkinter GUI. This project was developed as a group mini-project as part of the Computer Networks course, demonstrating real-time multiplayer communication over a secure TLS-encrypted client-server architecture.


🎯 Objective

To build a client-server Tic-Tac-Toe game that:

  • Supports two-player encrypted communication using SSL
  • Offers a GUI interface for players using Tkinter
  • Uses socket, threading, and secure communication principles

🛠️ Technologies Used

  • Python 3
  • Sockets & Threading
  • SSL/TLS (with ssl module)
  • Tkinter (GUI)
  • X.509 certificate (.crt and .key)

🧩 How It Works

🖥️ Server (server.py)

  • Accepts two clients over TLS
  • Assigns player marks: 'X' and 'O'
  • Handles game logic, player turns, and broadcasts updates
  • Detects win/draw and notifies both clients

👨‍💻 Client (client.py)

  • Connects to the server securely via SSL
  • GUI-based 3x3 grid using Tkinter
  • Sends player moves, receives updates
  • Displays results via pop-up dialogs

🔐 Security

  • TLS/SSL-based communication (using ssl.SSLContext)
  • Encrypted data between client and server
  • Certificate and private key files are used for authentication

▶️ How to Run

1. 🧾 Generate SSL Certificate (Optional, if you don’t have one):

openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key

You can also use the provided server.crt and server.key.

2. 🚀 Run Server (on terminal 1):

python server.py

3. 🧑‍🤝‍🧑 Run Clients (on terminal 2 and 3, or different machines):

python client.py

Ensure that the IP in client.py and server.py match your local/host machine IP (e.g., 192.168.x.x).


📷 Sample Screenshot

Tic-Tac-Toe Screenshot


⭐ If you found this project useful or interesting, please consider giving it a ⭐ star!

About

Secure multiplayer Tic-Tac-Toe game built with Python sockets, SSL encryption, and a Tkinter GUI. Real-time client-server communication over TLS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages