Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Uncategorized»File Encryption using GPG Command Line in Linux

    File Encryption using GPG Command Line in Linux

    RahulBy RahulApril 10, 20132 Mins Read

    AS we know, now a days it’s not safe to send and receive data over internet. There are many option available to secure your data while traveling over internet. GnuPG also provides you to encrypt your data on key basis and transfer them securely over internet. GPG is an encryption and signing tool for UNIX/LINUX like OS. GnuPG provides many methods for file encryption and decryption. click here to read more about GnuPG.

    This article will help you about File Encryption using GPG key on linux system.

    Step 1: Create Test File

    Firstly create a test file to encrypt. you may skip this step if you want to encrypt existing file.

    # echo "Enter file content here" > secureit.txt
    

    Step 2: Encrypt File using GPG

    Let use following command to encrypt above created file using gpg.

    # gpg -c secureit.txt
    

    Above command will create a encrypted file named secureit.txt.gpg. Original file will remain same.

    # ls -l
    
    -rw-r--r-- 1 root root 24 Mar  9 21:36 secureit.txt
    -rw-r--r-- 1 root root 74 Mar  9 21:36 secureit.txt.gpg
    

    Step 3: Decrypt File

    Now its also required to decrypt encrypted. Use following command to decrypt file again.

    # gpg -o secureit-new.txt -d secureit.txt.gpg
    gpg: CAST5 encrypted data
    Enter passphrase:
    

    You will get a new decrypted file named secureit-new.txt.

    # ls -l secureit-new.txt
    
    -rw-r--r-- 1 root root 24 Mar  9 21:56 secureit-new.txt
    

    Thank You for reading this article. Read our next article to Encrypt File using GPG key pair.

    encrypt file using gpg File Encryption using GPG GPG gpg encryption How to use GnuPG How to use GPG Secure file using GPG
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleInstalling PostgreSQL 9.1 on CentOS 5/6 and RHEL 5/6
    Next Article How to use zip command in Linux

    Related Posts

    How to Solve an Expired Key (EXPKEYSIG) with Apt

    Updated:March 1, 20191 Min Read

    Most Effective Industry Specific Plug-ins for WordPress

    Updated:August 15, 20163 Mins Read

    How to Install Komodo Edit on Ubuntu 14.10, 14.04 LTS and 12.04 LTS via PPA

    1 Min Read

    Setup Database Mirroring in SQL Server 2012 with Certificates

    3 Mins Read

    How to Install XCache for PHP on CentOS,RHEL and Fedora

    2 Mins Read

    Setup Varnish on CentOS/RHEL 5/6 with Apache

    2 Mins Read

    1 Comment

    1. karen millen dresses outlet on March 13, 2013 8:24 am

      Interesting articles on information like this is a great find. It

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    • How to Install Angular CLI on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.