EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Help with PGPBlackBox in a Web Form

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#1069
Posted: 08/24/2006 10:54:15
by Shane Boland (Basic support level)
Joined: 08/24/2006
Posts: 8

I need help getting started with PGPBlackBox using vb.net 2.0 in a web...any guidence would be great.
#1071
Posted: 08/24/2006 13:00:05
by Eugene Mayevski (EldoS Corp.)

I've attached the ASP 2.0 sample for C#. You can easily use it as a guide.


[ Download ]

Sincerely yours
Eugene Mayevski
#1072
Posted: 08/24/2006 14:19:21
by Shane Boland (Basic support level)
Joined: 08/24/2006
Posts: 8

Do you have a VB.NET example
#1073
Posted: 08/24/2006 14:33:36
by Eugene Mayevski (EldoS Corp.)

No, sorry. If we had, I would send it to you instead of sending C# one.


Sincerely yours
Eugene Mayevski
#1163
Posted: 09/11/2006 10:33:24
by Shane Boland (Basic support level)
Joined: 08/24/2006
Posts: 8

I converted the sample you sent into vb...that worked

Then I took my form (just text) turned into a memory stream and generated an email attachment with that memory stream...that worked

Then I combined the 2 and it generates a PGP attachment however the only this that is able to be decrypted is the 1st character...any thoughts


[ Download ]
#1165
Posted: 09/11/2006 11:20:13
by Eugene Mayevski (EldoS Corp.)

Try making a simple project which we can run (not a web form) from your code. If it doesn't work, post the simple project.


Sincerely yours
Eugene Mayevski
#1235
Posted: 09/19/2006 10:13:10
by Shane Boland (Basic support level)
Joined: 08/24/2006
Posts: 8

I tried to recreate a windows app..but had problems...I've narrowed the issue down to a section of the code...line 62 encodes a string and that works...line 65 turns that into a memory stream that works...line 68 resets the memory stream to the begining that works...lines 70-81 encrypts the memorystream...it works but only for the first character...infact if you change the offset values in line 68 to a different byte number it will encrypt that character...so my question is this do I have to loop thru lines 70-81 for every byte? And if so do you have any suggestions.


[ Download ]
#1238
Posted: 09/19/2006 17:25:20
by Ken Ivanov (EldoS Corp.)

Quote
so my question is this do I have to loop thru lines 70-81 for every byte?

Of course, no.

There are two critical places in your code:
1. The source data are passed to TElPGPWriter as Unicode string. This means that the decrypting application should also process the message as Unicode string.
2. Your application outputs the encrypted message as array of Unicode characters. This also requires special processing from the client application.

Besides, your application also contains errors concerning array declarations, e.g.:
byteArray = New Byte(CType(outF.Length, Integer)) {} declares the array of (outF.Length + 1) elements (the parameter of array constructor specifies the index of the last element of array).

So, first of all, please try to deal with Ansi strings instead of Unicode ones:
Dim strEncodedPageDataToBytes As [Byte]() = New ASCIIEncoding().GetBytes("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz")
#1242
Posted: 09/19/2006 22:54:48
by Shane Boland (Basic support level)
Joined: 08/24/2006
Posts: 8

Thank you, "ASCIIEncoding" did the trick thank you...the errors you notice else ware was just for troubleshooting
#1397
Posted: 10/10/2006 12:18:59
by Shane Boland (Basic support level)
Joined: 08/24/2006
Posts: 8

One more question for you... I used the evaluation version now I want to purchase...but I'm not sure which version? I created a contact us type of form in .net it takes that text information and generates a txt/PGP attachment that is emailed to an email address. Just a single website that is on a shared server and just 1 developer(me).
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 7166 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!