gnupg
securitygnupg
# Generate a password
gpg --armor --gen-random 1 20

gpg --list-secret-keys

# export private key to an encrypted file
gpg --armor --export-secret-keys [KEYID|mail-address]  | gpg --armor --symmetric --output encrypted-key.sec.asc

Pinentry

~/.gnupg/gpg-agent.conf

default-cache-ttl 300
max-cache-ttl 999999
enable-ssh-support
pinentry-program /usr/bin/pinentry-curses
# pinentry-program /usr/bin/pinentry-gnome3
disable-scdaemon

Followed by:

gpgconf --reload
# or
systemctl --user restart gpg-agent
top