PGP for IBM i

From this page you can download the latest version of my PGP utility. See the article in iPro Developer magazine for installation and usage instructions.

With this revision the utility gains signature handling on both encrypt and decrypt.

If you decide to use this software please know that you do so under these terms:

“It is the your responsibility to ensure that the software is accurate and appropriate for your installation. The software is offered As-Is and without warranties of any kind, whether implied or expressed. In no event shall I be liable for any damages, including, without limitation, general, special, incidental, consequential, or punitive damages, resulting from the use of the software.”

Note too that I retain copyright on my code.

Here are the files (click or right-click on the file names and “save” to download):

pgputillib.file (a save file of the PGPUTILLIB library)
– Transfer the contents (with a binary FTP or something equivalent) to an empty save file called PGPUTILLIB that you create on your IBM i server. Then, on the server, restore the PGPUTILLIB library from the save file.

pgputiljava.zip (a zip file containing the Java source and class files)
– Unzip the Java code. Copy the class file (package structure intact) to the root file system of your IBM i server.

You are replacing the magazine version of the code with this version. Wherever you put the magazine code is where you want to put this code.

Note the following:
1. In this version the commands are called PGPENCRYPT and PGPDECRYPT (not just ENCRYPT/DECRYPT).
2. In this version the Java class that acts as the command processor is pgp.util.CmdProc3 (the old version was pgp.util.CmdProc).

Examples (without and with signature handling):

Simple Encrypt (no signature):
You encrypt using the Public Key of the person you are sending the file to. (The recipient will decrypt using their Private Key.)

                              Encrypt (PGPENCRYPT)
Type choices, press Enter.                             
File to encrypt  . . . . . . . . > '/ddarnell/bigfiles.txt'
Target directory . . . . . . . . > '/ddarnell'           
Armor  . . . . . . . . . . . . .   *YES          *YES, *NO
Integrity  . . . . . . . . . . . > *YES          *YES, *NO
Key file . . . . . . . . . . . . > '/ddarnell/keys/pubring.gpg'
Key ID (0xHEXVALUE)  . . . . . . > 0xC26B9252            
Signature action . . . . . . . . > *NOSIGN       *NOSIGN, *SIGN

Simple Decrypt (no signature):
You decrypt using your Private Key. (Whoever sent you the file encrypted it using your Public Key.)

                              Decrypt (PGPDECRYPT) 
Type choices, press Enter.                              
File to decrypt  . . . . . . . . > '/ddarnell/bigfiles.txt.asc'
Target directory . . . . . . . . > '/ddarnell/output'       
Secret key file  . . . . . . . . > '/ddarnell/keys/secring.gpg'
Passphrase . . . . . . . . . . . > thisisatest              
Signature action . . . . . . . . > *IGNORE       *IGNORE, *WARN, *ERROR
Signature key file . . . . . . .                               

Encrypt (with signature):
You encrypt using the Public Key of the person you are sending the file to. (The recipient will decrypt using their Private Key.)

You sign the contents of the file with your Private Key. (The recipient will validate the signature using your Public Key.)

                              Encrypt (PGPENCRYPT)
Type choices, press Enter.                           
File to encrypt  . . . . . . . . > '/ddarnell/bigfiles.txt'
Target directory . . . . . . . . > '/ddarnell'          
Armor  . . . . . . . . . . . . .   *YES          *YES, *NO
Integrity  . . . . . . . . . . . > *YES          *YES, *NO
Key file . . . . . . . . . . . . > '/ddarnell/keys/pubring.gpg'
Key ID (0xHEXVALUE)  . . . . . . > 0xC26B9252              
Signature action . . . . . . . . > *SIGN         *NOSIGN, *SIGN
Signature key file . . . . . . . > '/ddarnell/keys/secring.gpg'
Signature Key ID (0xHEXVALUE)  . > 0xB1E0021F              
Signature Passphrase . . . . . . > signingkeypassword    

Decrypt (with signature):
You decrypt using your Private Key. (Whoever sent you the file encrypted it using your Public Key.)

You verify the signature on the contents using the Public Key of the sender.

                              Decrypt (PGPDECRYPT)
Type choices, press Enter.                             
File to decrypt  . . . . . . . . > '/ddarnell/bigfiles.txt.asc'
Target directory . . . . . . . . > '/ddarnell/output'       
Secret key file  . . . . . . . . > '/ddarnell/keys/secring.gpg'
Passphrase . . . . . . . . . . . > thisisatest              
Signature action . . . . . . . . > *WARN         *IGNORE, *WARN, *ERROR
Signature key file . . . . . . . > '/ddarnell/keys/pubring.gpg'