This project implements a simple Secure VPN Client-Server system in C using OpenSSL.
It demonstrates encrypted communication, client authentication, and secure key exchange over a network.
The server accepts multiple client connections and establishes a secure VPN-like session where commands are sent and received through encrypted channels.
- Secure communication using TLS (OpenSSL)
- AES-256 encryption for message confidentiality
- Client authentication using username and password
- Multi-threaded server supporting multiple clients
- Secure key exchange
- Command-based VPN interaction
The client supports the following commands:
| Command | Description |
|---|---|
| connect | Establish VPN connection |
| disconnect | Terminate VPN session |
| status | Show VPN session information |
| ping | Test connectivity |
| help | Display command list |
| exit | Close VPN client |
server.c # VPN Server client.c # VPN Client encryption.c # AES encryption and decryption authentication.c # User authentication vpn_config.h # Configuration settings network_utils.h # Networking utilities
The project uses multiple security layers:
- TLS/SSL encryption using OpenSSL
- AES-256-CBC encryption for packet security
- Random key generation using OpenSSL RAND
- Certificate validation
- Username/password authentication
- GCC Compiler
- OpenSSL Library
- Linux / WSL environment
Install dependencies: sudo apt update sudo apt install build-essential libssl-dev
Compile the server: gcc server.c encryption.c authentication.c -o vpn_server -lssl -lcrypto -lpthread
Compile the client: gcc client.c encryption.c authentication.c -o vpn_client -lssl -lcrypto
Start the server: ./vpn_server
Run the client: ./vpn_client <server_ip>
Example: ./vpn_client 127.0.0.1
Example valid users in the system: Username: mehwish Password: secure123
Username: tasbiha Password: vpnpass
Username: areeza Password: hello123
This project demonstrates:
- Network programming in C
- Secure communication using OpenSSL
- Multi-threaded server design
- Encryption and decryption techniques
- Authentication mechanisms
Developed as part of a Computer Networks / Security project.