OpenPGP support with GnuPG (GPG) and Core FTP Pro

 

Instructions


1: Download and install the Windows version of GnuPG from gnupg.org (download).

2: From a command line prompt (start - cmd), cd to the GnuPG installation directory.

3: If you don't have a key pair yet, generate one by typing: gpg --gen-key

4: Follow all prompts, see gpg documentation for more details on generating key pairs.

5: Create the following files (preferably in the GnuPG installation directory).


upload.bat:

@echo off
rem point to location of gnupg keyfiles
set GNUPGHOME=c:\Documents and Settings\Username\Application Data\gnupg\
chdir "c:\program files\gnu\gnupg\"
del encrypted.dat
rem create a 'processed' directory to copy original files into.
copy %1 .\processed\
rename %1 encrypted.dat
gpg --recipient "desination_user" --output %1 --encrypt encrypted.dat
del encrypted.dat


download.bat:

@echo off
set GNUPGHOME=c:\Documents and Settings\Username\Application Data\gnupg\
chdir "c:\program files\gnu\gnupg\"
gpg --passphrase-fd 0 < pass.dat --output "decrypted.dat" --decrypt %1
copy /y decrypted.dat %1
del decrypted.dat

rem pass.dat contains your password for decrypting files.


6: In Core FTP Pro, go to the advanced -> external settings of your site profile.

In the 'post download' field, select the 'download.bat' file you created above (append "%1" for Core FTP to pass the filename).
ie: "c:\Program Files\GNU\GnuPG\test.bat" "%1"

In the 'pre upload' field, select the 'upload.bat' file (append %1).
ie: "c:\Program Files\GNU\GnuPG\upload.bat" "%1"

and finally, in the post upload field, enter: cmd.exe /c del "%1"
(this will delete the temporary encrypted file upload.bat generated).


You are now ready to begin encrypting and decrypting OpenPGP compatible files.
When uploading, upload.bat will be called to encrypt your files.
When downloading, download.bat will be called to decrypt your files.

Before transferring files, you may want to test encrypting files yourself to
make sure all necessary public keys have been imported correctly.



Other helpful gpg commands:

Import public keys from users you wish to exchange files with by typing: gpg --import "publickeyfilefromanotheruser.txt"

Export your public key to other users you wish to exchange files with by typing: gpg --armor --output "yourpublickey.txt" --export "your_key_name"

Encrypt a file: gpg --recipient "recipient name" -- output "output_filename.gpg" --encrypt "input_filename.dat"

Decrypt a file: gpg --decrypt "output_filename.gpg"

 

 

 

 



OpenPGP with Core FTP Pro