Skip to content

mmehwishh/TLS-Secure-VPN-Server

Repository files navigation

Secure VPN Client-Server (C + OpenSSL)

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.


Features

  • 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

VPN Commands

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


Security Mechanisms

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

Requirements

  • GCC Compiler
  • OpenSSL Library
  • Linux / WSL environment

Install dependencies: sudo apt update sudo apt install build-essential libssl-dev


Compilation

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


Running the Program

Start the server: ./vpn_server

Run the client: ./vpn_client <server_ip>

Example: ./vpn_client 127.0.0.1


Authentication

Example valid users in the system: Username: mehwish Password: secure123

Username: tasbiha Password: vpnpass

Username: areeza Password: hello123


Learning Objectives

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.

About

A Secure VPN Client-Server implementation in C using OpenSSL. The project establishes encrypted communication using TLS and AES-256 encryption, with client authentication and secure key exchange. It supports multiple clients using multi-threading and allows users to send commands such as connect, status, and ping through an encrypted VPN session.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors