Skip to content

Instantly share code, notes, and snippets.

View ismailzakky's full-sized avatar
🎯
Focusing

Ismail Zakky ismailzakky

🎯
Focusing
View GitHub Profile
@ayubmalik
ayubmalik / gpg-encrypt.go
Last active July 23, 2024 19:09
Golang encrypt file using GPG openpgp. Use standard go libs.
package main
/**
Example hack to encrypt a file using a GPG encryption key. Works with GPG v2.x.
The encrypted file e.g. /tmp/data.txt.gpg can then be decrypted using the standard command
gpg /tmp/data.txt.gpg
Assumes you have **created** an encryption key and exported armored version.
You have to read the armored key directly as Go cannot read pubring.kbx (yet).