+---
+tags:
+ - linux
+ - unix
+ - utils
+ - security
+ - encryption
+ - gpg
+---
+
+# GnuPG
+
+[GnuPG](https://www.gnupg.org/) or The GNU Privacy Guard is a complete and free implementation of the
+OpenPGP standart as defined by [RFC4880](https://www.ietf.org/rfc/rfc4880.txt). GnuPG allow you to
+encrypt and sign you data and communications. It features versatile key management system, along with
+access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line
+tool with features for easy integration with other applications.
+
+## Keys management
+
+### Listing keys
+```bash
+gpg --list-secret-keys
+```
+
+## Encryption
+
+### Encrypt a file
+```bash title=""
+gpg -o <file_name>.gpg --encrypt --recipient <key_email> <file_name>
+```
+
+### Encrypt a folder
+```bash title="Archive the directory"
+tar -cvf <archive_name>.tar.gz <directory_name>
+```
+
+```bash title="Encrypt the archive"
+gpg -o <encrypted_file_name>.gpg --encrypt --recipient <key_email> <archive_name>.tar.gz
+```
+
+## Decryption
+
+### Decrypt a file
+```bash title="Decrypt a file"
+gpg -o <file_name> --decrypt <file_name>.gpg
+```
+
+### Decrypt a folder
+```bash title="Decrypt gpg file into the archive"
+gpg -o <archive_name>.tar.gz --decrypt <file_name>.gpg
+```
+
+```bash title="Extract files from the archive"
+tar -xvf <archive_name>.tar.gz -C <output_dir_name>
+```
+