https://github.com/suptarr/go-pgp
Go utilities for performing PGP encryption and decryption
https://github.com/suptarr/go-pgp
golang pgp
Last synced: about 1 year ago
JSON representation
Go utilities for performing PGP encryption and decryption
- Host: GitHub
- URL: https://github.com/suptarr/go-pgp
- Owner: SupTarr
- Created: 2025-05-10T02:51:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-10T03:28:54.000Z (about 1 year ago)
- Last Synced: 2025-05-13T00:55:39.140Z (about 1 year ago)
- Topics: golang, pgp
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go PGP Utility
This project provides a set of Go utilities for performing PGP encryption and decryption, as well as some file manipulation tasks like writing to TXT, CSV, and creating ZIP archives.
## Features
* **PGP Encryption**: Encrypt files using a public PGP key.
* **PGP Decryption**:
* Decrypt files using a private PGP key and a passphrase.
* Decrypt files using a private PGP key from a keyring (without a passphrase if the key is not encrypted).
* **File Utilities**:
* Write content to text files.
* Write data to CSV files.
* Create ZIP archives from a list of files.
## Prerequisites
* Go (version 1.18 or later recommended)
* PGP keys (public and private) for testing encryption and decryption.
## Dependencies
* [github.com/ProtonMail/gopenpgp/v3](https://github.com/ProtonMail/gopenpgp)
```bash
go mod tidy
# or
go get github.com/ProtonMail/gopenpgp/v3/crypto
```
## Setup
1. **Clone the repository (if applicable) or ensure you have the project files.**
2. **Place your PGP keys**:
* For encryption: `public.pgp` (or update the path in `main.go`)
* For decryption with passphrase: `private.pgp` (or update the path in `main.go`)
* For decryption with keyring: `secret.asc` (or update the path in `main.go`)
3. **Prepare input files**:
* Create a file `decrypted/test.txt` with content to be encrypted.
* Place an encrypted file at `encrypted/test.txt.zip.pgp` for decryption with passphrase.
* Place an encrypted file at `encrypted/test.csv.gpg` for decryption with keyring.
* Ensure the output directories (e.g., `decrypted/`, `encrypted/`) exist or create them.