This article describes the process of encrypting and decrypting files with GnuPG (GPG) using asymmetric cryptography (public key and private key).
This is specially useful when you want to make sure (ideally) that only the intended receiver can see the message, needless to say that you are able to sign any messages as well.
dnf install gnupg
gpg --encrypt --output myFileName.ext.gpg --recipient email@example.com myFileName.ext
tar cvz ./ | gpg --encrypt --output all.tgz.gpg --recipient firstname.lastname@example.org
gpg --decrypt --output myFileName.ext myFileName.ext.gpg
gpg --decrypt all.tgz.gpg | tar xzv
Input files will not be deleted after encryption / decryption when using this methods, you need to do that manually.
More information: https://gnupg.org/documentation/manpage.html