Skip to content
/ xlok Public

Cross-platform PDF encryption tool with batch processing, multiple password modes (manual, CSV, auto-generate), customizable security permissions, and modern glassmorphic UI. Built with Wails, Go, and React.

License

Notifications You must be signed in to change notification settings

xdotech/xlok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

XLok - Secure PDF Encryption

Lock PDFs. Control Access.

XLok is a powerful, user-friendly desktop application for encrypting PDF files with military-grade AES-256 encryption. Built with Wails (Go + React), XLok provides a beautiful, native experience for Mac and Windows users who need to secure their PDF documents.

✨ Features

πŸ” Powerful Encryption

  • AES-256 encryption (military-grade security)
  • Compliant with PDF 2.0 specifications (ISO 32000-2:2020)
  • Set both user password (to open) and owner password (for permissions)
  • Configure granular permissions: print, copy, edit

⚑ Batch Processing

  • Process up to 50 PDFs simultaneously
  • 5 concurrent workers for optimal performance
  • Real-time progress tracking
  • Automatic error handling and retry logic

🎯 Three Password Modes

1. Auto-Generate

  • Cryptographically secure passwords (16-32 characters)
  • Guaranteed character diversity (uppercase, lowercase, digits, symbols)
  • 80+ bits entropy (NIST recommended)
  • Perfect for maximum security

2. Manual Password

  • Use the same password for all PDFs
  • Great for sharing documents with recipients
  • Built-in strength indicator

3. CSV/TXT Upload

  • Upload filename-password mappings
  • Automatic fuzzy matching (handles typos)
  • Supports both CSV and TXT formats
  • Format: filename,password or filename:password

🎨 Beautiful UI

  • Glassmorphism design with backdrop blur
  • Dark/Light mode with system preference detection
  • Smooth animations and micro-interactions
  • Drag & drop file upload
  • Real-time status tracking

⌨️ Keyboard Shortcuts

  • ⌘/Ctrl + Enter: Start encryption
  • ⌘/Ctrl + Backspace: Clear all files
  • ⌘/Ctrl + D: Toggle dark mode
  • ?: Show help

β™Ώ Accessibility First

  • Full ARIA label support
  • Keyboard navigation
  • Screen reader compatible
  • Focus management

πŸ“Έ Screenshots

Main Interface

XLok Main Interface Beautiful glassmorphic UI with drag & drop file upload and real-time progress tracking

Password Results & Export

Password Results Auto-generated passwords with one-click copy and CSV export functionality

πŸš€ Quick Start

Installation

macOS

  1. Download XLok.dmg from Releases
  2. Open the DMG file
  3. Drag XLok to Applications folder
  4. Launch XLok from Applications

Windows

  1. Download XLok-Setup.exe from Releases
  2. Run the installer
  3. Follow the installation wizard
  4. Launch XLok from Start Menu

Usage

  1. Upload PDFs: Drag and drop PDF files or click to browse
  2. Choose Password Mode:
    • Auto: Let XLok generate secure passwords
    • Manual: Enter your own password
    • CSV/TXT: Upload a file with password mappings
  3. Configure Security: Set permissions (print, copy, edit)
  4. Select Output Directory: Choose where to save encrypted PDFs
  5. Encrypt: Click "Encrypt PDFs" or press ⌘+Enter

πŸ”’ Security

  • AES-256 encryption - The same standard used by governments and military organizations
  • Cryptographically secure random number generation (crypto/rand)
  • No telemetry - Your files never leave your computer
  • Open source - Fully auditable code
  • Privacy first - No passwords stored or logged

πŸ› οΈ Tech Stack

Backend (Go)

  • Wails v2.9.2 - Cross-platform desktop framework
  • pdfcpu v0.11.1 - Pure Go PDF processing
  • crypto/rand - Cryptographically secure RNG

Frontend (React)

  • React 19 - Modern UI framework
  • TypeScript - Type safety
  • Tailwind CSS v3 - Utility-first CSS
  • Zustand - Lightweight state management (3KB)
  • react-dropzone - File upload UX

πŸ“¦ Building from Source

Prerequisites

  • Go 1.21+
  • Node.js 18+
  • npm 9+
  • Wails CLI: go install github.com/wailsapp/wails/v2/cmd/wails@latest

Build Steps

# Clone the repository
git clone https://github.com/yourusername/xlok.git
cd xlok

# Install dependencies
cd frontend && npm install && cd ..

# Build for your platform
wails build

# Or build manually
cd frontend && npm run build && cd ..
go build -ldflags="-s -w" -o xlok

Development Mode

# Run in development mode
wails dev

# Or run frontend and backend separately
cd frontend && npm run dev  # Terminal 1
go run main.go              # Terminal 2

πŸ“‚ Project Structure

xlok/
β”œβ”€β”€ app.go                      # Wails app entry point
β”œβ”€β”€ main.go                     # Go main entry
β”œβ”€β”€ wails.json                  # Wails configuration
β”œβ”€β”€ appicon.svg                 # Application icon
β”œβ”€β”€ LICENSE                     # MIT License
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ pdf/                    # PDF encryption engine
β”‚   β”‚   β”œβ”€β”€ types.go           # Core data structures
β”‚   β”‚   β”œβ”€β”€ encryptor.go       # AES-256 encryption
β”‚   β”‚   └── validator.go       # PDF validation
β”‚   β”œβ”€β”€ password/               # Password generation & validation
β”‚   β”‚   β”œβ”€β”€ generator.go       # Cryptographic password gen
β”‚   β”‚   └── validator.go       # Strength analysis
β”‚   β”œβ”€β”€ batch/                  # Batch processing
β”‚   β”‚   β”œβ”€β”€ processor.go       # Concurrent job executor
β”‚   β”‚   β”œβ”€β”€ csv_parser.go      # CSV password mapping
β”‚   β”‚   β”œβ”€β”€ txt_parser.go      # TXT password mapping
β”‚   β”‚   β”œβ”€β”€ matcher.go         # Fuzzy filename matching
β”‚   β”‚   └── progress.go        # Thread-safe progress tracking
β”‚   β”œβ”€β”€ utils/                  # Utilities
β”‚   β”‚   └── filename.go        # Conflict resolution
β”‚   └── errors/                 # Error handling
β”‚       └── errors.go          # Custom error types
└── frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/         # React components
    β”‚   β”‚   β”œβ”€β”€ branding/      # Logo
    β”‚   β”‚   β”œβ”€β”€ file-list/     # File management
    β”‚   β”‚   β”œβ”€β”€ layout/        # Layout components
    β”‚   β”‚   β”œβ”€β”€ settings/      # Settings panel
    β”‚   β”‚   └── ui/            # UI components (toast, modal, etc.)
    β”‚   β”œβ”€β”€ stores/            # Zustand state stores
    β”‚   β”œβ”€β”€ hooks/             # Custom React hooks
    β”‚   β”œβ”€β”€ styles/            # Global CSS + animations
    β”‚   └── lib/               # Wails API wrapper
    └── package.json

πŸ§ͺ Testing

# Run frontend tests
cd frontend && npm test

# Run backend tests
go test ./...

# Test production build
./xlok  # Mac/Linux
xlok.exe  # Windows

πŸ“ License

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

πŸ‘€ Author

XLabsX

πŸ™ Acknowledgments

  • pdfcpu - Excellent pure Go PDF library
  • Wails - Amazing cross-platform desktop framework
  • React - Powerful UI framework
  • Tailwind CSS - Beautiful utility-first CSS

πŸ› Bug Reports & Feature Requests

Please file issues on the GitHub Issues page.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“Š Project Statistics

  • Total Lines of Code: ~5,000+
  • Backend (Go): ~2,500 lines
  • Frontend (React/TypeScript): ~2,500 lines
  • Bundle Size: 73.42 KB (gzipped JS)
  • Binary Size: 6.8 MB (Mac ARM64)
  • Supported PDFs: Up to 50 files, 10MB each
  • Encryption: AES-256 (military-grade)
  • Performance: 5 concurrent PDF processors
  • Development Time: Completed in 8 phases

πŸ—οΈ Architecture Highlights

Backend Architecture

  • Modular design with clear separation of concerns
  • Goroutine pool pattern for efficient concurrency
  • Thread-safe progress tracking with sync.RWMutex
  • Automatic conflict resolution for output files
  • Fuzzy matching using Levenshtein distance algorithm
  • Cryptographically secure password generation

Frontend Architecture

  • Component-based architecture with React functional components
  • Zustand state management for minimal re-renders
  • Custom hooks for reusable logic (keyboard shortcuts, theme)
  • Error boundaries for graceful error handling
  • Toast notifications for user feedback
  • Glassmorphism UI with backdrop blur effects
  • Fully accessible with ARIA labels and keyboard navigation

Integration

  • Event-driven communication via Wails runtime
  • Real-time progress updates from Go backend to React frontend
  • Mock implementations for development mode
  • Type-safe API wrapper for frontend-backend communication

XLok - Lock PDFs. Control Access. πŸ”

Made with ❀️ using Wails, Go, and React

Copyright Β© 2025 XLabsX. All rights reserved.

About

Cross-platform PDF encryption tool with batch processing, multiple password modes (manual, CSV, auto-generate), customizable security permissions, and modern glassmorphic UI. Built with Wails, Go, and React.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published