Encrytion using GPG – command line example for automation

This is the GPG command line example to be used inside of automation as C# console application. This encryption/decryption will only use the password.

Encrypt

Basic format

gpg -o outputPath –cipher-algo AES256 –symmetric sourcePath

Example to be used inside of automation

echo letmeinPetbarn | gpg –batch –passphrase-fd 0 -o D:\Automations\Petbarn\EMListExtractAndFTP\DataOut\petbarn.csv.gpg –cipher-algo AES256 –symmetric D:\Automations\Petbarn\EMListExtractAndFTP\DataOut\petbarn.csv

Decrypt

Basic format

gpg -o targetFullPath –decrypt sourcePath

Example to be used inside of automation

echo letmeinPetbarn | gpg –batch –passphrase-fd 0 -o D:\Automations\Petbarn\EMListExtractAndFTP\DataOut\petbarn.csv –decrypt D:\Automations\Petbarn\EMListExtractAndFTP\DataOut\petbarn.csv.gpg

 

Relevant links

GPG command line samples

GPG command manual

Five best file encryption tools

Encryption using .Net built in method

Leave a comment

Please note that we won't show your email to others, or use it for sending unwanted emails. We will only use it to render your Gravatar image and to validate you as a real person.