A secure file encryption and text encoding server with web interface and admin tools. Built with Flask (Python) and Rust client.
- 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
- Python 3.8+
- Rust (for admin client)
- Flask
- Clone the repository
git clone https://github.com/serbekun/hash-server.git
cd hash-server- Install Python dependencies
pip install -r requirements.txt- Configure server settings
# Edit url_info.py
_IP = "your_server_ip" # Use "127.0.0.1" for local development
_PORT = 2222- Run the server
python server.pyThe server will start at http://your_server_ip:2222
- 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
- Upload any file through the web interface
- Set encryption password (minimum 4 characters)
- Choose encrypt/decrypt mode
- Download processed file using provided token
python admin_client.pyAvailable commands: admin, clear_uploads, list_uploads, log
cd admin_client
cargo runAvailable commands: admin, clear_uploads, list_uploads, log, set_token
POST /hashing_file/process_file
Content-Type: multipart/form-data
file: [file]
password: [string]
mode: encrypt|decryptPOST /base64
Content-Type: application/json
{
"text": "string",
"mod": "1" // 1=encode, 2=decode
}All admin endpoints require valid token in JSON body:
{"token": "admin_your_token_here"}hash_server/
βββ server.py # Main server
βββ config.py # Configuration
βββ routes/ # Flask blueprints
β βββ admin_routes/
β βββ process_file/
βββ 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
- Path Traversal Protection - Secure filename validation
- Token Authentication - Time-limited access tokens
- File Size Limits - 50MB maximum file size
- Input Validation - Comprehensive form validation
- Secure File Handling - Automatic temp file cleanup
class Config:
class Link:
HOST = "localhost-for_example" # Server IP
PORT = 2222 # Server port
class FileManaging:
LEAVE_UPLOADED_FILE = False # Auto-cleanupFor production, use environment variables:
export SERVER_IP="your_ip"
export SERVER_PORT="2222"- Create new blueprint in
routes/ - Add routes in
server.py - Update admin client if needed
# Test file encryption
python -c "from XORFileCipher import encrypt_file, decrypt_file; print('Cipher test passed')"
# Test server endpoints
python client.pyThis project is licensed under the MIT License - see the LICENSE file for details.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For support and questions:
- Open an issue on GitHub
- Check the documentation in code comments
Note: This server is designed for secure internal networks. For production use, consider additional security measures like HTTPS, rate limiting, and firewall configuration.