Skip to content

Fred-Sheppard/westwood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Networking Server

A high-performance, secure networking server built with Rust that provides user authentication, device registration, and secure key exchange functionality.

Features

  • User registration and authentication
  • Device registration system
  • Secure key bundle management
  • Session handling with nonce-based security
  • Handshake protocol implementation
  • MySQL database integration
  • Comprehensive logging system

Tech Stack

  • Runtime: Tokio async runtime
  • Web Framework: Hyper
  • Database: MySQL with SQLx
  • Authentication: Ed25519 cryptographic signatures
  • Serialization: Serde JSON
  • Logging: Fern logger with configurable outputs

Prerequisites

  • Rust (2024 edition)
  • MySQL server
  • OpenSSL development libraries

Setup

  1. Database Setup

    # Create the database and run migrations
    mysql -u rudebhoys -p
    CREATE DATABASE rudebhoys;
    # Apply the migration from migrations/20250522112256_create_users_and_devices.sql
  2. Environment

    • Copy secrets.env.example to secrets.env (if not exists)
    • Configure your database credentials and other environment variables
  3. Build and Run

    export DATABASE_URL=---URL---
    cargo build --release
    cargo run

API Endpoints

  • POST /registerUser - Register a new user
  • POST /registerDevice - Register a new device
  • POST /requestLogin - Initiate login process
  • POST /authenticate - Complete authentication
  • GET /keybundle/{id} - Retrieve key bundle
  • POST /updateKeybundle - Update key bundle
  • POST /handshake - Perform secure handshake
  • GET /status - Check service status

Security Features

  • Nonce-based authentication
  • Session management
  • Secure key exchange
  • Ed25519 signature verification
  • Request rate limiting

Development

The project uses the following directory structure:

networking/
├── src/
│   ├── main.rs          # Server setup and routing
│   ├── datatypes.rs     # Core data structures
│   ├── server_utils.rs  # Utility functions
│   └── routes/          # API endpoint handlers
└── Cargo.toml          # Dependencies and project metadata

Logging

Logs are written to app.log with configurable log levels. The logging system uses Fern for formatting and file output.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages