- PGP Web Encrypt Client - (no JavaScript)- [PGP Web - PGP Web Encrypt Client - (with JavaScript) (TBD)
- CLI Tool
Note: This is a personal side project created to learn more about encryption, PGP, and implementing secure web applications that work without JavaScript. It's a work in progress and should be used for educational purposes.
A monorepo containing a PGP encryption CLI tool and web interface. Built with Node.js, TypeScript, and Vercel serverless functions.
This is a pnpm workspace monorepo with two packages:
@pgp/cli- Interactive CLI tool for PGP encryption/decryption with SQLite key management@pgp/api- Web interface + serverless API deployed to Vercel (works without JavaScript)
See MONOREPO.md for detailed documentation.
This project is actively being developed as a learning exercise. While functional, it may contain bugs or security considerations that need addressing. Use at your own discretion and avoid using it for highly sensitive production data.
- π PGP Encryption/Decryption - Secure message encryption using OpenPGP
- π Clipboard Integration - Seamlessly encrypt/decrypt from clipboard
- βοΈ Multiple Input Methods:
- Paste from clipboard
- Open in your preferred text editor
- Type inline directly in the terminal
- π¨ Beautiful CLI Interface - Colorful, intuitive prompts with emoji icons
- π₯οΈ Cross-Platform Support - Works on Linux, macOS, and Windows
- π οΈ Smart Editor Detection - Auto-detects available editors (VS Code, Vim, Nano, Notepad, etc.)
- π Graceful Exit Handling - Clean Ctrl+C interruption handling
- Node.js (v18 or higher recommended)
- pnpm (v10.19.0 or higher)
- PGP key pair (public and private keys)
- Clone the repository:
git clone https://github.com/yourusername/layerbase-pgp.git
cd layerbase-pgp- Run the installer:
./install.shThe installer will:
- Detect your operating system and shell
- Check for Node.js and install it if missing (using nvm)
- Check for pnpm and install it if missing
- Install all dependencies and compile native modules
- Build the project
- Create a
.envfile from the example - Optionally create an
lpgpcommand alias
- Configure your PGP keys:
Edit the .env file and add your PGP keys (see .env.example for format).
Important: Make sure there's a blank line after the BEGIN header in your PGP keys.
- Clone the repository:
git clone https://github.com/yourusername/layerbase-pgp.git
cd layerbase-pgp- Install dependencies:
pnpm installThis will install all Node.js dependencies including better-sqlite3, which requires native compilation. The installation process automatically:
- Compiles the SQLite native module for your platform
- Sets up the project dependencies
- Prepares the development environment
- Set up your environment variables:
Create a .env file in the root directory with your PGP keys:
cp .env.example .envThen edit .env and add your PGP keys.
Important: Make sure there's a blank line after the BEGIN header in your PGP keys.
- Build the project:
pnpm build- Database initialization:
The SQLite database is automatically created on first run. No manual setup required! When you first start the application, it will:
- Create the
db/directory - Initialize an empty SQLite database with all tables
- Set up default settings
Run the PGP tool:
pnpm pgpYou'll be greeted with an interactive menu:
ββββββββββββββββββββββββββββββββββββββββββ
β π PGP Encryption/Decryption Tool β
ββββββββββββββββββββββββββββββββββββββββββ
? What would you like to do?
π Encrypt a message
π Decrypt a message
π Exit
- Select "π Encrypt a message"
- Choose your input method:
- π Paste from clipboard - Automatically encrypts text from your clipboard
- π Use an editor - Opens your preferred text editor
- β¨οΈ Type inline - Enter text directly (press Enter, then Ctrl+D to finish)
- The encrypted message is displayed and automatically copied to your clipboard
- Select "π Decrypt a message"
- Choose your input method for the encrypted text
- The decrypted message is displayed and automatically copied to your clipboard
# Run the PGP tool
pnpm pgp
# Start the development server (placeholder)
pnpm serve
# Format code with Prettier
pnpm format
# Build the TypeScript project
pnpm build
# Run the built project
pnpm startlayerbase-pgp/
βββ src/
β βββ index.ts # Placeholder server
β βββ pgp-tool.ts # Main PGP CLI tool
β βββ db.ts # SQLite database layer
β βββ schema.sql # Database schema definition
βββ db/ # SQLite database (auto-created, not in git)
β βββ data.db # User data and PGP keys
βββ .env # Environment variables (not in git)
βββ package.json
βββ tsconfig.json
βββ TODO.md # Project roadmap
βββ README.md
See TODO.md for the complete project roadmap. Upcoming features include:
- β SQLite database integration (completed)
- Configuration file support (replacing .env)
- Web UI with Express backend
- Standalone landing page with progressive enhancement
- Real-time encryption with JavaScript enabled
- Server-side encryption fallback when JavaScript is disabled
- Learn how to build accessible, secure web apps that work without client-side JavaScript
- PGP key detection from system
- Key generation and management
- File encryption/decryption
- Multi-recipient support
As this is a learning project, please note:
- Store your
.envfile securely and never commit it to version control - The
.gitignorealready excludes.envfiles - Consider the security implications of storing private keys in environment variables
- For production use, consider more secure key storage methods (e.g., hardware tokens, key management systems)
- This tool has not undergone professional security audit
This is primarily a personal learning project, but suggestions and feedback are welcome! Feel free to:
- Open issues for bugs or feature requests
- Submit pull requests with improvements
- Share your experience using the tool
Source Available Educational License - NOT Open Source
This software is source-available for educational purposes, security auditing, and learning only. Commercial use and use by for-profit enterprises is prohibited without explicit permission. See the LICENSE file for full terms.
The source code is publicly available to promote transparency, enable security audits, and support learning about encryption and web development - but this does not make it open source software.
- Built with OpenPGP.js for encryption
- Inquirer.js for beautiful CLI prompts
- Chalk for terminal styling
- Clipboardy for clipboard operations
Learning Focus: This project explores:
- PGP encryption and cryptography fundamentals
- Node.js CLI development with TypeScript
- Security best practices for handling sensitive data
- Progressive enhancement and building web applications that work without JavaScript
- Server-side vs. client-side encryption trade-offs
- Accessible web design principles
It's a work in progress and will continue to evolve as I learn more about encryption, secure communication, and building resilient web applications.