Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (2024)

Transmitting encrypted data with GPG (GNU Privacy Guard) on the Mac platform requires four basic steps. First you install GPG; GPG Tools is an easy to use frontend application for GPG on Mac. It provides a simple interface for managing keys and shell integration for quickly encrypting and decrypting files. GPG relies on public key cryptography, so the next step is to generate your public and private key pair used for the actual encryption and decryption process. Third you must exchange and sign public keys with the people that you wish to exchange secure data with. After that initial setup, encrypting files for secure transmission is very easy.

Install GPG Tools

  1. Download GPG Tools and install. The install procedure is a standard Mac pkg install.

Key Generation

The encryption process requires a pair of keys, one public and one private. Data that is encrypted using the public key can only be decrypted using the private key. Your public key can be made public so that others can use it to encrypt data to send to you. Your private key should never be shared and should always be kept secure. When others send data to you that is encrypted with your public key, only you, the owner of the matching private key can decrypt that data.

  1. After starting the GPG Keychain Access app for the first time you need to create a public and private key pair for encrypting and decrypting data. Select “New” to begin the key generation process.
  2. Enter your name and email address in the pop up window that appears. You will also create a passphrase here to protect your private/secret key. You will need this passphrase any time you need access to your keys for encrypting and decrypting. Click “Generate key” after entering your information and your key pair will be created after a short time. Your keys will then be listed in the GPG Keychain Access main window.Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (1)Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (2)

Key Exchange

In order to share encrypted data with another person you need to exchange public keys. You need their public key in order to encrypt data that only they can decrypt. Likewise, they need your public key to send encrypted data to you.

  1. To export your public key, select your key in GPG Keychain Access and then click Export in the menu. Do not select “Allow secret key export”; your secret key should never be given to anybody. Click save to export your public key as an asc file.Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (3)
  2. You can now send that public key to anybody that you will be sending you encrypted data. The other party will encrypt the data with your public key and your private key will be the only way to decrypt it.
  3. The other party should send you their public key, so that you can encrypt data to send to them. After you receive a public key from somebody, you can import into your keychain. Select Import from the menu in GPG Keychain Access and select the public key that was sent to you.
  4. After importing a public key, you should verify that the key actually belongs to the person that you believe it belongs to. If you are certain that the key is valid, you should sign the key to signify that it should be trusted. To sign a key, right-click it and select “Sign…”. You will need to enter your passphrase to unlock your secret key in order to sign a key.Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (4)

Encrypt & Decrypt

  1. To encrypt a file, right-click it, navigate to the “Services” sub-menu and click “OpenPGP: Encrypt File”.Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (5)
  2. You will now see a dialog for selecting encryption options. Check the recipient that you wish to send the file to. The file will be encrypted with their public key, and therefore can only be decrypted with their private key. Check the “Sign” checkbox to sign the encrypted file with your private key to allow the recipient to verify that this file was definitely encrypted by you. Click “OK” to encrypt the file; you will need to enter your passphrase to unlock your secret key. A file with the gpg file extension will be created in the same directory as your original file.Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (6)
  3. To decrypt a file that has been sent to you, right-click the file and select “OpenPGP: Decrypt File” from the “Services” menu.Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (7)
Adopting Safer Habits: Using GPG Tools to Encrypt Files | Information Technology | Allegheny College (2024)

FAQs

How to encrypt a file using GPG? ›

Create an encryption key
  1. Make sure gpg-agent is running; on the command line, enter: gpg-agent -s --daemon --write-env-file --use-standard-socket. ...
  2. On the command line, enter: gpg --gen-key.
  3. You will see something like the following (in which username is your IU username and Machine is the name of the system):
Feb 9, 2024

How safe is GPG encryption? ›

After you confirm the password and save, the file will be encrypted as a new . gpg file. By default GPG will encrypt the file using the AES256 spec, which is very secure. However, since this is symmetric encryption that means the same password encrypts and decrypts the file.

How to use GPG tools? ›

Encrypt & Decrypt
  1. To encrypt a file, right-click it, navigate to the “Services” sub-menu and click “OpenPGP: Encrypt File”.
  2. You will now see a dialog for selecting encryption options. ...
  3. To decrypt a file that has been sent to you, right-click the file and select “OpenPGP: Decrypt File” from the “Services” menu.

What is the best way to encrypt files on my computer? ›

How to encrypt files with Windows
  1. Right-click or press and hold the file or folder you want to encrypt. Select Properties.
  2. Click the Advanced… button and check the box next to Encrypt contents to secure data.
  3. Select OK to close the Advanced Attributes window and then select Apply.
  4. Click OK.
Mar 15, 2023

What is GPG encryption used for? ›

The system is widely trusted for securing integrity and confidentiality of internet communications through various cryptographic methods. GPG is used in Debian and Redhat to verify downloads from package managers (apt, yum) and people like Edward Snowden and Glenn Greenwald use it to encrypt confidential emails.

What does GPG stand for? ›

The grain per gallon (gpg) is a unit of water hardness defined as 1 grain (64.8 milligrams) of calcium carbonate dissolved in 1 US gallon of water (3.785412 L). It translates into 1 part in about 58,000 parts of water or 17.1 parts per million (ppm). Also called Clark degree (in terms of an imperial gallon).

What is the safest encryption method? ›

The Advanced Encryption System (AES) is the current encryption standard for most government and private sector IT security purposes.

How do I keep my GPG key safe? ›

Regardless of how you use GnuPG you should store the public key's revocation certificate and a backup of your private key on write-protected media in a safe place. For example, you could burn them on a CD-ROM and store them in your safe deposit box at the bank in a sealed envelope.

How do GPG encryption and decryption work? ›

In Asymmetric encryption, there is a pair of keys, one public and one private. The owner can share the public key with anyone whosoever wants to send the files in an encrypted format. That encrypted file is then sent back to the owner and that can only be decrypted by the corresponding private key.

Is GPG still used? ›

GPG is in use today by journalists, business leaders, universities, and others who wish to keep the transmission of messages and data secure. The primary issues with GPG continue to be user acceptance, key handling, and the lack of understanding surrounding the complexity of key creation and exchange.

How to encrypt file using GPG public key? ›

Encrypting Files Using GPG in Linux

To encrypt a plain text file using the just created GPG key pair, run the following command. The -e or --encrypt flag enables encryption and the -r or --recipient flag is used to specify the recipient ID and secret. txt is the plain text file to be encrypted.

How do I find my GPG key? ›

Open Terminal . Use the gpg --list-secret-keys --keyid-format=long command to list the long form of the GPG keys for which you have both a public and private key. A private key is required for signing commits or tags.

Can encrypted files be hacked? ›

Hackers can break encryption to access the data using a number of different methods. The most common method is stealing the encryption key itself. Another common way is intercepting the data either before it has been encrypted by the sender or after it has been decrypted by the recipient.

Why should you encrypt files? ›

The best way to keep important data and information safe from hackers is to ensure all important files are encrypted. File encryption is a way of concealing data with code that only specific recipients can decipher. This prevents unauthorized users from being able to view, understand, and access sensitive information.

How do I encrypt a file in Linux GPG? ›

gpg Linux Command Guide: Securing and Encrypting Data
  1. gpg -c file.txt # Output: # [You will be prompted to enter a passphrase for encryption] ...
  2. gpg -c mydata.txt # Output: # [You will be prompted to enter a passphrase for encryption] ...
  3. gpg mydata.txt.gpg # Output: # [You will be prompted to enter the passphrase]
Dec 12, 2023

How to encrypt a file with a GPG public key? ›

Encryption/decryption commands
  1. To encrypt a plaintext file with the recipient's public key: gpg -e -r recipient_userid textfile.
  2. To sign a plaintext file with your secret key: gpg -s textfile.
Jul 12, 2023

How do I encrypt a specific file? ›

Right-click (or press and hold) a file or folder and select Properties. Select the Advanced button and select the Encrypt contents to secure data check box.

How to use GPG to encrypt a file in Windows? ›

To do this, you open the Windows Command Prompt (Go Start-->All Programs-->Accessories-->Command Prompt) and type in "gpg --gen-key" at the command line. Pick the encryption method and run through the other options. For personal encryption, the defaults are a safe bet.

Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6240

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.