EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
Posted: 11/30/2008 21:44:14
by Alex Nail (Basic support level)
Joined: 08/27/2008
Posts: 16

I'm using secureblackboxpgp.dll version on two Windows 2000 servers, one is development one production.

The file I'm decrypting contains Hex value 85 (...). My application decrypts this file but replaces the hex value of 85 with 3F (?). In production, the file decrypts as well, but doesn't recognize the hex value 85 at all.

For example...

Development Decryption - 1234?5678
Production Decryption - 12345678

The sample programs decrypt the file just fine.

Any ideas what may be causing this?


Posted: 12/01/2008 00:09:03
by Eugene Mayevski (EldoS Corp.)

Is the value of 0x85 located in the *encrypted* block or it is supposed to be present in the decrypted data?

Sincerely yours
Eugene Mayevski
Posted: 12/01/2008 06:27:40
by Alex Nail (Basic support level)
Joined: 08/27/2008
Posts: 16

The value should be present in the decrypted data.

Posted: 12/01/2008 06:39:40
by Ken Ivanov (EldoS Corp.)

Don't you use StreamReader or StreamWriter class in your application?
Posted: 12/01/2008 07:09:46
by Alex Nail (Basic support level)
Joined: 08/27/2008
Posts: 16

Yes, here's the call that's made to write the decrypted file...

FileStream fsBak=null;

fsBak= System.IO.File.Create(filePath);
System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
byte[] bFileData = encoding.GetBytes(document);
return Success;
catch(Exception ex)
("RMIC.B2B.Common.Utils.Library.BackupFile","Error Backing up file - " + filePath);
System.Diagnostics.EventLog.WriteEntry("EDIReceiveHandler", ex.Message, System.Diagnostics.EventLogEntryType.Error);
return Failed;

if (fsBak!=null)
Posted: 12/01/2008 07:17:05
by Ken Ivanov (EldoS Corp.)

That clarifies everything. As 0x85 character is not an ASCII character, ASCIIEncoding class breaks the decrypted data.
Posted: 12/01/2008 07:45:59
by Alex Nail (Basic support level)
Joined: 08/27/2008
Posts: 16

Yes, makes sense. How are the demos handling this?
Posted: 12/01/2008 07:58:09
by Ken Ivanov (EldoS Corp.)

The demos work directly with System.IO.FileStream objects, thus there's no intermediate string-to-byte-array conversions.
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.



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