Solved

Using gpg4win to encrypt with batch file

Posted on 2011-03-09
3
3,463 Views
Last Modified: 2012-05-11
I have an OpenPGP Key Pair that was being used in CuteFTP to encrypt files. I need to automate encrytion of files and to my knowledge, CuteFTP will only encrypt using the GUI interface.

So, after reading some old posts here on EE, I decided to download gpg4Win in hopes to be able first, import
the existing key pair, and then be able to run a batch file to encrypt files.

I attempted to import the key pair into Kleopatra but ran into some issues. Firstly, the .ASC file includes the public key and the private key. Is this a problem for gpg4win?
I'm not sure of this is causing problems for me but when I imported, only the private key was succesfully added. I tried to delete the key and start over however,
I received an error that the public key was not signed.


1. Will I be able to encrypt from a batch file with gpg4Win, barring I import the keys correctly?

2. Should I be able to import this key pair in the current format- both public and private keys together in one .ASC file?

Looking for some insight, I'm new to pgp.

Thanks!
Justin
0
Comment
Question by:blastmasterJUS1
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Tolomir earned 500 total points
ID: 35087529
just a heads-up have you checked this manual already:

http://www.gpg4win.org/doc/en/gpg4win-compendium.html

Especially:

10 Importing a public certificate
http://www.gpg4win.org/doc/en/gpg4win-compendium_15.html

18 Signing and encrypting files
http://www.gpg4win.org/doc/en/gpg4win-compendium_24.html

Tolomir
0
 
LVL 27

Expert Comment

by:Tolomir
ID: 35087588

For those comfortable with the command line, you can change to the “ Files\GNU\GnuPG”
directory and run: gpg –help
Some quick-start command line tools are:
gpg –gen-key  # This will walk you through key generation
gpg –armor –export-key <key>  # Export a public key in a format that can be e-mailed
gpg –list-keys  # List keys in your key ring
gpg -r <key> -e <file>  # Encrypt a file.
gpg -d <file>  # Decrypt a file
0
 

Author Comment

by:blastmasterJUS1
ID: 35118607
Hey Tolomir. Thanks for the response. Sorry it took so long for me to get back...been busy with more projects!

I have read those sections of the compendium several times but I'm still stumped.

1. can I import the private and public keys into Kleopatra if they are in one ASC file? It looks like this...

-----BEGIN PGP PRIVATE KEY BLOCK-----

Version: FileCrypt eBusiness 3.5
Comment: http://www.veridis.com
 
blah blah blah

-----END PGP PRIVATE KEY BLOCK-----
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: FileCrypt eBusiness 3.5
Comment: http://www.veridis.com

blah blah blah

-----END PGP PUBLIC KEY BLOCK-----



2. Also, how can I sign my public key BEFORE I try to import it into Kleopatra?

Thanks!
Justin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cybersecurity has become the buzzword of recent years and years to come. The inventions of cloud infrastructure and the Internet of Things has made us question our online safety. Let us explore how cloud- enabled cybersecurity can help us with our b…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A simple description of email encryption using a secure portal service. This is one of the choices offered by The Email Laundry for email encryption. The other choices are pdf encryption which creates an encrypted pdf of your email and any attachmen…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now