This guide will teach you how to handle encrypted messages using asymmetric encryption. If you want to learn more about encryption, read our guide on the basics of encryption. Show
This guide is part of a series about improving online privacy:
1. Install GnuPGFirst, you need to install GnuPG on your operating system. GnuPG, or GPG as it's often called, is a free software program based upon the PGP encryption standard that allows users to encrypt and sign data, and even to manage keys.
2. Create your own asymmetric keyOpen a terminal window to create your asymmetric key pair by running the command:
On some versions of GnuPG, you will first need to answer a few questions:
Continue by answering some general information like your name and email address. If you are creating a key to be used when sending email, then it makes sense to use the information that corresponds with that email account. After you've supplied this information, you will need to enter a password to protect where your private key is stored on your computer. The program will then spend up to one minute generating a random key for you, but usually it will take only a few seconds. 3. Share your public keyIn order to allow people to send encrypted information to you, you need to first share your public key with them. To do this, you need to export the key as a file. Run the following command in your terminal, replacing the email address with the one you entered when you created the key and "sarah" with your own choice of filename.
A file will be created on your computer and placed in the folder that you are currently located in within the terminal. If you open the file in a text editor, this is what you will see: -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2 mQENBFjPvdIBCACpWkWtev2RZnrYfm6vP9C/dt9cMvlwn2Wk2b45FKSOo5y14WOR kH6L36h7dNnwvWsSupPMLcuAS6LrUcR3w5staihu0EPDWkEnwuxF0Ljk6UTMjlme MD+s2wCBN6P9w1R0emWkAFjFD+9MeCAJzRPZP0xuXkroKOPboAvCNx3BYAkHHzBJ . . . OGmJsDSCsSfgp/QtkDK3qKuMLFSO8MwYs4cI7ArTsDU6pNyEjoZmDdYhNZwYdGdh 2l6op4q2FIle1hXMMHohNckgIAjO3pExKbsa =C4dt -----END PGP PUBLIC KEY BLOCK-----You can now send this file to your contacts. 3. Import someone else's public keyAfter someone sends you their public key, you can import it to your computer by running this command (replace "john.asc" with the name of the file you received).
4. View your list of keysThis command returns a list of contacts whose public keys you have imported, as well as any keys that you have created for yourself:
This command returns your own private keys:
5. Verify keys with fingerprintsYou will want to make sure that the public keys you have belong to the people you think they do. Checking the validity of your public keys can be tricky. The easiest way is to import the key in question and then verify it by talking to its owner face-to-face or by phone. Of course, reading aloud the many lines of random characters that a key is composed of would take a lot of time and leave room for making errors. Instead, you can verify the fingerprint which is a much shorter representation of a public key. This command returns a list of fingerprints for all public keys that you have imported:
6. Encrypt a messageCreate a text file with your preferred text editor and save it. Back in the terminal, navigate to where you saved the file. Run the following command, replacing "" with that of your recipient and "message.txt" with the name of the file you created.
All you have to do now is send an email to the recipient and attach the encrypted file to it. 7. Decrypt a message from a friendOnce you have received an encrypted message, save it to your computer. In the terminal, navigate to where you saved the file. Run the following command, replacing "message.txt.asc" with the name of the encrypted file you received and "message.txt" with a filename ending in .txt that you want the decrypted file to be called.
Since your private key will be used to decrypt the message and because your private key is password protected, you will be prompted to enter the password. Send an encrypted message to Mullvad
What types of asymmetric encryption can be used?Standard asymmetric encryption algorithms include RSA, Diffie-Hellman, ECC, El Gamal, and DSA.
What is asymmetric encryption in cryptography?As the name implies, asymmetric encryption is different on each side; the sender and the recipient use two different keys. Asymmetric encryption, also known as public key encryption, uses a public key-private key pairing: data encrypted with the public key can only be decrypted with the private key.
How is asymmetric cryptography used in message authentication?Asymmetric encryption also allows for digital signature authentication, unlike symmetric encryption. Basically, this involves using private keys to digitally sign messages or files, and their corresponding public keys are used to confirm that these messages originated from the correct, verified sender.
What is the most popular asymmetric encryption technique used today?RSA (Rivest Shamir Adleman) — RSA is considered one of the most secure (and commonly used) asymmetric key encryption algorithms. It's virtually uncrackable using modern computers. RSA uses two unique, large prime numbers in elaborate algebra to generate its public-private key pairs.
|