This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Repository files navigation

🔐 EncryptX (Archived & Unmaintained)

Important

Archive Notice: This project is archived and the author is no longer actively working on it. It was created purely as a personal learning experiment to explore Rust-based file cryptography, Next.js, and API development.

EncryptX is an educational file encryption utility providing a web interface and command-line access. It implements standard AES-256-GCM encryption for any file type, featuring automatic compression and dual encryption modes.


✨ Features

  • 🔑 Dual Encryption Methods: Use a password or 256-bit encryption key.
  • 🔐 Standard Security: AES-256-GCM ensures confidentiality and integrity.
  • 🧠 Argon2id Password Hashing: Key derivation for password authentication.
  • 🛡️ Tamper Detection: Authenticated encryption detects modification.
  • 📂 Any File Type: Works for docs, media, archives, etc.
  • 📦 Automatic Compression: Files are compressed with zstd before encryption for learning-based size reduction.
  • 🖥️ Subtle UI: Built with Next.js + Tailwind, featuring drag & drop.
  • 🧼 Memory-Safe Backend: Rust handles sensitive cryptographic materials securely.
  • 🔒 No Key Storage: Keys are processed in-memory and never stored server-side.

📸 Screenshots

🏠 Home Page

EncryptX HomepageModern interface with drag & drop file upload

🔐 Encryption Process

File EncryptionSecure file encryption with password or key-based options

Encryption SuccessSuccessful encryption with download ready

🔓 Decryption Process

File DecryptionEasy file decryption with original filename preservation

Decryption SuccessSuccessful decryption with original file restored


🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm (for frontend)
  • Rust 1.70+ and Cargo (for backend)
  • Docker (optional, for containerized deployment)

Quick Start

🐳 Docker Setup (Recommended for Quick Testing)

# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

🚀 Development Setup (Recommended for Development)

# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependenciescd encryptx-frontend && npm install &&cd ..
# Start both backend and frontend simultaneously
npm run dev

📱 Manual Setup (Alternative)

  1. Clone the repository

    git clone https://github.com/Amitminer/EncryptX.git
    cd EncryptX
  2. Start the backend

    cd encryptx-backend
    cargo run
  3. Start the frontend (in a new terminal)

    cd encryptx-frontend
    npm install
    npm run dev
  4. Open your browser

    http://localhost:3000
    

Available Scripts

🐳 Docker Commands (Simplest)

# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build

📦 NPM Scripts (Development)

The root package.json provides convenient scripts to manage both services:

# Development (runs both services with hot reload)
npm run dev
# Production build (builds both services)
npm run build
# Production start (runs both built services)
npm start
# Run tests (tests both services)
npm run test# Individual service commands
npm run dev:backend # Backend only
npm run dev:frontend # Frontend only
npm run build:backend # Build backend only
npm run build:frontend # Build frontend only
npm run start:backend # Start backend only
npm run start:frontend # Start frontend only
npm run test:backend # Test backend only
npm run test:frontend # Test frontend only

Docker Deployment

🐳 Quick Start with Docker

# Development (default settings)
docker-compose up --build
# Production with custom environment
RUST_LOG=warn \
ALLOWED_ORIGIN=https://yourdomain.com \
NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com \
NODE_ENV=production \
docker-compose up --build -d
# Common commands
docker-compose up -d --build # Run in background
docker-compose logs -f # View logs
docker-compose down # Stop services

🔧 Individual Container Builds

# Build backend (Alpine-based, ~50MB)
docker build -t encryptx-backend ./encryptx-backend
# Build frontend (Alpine-based with pnpm, ~150MB)
docker build -t encryptx-frontend ./encryptx-frontend
# Run individually
docker run -p 8080:8080 encryptx-backend
docker run -p 3000:3000 encryptx-frontend

🏗️ Architecture

System Overview

[User/Browser] → [Next.js Frontend] → [Rust Backend API] → [Crypto Engine]
↓ ↓
[CLI User] ────────────────────────→ [Rust CLI] → [Crypto Engine]
↓
[Encrypted .xd Files]

Key Components

  • Crypto Engine - Core AES-256-GCM encryption with Argon2id key derivation
  • Web API Server - Actix Web REST endpoints for file upload/download
  • CLI Interface - Command-line tool for direct file encryption/decryption
  • Frontend UI - Next.js application with drag-and-drop file handling

📖 Usage

Web Interface

  1. Encryption:

    • Drag & drop files or click to browse
    • Enter a password (optional) or let the system generate a secure key
    • Click "Encrypt & Download" to get your .xd file
  2. Decryption:

    • Upload your .xd file
    • Enter the password or key used for encryption
    • Download your original file

Command Line Interface

📦 Pre-built Binaries (Coming Soon)

Pre-built binaries will be available in future releases. For now, please build from source.

🛠️ Build from Source

# Navigate to backend directorycd encryptx-backend
# Encrypt with password
cargo run encrypt --file secret.txt --password mysecretpassword
# Encrypt with auto-generated key (key will be printed - save it!)
cargo run encrypt --file document.pdf
# Encrypt with custom key
cargo run encrypt --file data.zip --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run encrypt --file input.txt --password secret --output encrypted.xd --force
# Decrypt with password
cargo run decrypt --file secret.xd --password mysecretpassword
# Decrypt with key
cargo run decrypt --file document.xd --key YOUR_BASE64_KEY
# Specify output file and force overwrite
cargo run decrypt --file encrypted.xd --password secret --output decrypted.txt --force

🔧 API Reference

Endpoints

MethodEndpointDescription
POST/encryptEncrypt a file
POST/decryptDecrypt a file
GET/healthHealth check

Headers

HeaderDescriptionRequired
x-passwordPassword for encryption/decryptionOptional*
x-enc-keyBase64 encryption keyOptional*
x-orig-filenameOriginal filenameRecommended

*Either x-password or x-enc-key must be provided for decryption


🛠️ Development

Project Structure

EncryptX/
├── encryptx-backend/ # Rust backend (API + CLI)
│ ├── src/
│ │ ├── crypto/ # Core encryption/decryption logic
│ │ ├── cli/ # Command-line interface module
│ │ ├── service/ # Business logic layer
│ │ ├── validation/ # Input validation and security
│ │ ├── middleware/ # Security headers and CORS
│ │ ├── constants/ # Configuration constants
│ │ ├── main.rs # Web server entry point
│ │ └── lib.rs # Public API for library usage
│ ├── tests/ # Integration tests
│ ├── Cargo.toml # Rust dependencies and metadata
│ ├── Dockerfile # Backend containerization
│ └── README.md # Backend-specific documentation
├── encryptx-frontend/ # Next.js frontend
│ ├── src/app/ # Next.js 13+ app directory structure
│ │ ├── components/ # React components
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ ├── package.json # Node.js dependencies
│ ├── Dockerfile # Frontend containerization
│ └── README.md # Frontend-specific documentation
├── docker-compose.yml # Multi-service deployment configuration
├── .github/workflows/ # CI/CD automation
├── SECURITY.md # Security policy and guidelines
└── README.md # This file

Environment Variables

Backend (.env)

ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080

Running Tests

# Run all tests (both backend and frontend)
npm run test# Or run individually:
npm run test:backend # Rust tests with cargo
npm run test:frontend # Frontend tests with npm# Manual testing:cd encryptx-backend
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cd encryptx-frontend
npm test

🔒 Security

Security is our top priority. EncryptX implements:

  • AES-256-GCM authenticated encryption
  • Argon2id password-based key derivation (64MB memory, GPU-resistant)
  • Rate limiting (10 requests/minute per IP)
  • Input validation and sanitization
  • Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • Memory-safe key handling with automatic cleanup

⚠️Important: Keys are never stored server-side. If you lose your password or key, your data cannot be recovered.

For detailed security information, see SECURITY.md.


🚀 Deployment

Production Environment

  1. Environment Setup

    # Backendexport ALLOWED_ORIGIN=https://yourdomain.com
    export RUST_LOG=warn
    # Frontendexport NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
  2. Build for Production

    # Backendcd encryptx-backend
    cargo build --release
    # Frontendcd encryptx-frontend
    npm run build
  3. Deploy with Docker

    docker-compose -f docker-compose.prod.yml up -d

Hosting Platforms

ComponentRecommended Platforms
BackendRailway, Fly.io, DigitalOcean
FrontendVercel, Netlify, Cloudflare Pages
DatabaseNot required (stateless)

🧪 Technology Stack

Backend

TechnologyPurpose
RustMemory-safe systems programming
Actix WebHigh-performance async web framework
AES-GCMAuthenticated encryption
Argon2idPassword-based key derivation
zstdFast compression algorithm

Frontend

TechnologyPurpose
Next.js 15React framework with SSR
TypeScriptType-safe JavaScript
Tailwind CSSUtility-first CSS framework
React DropzoneFile upload interface

DevOps

TechnologyPurpose
DockerContainerization
GitHub ActionsCI/CD pipeline
BetterUptimeMonitoring

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test and npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Rust: Follow rustfmt and clippy recommendations
  • TypeScript: Follow Prettier and ESLint configurations
  • Commits: Use conventional commit messages

📊 Performance

  • Encryption Speed: ~100MB/s on modern hardware
  • Compression Ratio: 20-60% size reduction (varies by file type)
  • Memory Usage: <64MB per encryption operation
  • File Size Limit: 1GB maximum
  • Concurrent Users: Scales with available system resources

🐛 Troubleshooting

Common Issues

Backend won't start

# Check Rust installation
rustc --version
cargo --version
# Update dependencies
cargo update

Frontend build fails

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

CORS errors

# Check environment variablesecho$ALLOWED_ORIGINecho$NEXT_PUBLIC_BACKEND_URL

Getting Help


📄 License

This project is licensed under the MIT License. © 2025 AmitxD


🙏 Acknowledgments

  • Rust Community for excellent cryptographic libraries
  • Next.js Team for the amazing React framework