Encrypted file decrypts on other client (RoboFTP) but data is currupted

25 views
Skip to first unread message

William Jerla

unread,
Apr 19, 2013, 4:20:37 PM4/19/13
to didisof...@googlegroups.com
Hello,
 
I'm looking into replacing an encryption component we have that sends files to another company.  They're using RoboFTP to decrypt the files.  I can encrypt the files with their public key, and the files decrypt ok on their system (there are no reported errors).  However, the data is ok for the first few thousand bytes or so and then starts to corrupt (just a few bytes here and there, not total corruption).  The files contain EBCDIC data.
 
The odd thing is if I encrypt the exact same file (using the OpenPGP library) with a key pair of my own and then decrypt it with RoboFTP on my side the decrypted file is fine.  My system is a Windows OS, I'm not sure of the OS of the remote system but it's an older mainframe.
 
Has anyone seen this kind of behavior before? Also note that I can use RoboFTP on my side to encrypt the files and they can be decrypted remotely.  It's only when using OpenPGP to encrypt that the issue surfaces.
 
Thanks,
 
William
DiscoverTec, LLC

katerina...@gmail.com

unread,
Apr 19, 2013, 7:17:56 PM4/19/13
to didisof...@googlegroups.com
 Hi William,

One possible reason that I can think of is the different line ending used in mainframes with EBCDIC character encoding.
By default our OpenPGP Library encrypts the files as binary data and this way the remote system OpenPGP software does not know that the line feed character must be corrected.

My suggestion for you is to try to instruct the PGPLib class that it will encrypt textual data. Please see below:

PGPLib pgp = new PGPLib();

// for .NET : http://sdk.didisoft.com/pgplib.net/html/P_DidiSoft_Pgp_PGPLib_ContentType.htm
pgp.ContentType = ContentDataType.Text;

// for Java : http://www.didisoft.com/java-openpgp/examples/content-type/
pgp.setContentType(ContentDataType.TEXT);

After such initializaton the encrypt methods will produced archives marked as text
and the OpenPGP software of the recipient must automatically set
the appropriate line endings.

Please let me know if this makes any difference.

Kind Regards,
Katerina Topalova
Reply all
Reply to author
Forward
Message has been deleted
0 new messages