DidiSoft Ltd. company news, events and announcements.

OpenPGP Library for .NET fixes RSA signatures problem with Java 7+

Half a year ago we have released version which addressed compatibility with OpenPGP signatures verification with systems build with Java version 7 and above.

Unfortunately it ended that we have introduced an additional bug at that time that brakes signature verification for each 1 out of 500 files created with RSA key and SHA-1 hash digest.

The newest version of OpenPGP Library for .NET finally resolves this issue. Our customers are strongly recommended to update, in order to exchange without any hassle data with OpenPGP systems build and running on Java 7 or above.

Known affected systems so far: Tibco MFT, iWay Integration Services.


OpenPGP Library for Java v3.1.3.6 with a critical bugfix

Today has been released version of DidiSoft OpenPGP Library for Java which provides a critical bug fix.

The bug prevents decrypting .pgp data that was encrypted and compressed with the BZip-2 algorithm. The error message thrown in such cases is:

com.didisoft.pgp.PGPException: I/O problem with stream: java.io.IOException: Not a BZIP2 marked stream : Not a BZIP2 marked stream : Not a BZIP2 marked stream

Versions affected: all 3.0.x and 3.1.x versions.

Other recent updates

Release date: 08 October 2018
KeyStore class – fixed bug in importing keys with only a comment header line

Release date: 25 September 2018
PGPLib class – default preferred symmetric key cipher is now AES-256, with backward compatibility with keys made prior year 2002 using CAST5
As usual the latest version should be fully backward compatible and the upgrade shall be nothing more than replacing your existing JAR files with those from the latest release.

Shall you have any questions or concerns, please do not hesitate to drop us a line.


Recent updates in OpenPGP Library for .NET 1.8.5

The new version of DidiSoft OpenPGP Library for .NET 1.8.5 starts with some new features that simplify key management and enhanced key export.

Below you can see some short code samples illustrating the new features:

KeyStore access by Index

DidiSoft.Pgp.KeyStore items can now be accessed by index. Two new properties have been added to allow this:

KeyStore[index] – access to the keys by insertion order
KeyStore.Count – count of key pairs inside the KeyStore

KeyStore ks = KeyStore.OpenFile(...);
int numberOfKeys = ks.Count;
KeyPairInformation key = ks[1]; // from 0 up to Count-1

Additional signing sub keys

Additional signing sub keys can be added with the help of a new method: KeyStore.AddSigningSubKey

using System;
using DidiSoft.Pgp;
public class AddEncryptionSubKey
 public static void Demo()
  // initialize the key store
  KeyStore keyStore = new KeyStore(@"DataFiles\key.store", "changeit");
  // User Id of the signing key, this is usually our private key
  String signUserId = "support@didisoft.com";
  String privateKeyPassword = "changeit";
  // add ECC sub key
  KeyPairInformation.SubKey newKey2 = keyStore.AddSigningSubKey(signUserId, privateKeyPassword, EcCurve.P521);

Partial private key export

In recent versions of GnuPG, private keys can be exported partially without the master private key material. Such key can be utilized only through its sub keys, but cannot sign other keys.

An example illustrating this can be found here: Exporting partial private keys

Upgrade from previous versions

Version 1.8.5 is 100% code level compatible with all previous 1.8 versions. Just rebuild and redeploy your applications with the new assembly DLL’s.


GnuPG 2.2.8 compatibility with Java

Recent changes in GnuPG version 2.2.8 in response to the EFAIL attack reject all encrypted data that don’t have Modification Detection Code (MDC) packet.

In order to address this as of version DidiSoft OpenPGP Library for Java exposes a new property in the PGPLib class:


Example usage:

PGPLib pgp = new PGPLib();

Setting this property will have affect on all subsequent encryption or one pass signing and encryption calls that don’t have the integrity check parameter. When the above property is set to true, integrity protection (Modification Detection Code) packet will be added to the encrypted data in the .pgp message to be compatible with GnuPG 2.2.8 and all new upcoming versions.

This change is especially for all methods that produce String output, because in those methods the integrity protection was missing up till now.


GnuPG 2.2.8 compatibility for .NET

As of version 2.2.8, GnuPG/gpg will not accept encrypted or signed and encrypted .pgp files which don’t have integrity protection packet, also known as Modification detection code (MDC packet). This will be the default behavior of GnuPG from now on, and is their answer to the EFAIL attack.

Our product OpenPGP Library for .NET exposes methods which allow explicit setting of the integrity protection packet. But up till now the methods where this parameter was absent didn’t used integrity protection and the output from them will not be accepted by all new versions of GnuPG. This applies also to all methods that deal with output as String type.

In order to address this issue, version 1.8.4 of DidiSoft OpenPGP Library for .NET  exposes a new property of the PGPLib class : PGPLib.IntegrityProtectArchives. Sample usage is :

PGPLib pgp = new PGPLib();
pgp.IntegrityProtectArchives = true;

This code block will ensure that all subsequent operations where Integrity protection is not specified explicitly will use it and the output will be accepted from GnuPG 2.2.8 and upper versions. The same applies to Symantec PGP Command Line 10.4.2 and newer versions.


Compatibility with Java 7+ RSA signatures

As of Java version 7 and above the RSA digital signatures computation has been changed and signatures that were previously accepted by software build with Java may end being rejected with message like: “unable to verify signature: Signature length not correct: got 511 but was expecting 512

Solutions using DidiSoft OpenPGP Library for .NET may be affected when they send signed or signed and encrypted PGP data with software systems build in Java. A recent example we had was with TIBCO MFT, throwing the above mentioned error.

The technical explanation of the problem is that a digital signature consists of MPI (multi precision integers) which are kept in array of bits (not bytes!) and when serialized they may end being a number that is not divisible by two without reminder, which is not accepted by Java 7 and upper versions.

Version of OpenPGP Library for .NET resolves this issue by padding with leading zero bytes up to a length power of two. If you encounter such behavior then please upgrade.

Important notice: It ended that in version we have introduced an additional bug. This was finally fixed in version !


OraSFTP v 1.2.6 now supports current remote folder

DidiSoft OraSFTP prior to version 1.2.6 were limited to either absolute paths or paths relative from the current user remote home directory.

As of version 1.2.6 the current remote folder can be changed this way allowing for easy traversing and manipulation of complex remote folder structures.

The new methods that support this functionality are:

ORA_SFTP.CURRENT_DIRECTORY – retrieves the absolute path of the current remote folder


ORA_SFTP.CD – changes the current remote folder

ORA_SFTP.CD_UP – changes the current remote folder one level up

You can see example usage at:



Should the EFAIL attack concern your PGP applications

A few days ago in the world of applied cryptography especially S/MIME and PGP emails has appeared a new threat – the EFAIL attack.

In this post we are not going to explain again details of the attack itself as a lot has already been published on the Internet, but rather explain do you have to be concerned using any of the DidiSoft OpenPGP products.

The EFAIL attack in breaf

The EFAIL attack in short consists of allowing the receiver to decrypt the data and send it via HTTP request to the intruder. In the examples published in the source article this is done with an image tag artificial inserted by the intruder and the decrypted data sent as an HTTP request parameter for the image tag location (assumed to be on the intruder’s web host).

The main target of the attack is S/MIME and PGP encrypted email messages.

First approach (image tag)

The first approach they use is by modifying the email and introducing a new body part before the encrypted email body part, which contains an unclosed image tag.

Our proposed Solution

When implementing email rendering do not allow unclosed tags in a MIME section and perform HTML purification independently for each MIME body part.

Second approach (CBC/CFB gadget)

The second technique, named CBC/CFB gadget attack, exploits vulnerabilities in OpenPGP (CVE-2017-17688) and S/MIME (CVE-2017-17689).

From the EFAIL article the reader may conclude that the second vulnerability is something that a 12 year old boy can do at home:

“Given the current state of our research, the CFB gadget attack against PGP only has a success rate of approximately one in three attempts”

The reality tends to be different though. This is still an unconfirmed threat to PGP/MIME emails. The current Security Focus state regarding exploits is “Currently, we are not aware of any working exploits“. PGP/MIME emails with Integrity protection packet cannot be modified as of the time of this writing.

Our proposed Solution

When receiving PGP/MIME emails DidiSoft products will rise exception whether or not integrity protection has been set on the incoming data.

When sending PGP/MIME emails to other entities using DidiSoft products, please ensure that integrity check has been turned on!


The EFAIL attack exploits weaknesses in the implementation of some PGP email clients. The mass press coverage raised uncertainty in organizations relying on PGP encryption, but the attack targets PGP email client implementations and not PGP encryption as a whole.

We also recommend  you to read the one page official answer from the core PGP developers.


Update to DidiSoft Privacy Policy

The new European General Data Protection Regulation (GDPR) goes into effect on May 25, 2018. We can assure you that all DidiSoft services are fully compliant with GDPR as of today.

Not only is GDPR an important step in protecting the fundamental right to privacy for European citizens, it also raises the bar for data protection, security, and compliance in the industry.

The main three steps we have performed were to ensure that the customers’ data in our database is encrypted, to give you information for all the data we store for you and to ensure the right to erasure (to be forgotten).

Where can I see my data

In our customers’ section you will find a menu GDPR which displays all the information we have for you and your company.

Right to erasure (Act. 17 of GDPR)

In our customers’ section you will find a menu GDPR and a button at the bottom “Delete all my data”.  From there you can erase forever the data we store for you. You can also contact our support department and we can do that for you.


Should DidiSoft OpenPGP Library for .NET provide strong name assemblies or unsigned assemblies?

Last week we have sent a short survey to subscribers for our OpenPGP Library for .NET mailing list. The survey had only one question:

Should DidiSoft OpenPGP Library for .NET provide strong name (signed) assemblies (DLL’s) or plain unsigned assemblies?

At the end of this post you will find the results of the survey, but first lets explain why did we made it.

DidiSoft OpenPGP Library for .NET was providing limited PGP emails support due to limitations in the System.Net.Mail namespace implementation regarding the MIME email formats (in fact we supported only PGP-inline emails). Recently we had received a numerous requests for additional support for PGP/MIME email format. In order to implement it we decided to use the open source MimeKit library but this is the moment where we were hit with this case:

+-------+        +---+         +--------+
|   B   +------->+ A +<--------+    D   |
+---+---+        +---+         +--------+
^                               ^
|                               |
|                               |
+---+---+                       +---+---+
|  C.1  |                       |  C.2  |
+-------+                       +-------+

Assembly A needs to use assemblies B and D, which reference different versions of assembly C. Of course this can be resolved with binding redirect in the app.config or dynamically in the AppDomain.CurrentDomain.AssemblyResolve event. But our aim was to provide a DidiSoft.Pgp.Mail.dll which use will be as simple as just referencing it straight away.

Digging for more information in Stackoverflow and MSDN we found out that probably the days when strong named assemblies were a must may have passed away. In order to hear what our community thinks we decided to file the survey. And here are the results:

The results are self explanatory – we must provide both strong named DLLs and unsigned too.