EldoS | Feel safer!

Software components for data protection, secure storage and transfer

PGP Black Box Coding

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 07/21/2006 11:18:30
by Phillip Grant (Basic support level)
Joined: 07/21/2006
Posts: 10

I've downloaded the SecureBlackBox eval, and have checked out the GUI (VB) example. My needs are to create a non-GUI application (part of an automated file xfer process).

Does anyone know or have any programmatic examples of invoking the objects, and then encrypting/decrypting files?

Thanks in advance...
Posted: 07/21/2006 11:36:00
by Ken Ivanov (EldoS Corp.)

The samples is in development stage at the moment. We will post them to the topic as soon as something is ready.
Posted: 07/21/2006 13:02:51
by Phillip Grant (Basic support level)
Joined: 07/21/2006
Posts: 10

Thank you for the speedy response! I look forward to seeing the examples.

Keep up the good work!
Posted: 07/31/2006 11:36:17
by Phillip Grant (Basic support level)
Joined: 07/21/2006
Posts: 10


Is there any news on programmatic VB6 examples? I have been able to hobble together my own working PGPWriter (encrypt) code, but am having trouble getting PGPreader (decrypt) code to work. The same code works with a GUI, but errors out when run non-interactively.

My being able to get a working test program running with the demo is what will determine if we purchase the full-blown product.

Thanks in adavnce.
Posted: 08/01/2006 10:14:58
by Eugene Mayevski (EldoS Corp.)

The developer is working on exactly these samples right now. I have asked him about whether/when we can give you a sample. Will get the answer soon.

Sincerely yours
Eugene Mayevski
Posted: 08/01/2006 12:01:08
by Phillip Grant (Basic support level)
Joined: 07/21/2006
Posts: 10

Thank you for responding to me regarding this issue.

My boss is hounding me about getting a working test program, and as I said, I have gotten PGPWriter to work OK, but am having trouble getting PGPReader to work programmatically.

Posted: 08/01/2006 12:13:28
by Eugene Mayevski (EldoS Corp.)

Please use the attached sample. I have just received it from the developer, so it's untested. But it should give you an idea.

[ Download ]

Sincerely yours
Eugene Mayevski
Posted: 08/01/2006 12:36:59
by Phillip Grant (Basic support level)
Joined: 07/21/2006
Posts: 10

Thank you for the example.


This is another GUI example using forms very similar to the example that comes with the product. This is not what I need. The GUI examples work fine. I am attempting to do something like this (in a VB code-only, non-GUI exe:

Public PGPReader As ElPGPReaderX
Public PGPGlobalKeyRing As ElPGPKeyringX
Public PGPLicMgr As ElPGPLicenseManagerX

Set PGPReader = CreateObject("PGPBBox.ElPGPReaderX")
Set PGPGlobalKeyRing = CreateObject("PGPBBox.ElPGPKeyringX")
Set PGPLicMgr = CreateObject("PGPBBox.ElPGPLicenseManagerX")

    PGPLicMgr.SetLicenseKey ("E1gMG1reR2UggzJHIgbP1QFSCTHvP6xFIiEO/l8DXjo04XAe98qxTDCMH+P6C0rImqyOGts5hWHGDIsTsjceAJ9ZAjSj/UEwD88ovbIX+t7p6jkJYQwEvc4/1sIAo46SPFSC2CGjuzlNZ0LBH2+1zg6cjS/c0MnI8tqWlziJOXLlho966O9rlmlSiH+Xu8/VetfcDpe4naS/pxN9...izxt/XGzYdphdJUAvn5HxWyECzaQqi2/g3U4ar/0LjenRlmRmGIEJ18SeZzH60lL/wmIHr3PQ==")
    ' Load the Key Rings
    PGPGlobalKeyRing.LoadFromFiles "mypath_w_filename_to_pubring.pkr", "mypath_w_filename_to_secring.skr", True

    With PGPReader
        .Passphrase = "my_pass_phrase"
        .DecryptingKeys = PGPGlobalKeyRing
        .VerifyingKeys = PGPGlobalKeyRing
        .OutputFile = "mypath_w_filename_toOutFile"
        .DecryptAndVerifyFile ("mypath_w_filename_to_inputfile")
    End With

This returns the error:

"Run-time error '-2147467259 (80004005)' No appropriate key for decryption found"

on the DecryptAndVerifyFile line. Entering the smae info in the GUI example decrypts the file fine without errors. I am sure there is something I am doing wrong, but can't put my finger on it...

Any help is greatly appreciated.
Posted: 08/01/2006 12:55:07
by Eugene Mayevski (EldoS Corp.)

Have you implemented the handler for OnPassphrase and/or OnKeyPassphrase events? I bet you have not.

This is from the sample I've sent:

Private Sub PGPReader_OnKeyPassphrase(ByVal Key As pgpbboxCtl.IElPGPCustomSecretKeyX, Passphrase As String, Cancel As Boolean)
frmPassphraseRequest.Init Key
frmPassphraseRequest.Show vbModal, Me
If frmPassphraseRequest.Executed Then
Cancel = False
Passphrase = frmPassphraseRequest.txtPassphrase.Text
Cancel = True
End If
End Sub

Sincerely yours
Eugene Mayevski
Posted: 08/01/2006 13:27:05
by Phillip Grant (Basic support level)
Joined: 07/21/2006
Posts: 10

Isn't that what the property ElPGPReader.Passphrase is for?

If you set the PGPReader.PassPhrase before calling DecryptAndVerifyFile, shouldn't it use that?

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.



Topic viewed 11367 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!