Pgp /


Install GnuPG:

$ doas pkg_add -v gnupg
quirks-4.54 signed on 2022-01-09T19:08:35Z
gnupg-2.2.30p0:npth-1.6: ok
gnupg-2.2.30p0:libassuan-2.5.5: ok
gnupg-2.2.30p0:libtasn1-4.17.0: ok
gnupg-2.2.30p0:p11-kit-0.24.0: ok
gnupg-2.2.30p0:libunistring-0.9.7: ok
gnupg-2.2.30p0:libidn2-2.3.0p0: ok
gnupg-2.2.30p0:libunbound-1.13.2: ok
gnupg-2.2.30p0:gmp-6.2.1p0: ok
gnupg-2.2.30p0:libnettle-3.7.3: ok
gnupg-2.2.30p0:gnutls-3.7.2: ok
gnupg-2.2.30p0:libksba-1.6.0: ok
gnupg-2.2.30p0:libsecret-0.20.4: ok
gnupg-2.2.30p0:pinentry-1.1.1: ok
gnupg-2.2.30p0:libusb1-1.0.23p2: ok
gnupg-2.2.30p0: ok

Create new key:

$ gpg --generate-key
$ gpg --full-gen-key (with dialog)

Export your private key (need be safety saved):

$ gpg --export-secret-keys -a "" > privat.key

List signatures:

$ gpg --list-signatures

Send key to keyserver:

$ gpg --keyserver --send-keys DD88244CA9988FAB

Search keys on the server:

$ gpg --keyserver --search-keys ""

Receive key:

$ gpg --keyserver --recv-keys DD88244CA9988FAB

Sign your file:

$ gpg --detach-sign photo.png

Verify your file:

$ gpg --verify photo.png.sig

Crypt your file:

$ gpg --encrypt --armor -o letter.asc letter.txt

Decrypt your file:

$ gpg --decrypt -o letter_incom.txt letter_incom.asc