Author | Topic: PGP? | |
---|---|---|
John Sauvigne | PGP? on Tue, 14 May 2013 13:58:41 -0400 What is the best way to decrypt a PGP file within Xbase++? Has anyone found a good 3rd party tool? | |
Boris Borzic | Re: PGP? on Wed, 15 May 2013 04:51:01 +0200 John Sauvigne wrote in news:66858315$51afc5d6$166b5@news.alaska- software.com: > What is the best way to decrypt a PGP file within Xbase++? Has anyone > found a good 3rd party tool? How about using the PGP command line tool. Just call it using RunShell() Best regards, Boris Borzic http://xb2.net http://sqlexpress.net industrial strength Xbase++ development tools | |
John Sauvigne | Re: PGP? on Wed, 15 May 2013 17:49:38 -0400 Thanks Boris, that make a lot of sense. Is Symantec the only provider now? Or is their an open source command line tool you could recommend? On 5/14/2013 10:51 PM, Boris Borzic wrote: > John Sauvigne wrote in news:66858315$51afc5d6$166b5@news.alaska- > software.com: > >> What is the best way to decrypt a PGP file within Xbase++? Has anyone >> found a good 3rd party tool? > > How about using the PGP command line tool. Just call it using RunShell() > | |
Boris Borzic | Re: PGP? on Thu, 16 May 2013 16:38:40 +0200 John Sauvigne wrote in news:16eabe13$599ef0a5$2e75c@news.alaska- software.com: > Thanks Boris, that make a lot of sense. Is Symantec the only provider > now? Or is their an open source command line tool you could recommend? Search for "PGP Freeware" by Networks Associates Best regards, Boris Borzic http://xb2.net http://sqlexpress.net industrial strength Xbase++ development tools | |
John Sauvigne | Re: PGP? on Thu, 16 May 2013 14:22:40 -0400 Thanks Boris! Will do. On 5/16/2013 10:38 AM, Boris Borzic wrote: > John Sauvigne wrote in news:16eabe13$599ef0a5$2e75c@news.alaska- > software.com: > >> Thanks Boris, that make a lot of sense. Is Symantec the only provider >> now? Or is their an open source command line tool you could recommend? > > Search for "PGP Freeware" by Networks Associates > | |
John Sauvigne | Re: PGP? on Thu, 23 May 2013 16:07:21 -0400 Followup: I am testing the OpenPGPBlackbox ActiveX package from EldoS and it seems to work very good. Need to register two dll's which to me is easier to support than installing a freeware package at a couple of hundred commercial sites and running a command line option. The cost is US$486. FWIW, here is a code example: Set License Key oLicense := CreateObject('BaseBBox10.ElSBLicenseManagerX') cKey := "xyz" oLicense:SetLicenseKey(cKey) Create Key oSecKey := CreateObject('PGPBBox10.ElPGPSecretKeyX') oSecKey:GenerateForUser(cKeyPhrase, nBits, SB_PGP_ALGORITHM_PK_RSA, cUser, .f., nExpires) oSecKey:SaveToFile(AddPath(cPrivateKeyFile), .t.) oSecKey:PublicKey:SaveToFile(AddPath(cPublicKeyFile), .t.) Load Private Key oKeyring := CreateObject('PGPBBox10.ElPGPKeyringX') oKeyring:LoadFromFiles(cPublicKeyFile, cPrivateKeyFile, .t.) Decrypt File oReader := CreateObject('PGPBBox10.ElPGPReaderX') oReader:DecryptingKeys := oKeyRing oReader:KeyPassphrase := cKeyPhrase oReader:OutputFile := cOutputFile oReader:DecryptAndVerifyFile(cInputFile) One problem I have is that I can load the keys from a file but I can't load it from a variable (Stream). Here is the documentation for TElPGPSecretKey.LoadFromStream: Declaration: HRESULT _stdcall LoadFromStream([in] IUnknown * Stream ); Note: Stream parameter expects an object which implements IStream interface. I tried: oKeyring:LoadFromStream(cPublicKeyTextVariable, cPrivateKeyTextVariable, .t.) but I get a "Type mismatch" Ascom Error. Anyone know how to convert a text variable into a Stream? Thanks, John. |