Symantec Developer Group

 View Only
  • 1.  How to decrypt .gpg file using script

    Posted Jun 04, 2017 01:27 PM

    Dear Support Team,

     

    How to decrypt a .gpg file using script or command line based? 

    I am looking for a script to automate the task of decrypting the file on daily basis.

    Thanks in advance.

     

    Best Regards

    VL.Ganesh



  • 2.  RE: How to decrypt .gpg file using script

    Posted Jun 22, 2017 10:00 AM

    From the command line

    Let's say you have a file, ~/Documents/important.docx, that you want to password protect. Using gpg, you would do the following.

    1. Open a terminal window.
    2. Change to the ~/Documents directory with the command cd ~/Documents.
    3. Encrypt the file with the command gpg -c important.docx.
    4. Enter a unique password for the file and hit Enter.
    5. Verify the newly typed password by typing it again and hitting Enter.

    You should now see the file important.docx.gpg in the ~/Documents folder. To decrypt that file, do the following.

    1. Open a terminal window.
    2. Change to the ~/Documents directory with the command cd ~/Documents.
    3. Decrypt the file with the command gpg important.dox.gpg.
    4. When prompted, enter the decryption password you created when encrypting the file.

    You could send that file to a recipient and, as long as they have gpg installed, they can decrypt the file with the password you used for encryption. If they are a Windows user, they can always install Gpg4win.