2.6 KiB
acme-crypt
Go wrapper programs for Acme that interface with encryption/decryption tools to automatically handle encrypted files. Currently only supports GPG, though designed with a pluggable interface for future encryption backends.
Overview
This package provides two commands:
CryptGet- Decrypts an encrypted file and opens it in a new Acme windowCryptPut- Encrypts the contents of an Acme window and saves to disk
Installation
-
Clone the repository:
git clone git@github.com:lneely/acme-crypt.git cd acme-crypt -
Install the binaries:
mk install
This installs CryptGet and CryptPut to $HOME/bin/.
Configuration
Set your GPG recipient in the environment:
export ACME_CRYPT_RCPT="your@email.com"
Ensure your GPG agent is configured with a GUI pinentry program (e.g., pinentry-qt, pinentry-gtk3) since Acme runs in a non-interactive environment.
Usage
Decrypting Files (CryptGet)
- In Acme, highlight an encrypted file (
.gpg,.asc, or.pgp) - Add
CryptGetto the window tag - Highlight the encrypted filename, hold the middle button then left click on CryptGet to decrypt and open the file.
- A new window opens with the decrypted content, named after the original file without the encryption extension
- The new window automatically has
CryptPutadded to its tag.
Encrypting Files (CryptPut)
- Edit the decrypted file content in the Acme window created by CryptGet
- Middle-click on
CryptPutin the window tag - The content is encrypted and saved back to the original encrypted file path
Workflow Example
1. File: sensitive-data.txt.gpg
2. Highlight "sensitive-data.txt.gpg" in Acme
3. Middle-click CryptGet → Opens window "sensitive-data.txt" with decrypted content
4. Edit the content as needed
5. Middle-click CryptPut → Saves encrypted content back to sensitive-data.txt.gpg
Supported File Extensions
CryptGet automatically strips these extensions when creating the editing window:
.gpg.asc.pgp
Architecture
The program uses a pluggable interface design in internal/crypt/:
Crypterinterface for encryption/decryption operationsGPGCrypterimplementation for GPG backend- Acme integration utilities for window management
This design allows for easy addition of other encryption tools (OpenSSL, age, etc.) in the future, though currently only GPG is implemented.
Requirements
- Go 1.19+
- Acme text editor
- GPG with configured keys
- GUI pinentry program (pinentry-qt, pinentry-gtk3, etc.)
License
GNU General Public License v3