A modern, secure file encryption tool with both web interface and command-line access.
EncryptX provides military-grade AES-256-GCM encryption for any file type, featuring automatic compression, dual encryption modes, and a beautiful cyberpunk-themed interface.
- π Dual Encryption Methods: Use a password or 256-bit encryption key.
- π End-to-End Security: AES-256-GCM ensures confidentiality and integrity.
- π§ Argon2id Password Hashing: Secure key derivation for passwords.
- π‘οΈ Tamper Detection: Authenticated encryption blocks modification.
- π Any File Type: Works for docs, media, videos, archives β anything.
- π¦ Automatic Compression: Files are compressed with zstd before encryption for efficient storage and transfer.
- π§± Large File Support: Optimized for files up to 1GB.
- π₯οΈ Modern UI: Built with Next.js + Tailwind, featuring drag & drop and smooth feedback.
- π§Ό Memory-Safe Backend: Rust ensures sensitive data is securely handled.
- π‘οΈ Security Hardened: Rate limiting, input validation, and security headers.
- π No Key Storage: Keys are never stored server-side for maximum security.
Modern interface with drag & drop file upload
Secure file encryption with password or key-based options
Successful encryption with download ready
Easy file decryption with original filename preservation
Successful decryption with original file restored
- Node.js 18+ and npm (for frontend)
- Rust 1.70+ and Cargo (for backend)
- Docker (optional, for containerized deployment)
# Clone and start with Docker (fastest way)
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build
# Clone the repository
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
# Install root dependencies
npm install
# Install frontend dependencies
cd encryptx-frontend && npm install && cd ..
# Start both backend and frontend simultaneously
npm run dev
-
Clone the repository
git clone https://github.com/Amitminer/EncryptX.git cd EncryptX
-
Start the backend
cd encryptx-backend cargo run
-
Start the frontend (in a new terminal)
cd encryptx-frontend npm install npm run dev
-
Open your browser
http://localhost:3000
# Quick start with Docker
git clone https://github.com/Amitminer/EncryptX.git
cd EncryptX
docker compose up --build
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
# 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
# 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
[User/Browser] β [Next.js Frontend] β [Rust Backend API] β [Crypto Engine]
β β
[CLI User] βββββββββββββββββββββββββ [Rust CLI] β [Crypto Engine]
β
[Encrypted .xd Files]
- 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
-
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
-
Decryption:
- Upload your
.xd
file - Enter the password or key used for encryption
- Download your original file
- Upload your
Pre-built binaries will be available in future releases. For now, please build from source.
# Navigate to backend directory
cd 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
Method | Endpoint | Description |
---|---|---|
POST |
/encrypt |
Encrypt a file |
POST |
/decrypt |
Decrypt a file |
GET |
/health |
Health check |
Header | Description | Required |
---|---|---|
x-password |
Password for encryption/decryption | Optional* |
x-enc-key |
Base64 encryption key | Optional* |
x-orig-filename |
Original filename | Recommended |
*Either x-password
or x-enc-key
must be provided for decryption
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
Backend (.env)
ALLOWED_ORIGIN=http://localhost:3000
RUST_LOG=info
Frontend (.env)
NEXT_PUBLIC_BACKEND_URL=http://localhost:8080
# 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 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
For detailed security information, see SECURITY.md.
-
Environment Setup
# Backend export ALLOWED_ORIGIN=https://yourdomain.com export RUST_LOG=warn # Frontend export NEXT_PUBLIC_BACKEND_URL=https://api.yourdomain.com
-
Build for Production
# Backend cd encryptx-backend cargo build --release # Frontend cd encryptx-frontend npm run build
-
Deploy with Docker
docker-compose -f docker-compose.prod.yml up -d
Component | Recommended Platforms |
---|---|
Backend | Railway, Fly.io, DigitalOcean |
Frontend | Vercel, Netlify, Cloudflare Pages |
Database | Not required (stateless) |
Technology | Purpose |
---|---|
Rust | Memory-safe systems programming |
Actix Web | High-performance async web framework |
AES-GCM | Authenticated encryption |
Argon2id | Password-based key derivation |
zstd | Fast compression algorithm |
Technology | Purpose |
---|---|
Next.js 15 | React framework with SSR |
TypeScript | Type-safe JavaScript |
Tailwind CSS | Utility-first CSS framework |
React Dropzone | File upload interface |
Technology | Purpose |
---|---|
Docker | Containerization |
GitHub Actions | CI/CD pipeline |
BetterUptime | Monitoring |
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run tests (
cargo test
andnpm test
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Rust: Follow
rustfmt
andclippy
recommendations - TypeScript: Follow Prettier and ESLint configurations
- Commits: Use conventional commit messages
- 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
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 variables
echo $ALLOWED_ORIGIN
echo $NEXT_PUBLIC_BACKEND_URL
- π Check our Documentation
- π Report bugs in Issues
- π¬ Join discussions in Discussions
- π Security issues: See SECURITY.md
This project is licensed under the MIT License. Β© 2025 AmitxD
- Rust Community for excellent cryptographic libraries
- Next.js Team for the amazing React framework
Made with β€οΈ by AmitxD
β Star this repo β’ π Report Bug β’ β¨ Request Feature