Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Uncategorized»File Encryption using GPG Command Line in Linux

    File Encryption using GPG Command Line in Linux

    By 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.

    Advertisement

    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

    Related Posts

    Understanding the difference between ‘git pull’ and ‘git fetch’

    How to Solve an Expired Key (EXPKEYSIG) with Apt

    Most Effective Industry Specific Plug-ins for WordPress

    View 1 Comment

    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

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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