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

 




If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
You might like these articles too.

Leave a Reply

Your email address will not be published. Required fields are marked *