PGPSTRING.DLL v1.00
PGP COM Interface for Strings
Freeware. Freely distributable.
Copyright (c) 2001, Gerard R Thomas.
email:<grt@wow.net><grt@geocities.com>
http://community.wow.net/grt/nsdpgp.html

This program is "freeware" and may be used and copied,
without fee or obligation, for private or commercial use.
If you do use it for commercial purposes, you may wish to contribute
to the further development. You can send an online gift certificate
from http://www.amazon.com to Gerard R Thomas grt@wow.net 
See the license.txt for license information.

Installation:
Please uninstall previous versions of PGPSTRING.DLL before
installing version 1.0.

The pgpstring.zip file contains these files:

file_id.diz (package information)
readme.txt  (program information)
license.txt (license)
pgpstring.dll (COM Interface DLL for PGP version 6.5.8)
pgpstring.dll.sig (PGP signature)

Copy the pgpstring.dll file to the \System32 directory (Windows 2000 and NT 4.0)
or the \System directory (Windows ME/98/95).

Register the file by typing into the Start | Run
"REGSVR32 PGPSTRING.DLL"

Uninstall:
Unregister the file by typing into the Start | Run
"REGSVR32 /U PGPSTRING.DLL"

Delete the pgpstring.dll file.

Operation:
PGPSTRING.DLL is a COM In-Process Automation Server. Its interface
provides conventional (128 bit IDEA, CAST5, 3DES) string encryption
and decryption methods to clients such as ASP, the Windows Scripting Host, 
Visual Basic, MS Office VBA, Java, Delphi, Visual C++ etc.
I have tested it with PGP 6.5.8 on Windows 2000 Professional
(Service Pack 1) using ASP (on IIS5), Visual Basic 6, and JScript (WSH).

The two methods are:

[outputstring] = EncryptString( cipher, passphrase, inputstring )
[outputstring] = DecryptFile( passphrase, inputstring )

parameters:

cipher is an Integer that indicates the desired conventional cipher
algorithm. Valid values are 0 (for CAST5), 1 (for IDEA) and 2 (for 3DES).

passphrase is a String giving the conventional passphrase.

inputstring is a String giving the desired input string to be processed.

outputstring is the return value (a String). Each method returns the processed output
in this manner. In the case of the EncryptString method, the output is the
textual hexadecimal representation of the actual PGP output. 

Usage examples:

(1) using ASP on IIS5

<html>
<head>
<title>PGPSTRING Test</title>
</head>
<body>
<%
dim alg
dim instr
dim outstr
dim pass
dim decstr
set pgpobj = server.createobject("PGPSTRING.CRYPTSTRING")
alg = 1
instr = "Test of the PGP COM wrapper for string encryption"
pass = "my secret"
if isobject(pgpobj) then
	outstr = pgpobj.EncryptString(alg,pass,instr)
        response.write(instr & "<BR>")
        response.write(outstr & "<BR>")
        decstr = pgpobj.DecryptString(pass,outstr)
        response.write(decstr & "<BR>")
else
	response.write("Error creating object")
end if
set pgpobj = nothing
 %>
<br>
all done
</body>
</html>


(2) using Visual Basic 6

(a) choose Standard EXE project
(b) choose Project | References and check the "PGP COM Interface for String Encryption"
    checkbox.
(c) place a commandbutton control on Form1
(d) enter the following code

Dim inputstring As String
Dim outputstring As String
Dim decrypted As String
Dim password As String
Dim myref As New CryptString

inputstring = "Test of the PGP COM wrapper"
password = "my secret phrase"

MsgBox inputstring
outputstring = myref.EncryptString(IDEA, password, inputstring)
MsgBox outputstring
decrypted = myref.DecryptString(password, outputstring)
MsgBox decrypted

Set myref = Nothing

(e) run the code and click on the buttons


(3) using WSH (the Windows Scripting Host) and JScript

var alg = 1;
var instr = "Test of the PGP COM wrapper for string encryption";
var pass = "my secret";
var outstr;
var decstr;
WshShell = WScript.CreateObject("WScript.Shell");
pgpobj = WScript.CreateObject("PGPSTRING.CRYPTSTRING");
WshShell.Popup(instr, 2);
outstr=pgpobj.EncryptString(alg,pass,instr);
WshShell.Popup(outstr, 2);
decstr=pgpobj.DecryptString(pass,outstr);
WshShell.Popup(decstr, 2);


Note: 
PGP version 6.5.8 must be installed on the system for this interface to work.
It will not work with other versions of PGP.
It will not work with the command line version of PGP. It requires the
file PGP_SDK.DLL from the full GUI version. 
It is not a standalone encryptor but rather a thin COM wrapper to PGP.
The actual cryptographic operations are performed by PGP itself. The DLL
passes the data to PGP_SDK.DLL for processing.

Note:
The PGP signature may be used to verify the integrity of the 
executable. The executable is signed with my PGP DSS key.
[4096/1024 bit DH/DSS <grt@wow.net> <grt@geocities.com> 
Key ID: 0xFF7155A2 Key fingerprint:
61DF 0468 0570 4615 8FF5  7530 5B3C 2165 FF71 55A2]

2001 01 10
Gerard R Thomas
Port of Spain
Trinidad and Tobago
