Skip to content

A secure file encryption and text encoding server with web interface and admin tools. Built with Flask (Python) and Rust client.

License

Notifications You must be signed in to change notification settings

serbekun/hash_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hash Server

A secure file encryption and text encoding server with web interface and admin tools. Built with Flask (Python) and Rust client.

Features

  • File Encryption/Decryption - XOR cipher with password protection
  • Base64 Encoding - Text encoding/decoding via web interface
  • Secure File Upload - Path traversal protection and file validation
  • Token-based Authentication - Secure admin and download access
  • Web Interface - User-friendly web UI for all operations
  • Admin Dashboard - Server management and monitoring
  • Cross-platform Clients - Python and Rust admin clients
  • Comprehensive Logging - Detailed server activity logs

Quick Start

Prerequisites

  • Python 3.8+
  • Rust (for admin client)
  • FastAPI

Installation

  1. Clone the repository
git clone https://github.com/serbekun/hash_server.git
cd hash_server
  1. Install Python dependencies
pip install -r requirements.txt
  1. Configure server settings
# Edit url_info.py
_IP = "your_server_ip"  # Use "127.0.0.1" for local development
_PORT = 2222
  1. Run the server
python main.py

The server will start at http://your_server_ip:2222

Usage

Web Interface

  • Main Page: http://your_server_ip:2222/
  • File Encryption: http://your_server_ip:2222/hashing_file
  • Base64 Tools: http://your_server_ip:2222/hashing_text_base64

File Encryption

  1. Upload any file through the web interface
  2. Set encryption password (minimum 4 characters)
  3. Choose encrypt/decrypt mode
  4. Download processed file using provided token

Admin Access

Python Client

python admin_client.py

Available commands: admin, clear_uploads, list_uploads, log

Rust Client

cd admin_client
cargo run

Available commands: admin, clear_uploads, list_uploads, log, set_token

API Documentation

File Processing

POST /hashing_file/process_file
Content-Type: multipart/form-data

file: [file]
password: [string]
mode: encrypt|decrypt

Base64 Encoding

POST /base64
Content-Type: application/json

{
  "text": "string",
  "mod": "1"  // 1=encode, 2=decode
}

Admin Endpoints

All admin endpoints require valid token in JSON body:

{"token": "admin_your_token_here"}

Project Structure

hash_server/
├── server.py                # Main server
│
├── src/                     # server logic code
│
├── templates/               # Web interfaces
│   ├── main/
│   ├── hashing_file/
│   └── hashing_text_base64/
├── admin_client/            # Rust admin client
│   └── src/
├── tokens/                  # Token storage
├── uploads/                 # Temporary file storage
├── log/                     # Server logs
└── main.py                  # entry point to server

Environment Variables

For production, use environment variables:

export SERVER_IP="your_ip"
export SERVER_PORT="2222"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Note: This server is designed for secure internal networks. For production use, consider additional security measures like HTTPS, rate limiting, and firewall configuration.

About

A secure file encryption and text encoding server with web interface and admin tools. Built with Flask (Python) and Rust client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published