Solved

Using gpg4win to encrypt with batch file

Posted on 2011-03-09
3
3,689 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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