GNU-101
GPG (GNU Privacy Guard), also known as GnuPG, is an open-source and free software implementation of the OpenPGP (Pretty Good Privacy) standard. OpenPGP is a cryptographic standard used for encrypting and digitally signing messages and files with the goal of providing privacy and authentication in communications.
The main functions of GPG are as follows:
- Encryption: It allows encrypting messages and files to protect their content and ensure that only authorized individuals can read them. This is achieved using public and private keys. The public key is shared with others so they can encrypt messages directed to you, while the private key is kept secret and used to decrypt messages encrypted with your public key.
- Digital Signature: GPG also enables digitally signing messages and files to ensure the authenticity and integrity of the content. By signing a file with your private key, others can verify the signature using your public key and be confident that the file has not been altered and indeed comes from you.
- Authentication: By using public and private keys, GPG allows verifying the identity of message senders and receivers. Authentication is essential to ensure that you are communicating with the right person and not an impostor.
GPG uses a combination of public key cryptography and symmetric key cryptography to secure data. When a user wants to send encrypted data, they use the public key of the recipient to encrypt the data. The recipient can then use their private key to decrypt the data. This ensures that only the intended recipient can decrypt the data, even if it is intercepted by an attacker.
GPG is widely used to secure electronic communication and to protect the privacy of users. It is particularly useful for protecting sensitive data such as passwords and financial information. It is also used to verify the authenticity and integrity of software packages, documents, and other electronic data.
1. Generate GPG Keypair
Use de following instruction to generate a new GPG key pair, which consists of a public key and a corresponding private key. The key pair is used for encryption, digital signatures, and authentication in GPG/OpenPGP communications.
gpg --full-gen-key
GPG will take you through the following guided steps.
- Select what kind of key you want.
- Select the keysize do you want (i.e.: 4096).
- Specify how long the key should be valid (i.e.: 3M).
- Confirm the expiration day.
- Write your Real name.
- Write your Email address.
- Write a Comment (i.e.: Personal GPG Keypair).
- Accept settings.
- White a passphrase (password) to protect the GPG Keypair.
2. Show the GPG Keypairs
Use the following command to show the GPG Keypairs list.
gpg --list-keys
For more information, please refer to: