Interpreting various Kleopatra Errors

If we initially install “Kleopatra” under Windows, by way of ‘GPG4Win’, there could be many reasons fw the application may not work at first. But once it is installed, we usually expect it to continue working, especially if we also did not upgrade it.

But it has recently happened to me, that an attempt to launch the Kleopatra GUI failed, and gave me “Application Error 0xc0000005″. After that, uninstalling specific software, which did not insert any special libraries into the workings of Kleopatra, and then rebooting the Windows 7 machine, got rid of the error, and allowed Kleopatra to work again. In order to understand what this could mean, it is necessary to understand what Kleopatra normally does.

Kleopatra is a GUI, for the “GNU Privacy Guard” suite, which provides encryption, which manages public and private keys, and which manages the encryption of private keys as well. In order to do this, the application starts a process called ‘gpg-agent’, by means of which passwords can be entered securely, with which we are protecting our secret encryption keys. Securely means, in such a way that no other applications can read or log these passwords.

The error message above is somewhat vague. It can mean that a corrupted registry key has been digested by Windows, or it can also mean that some application is trying to access protected memory that does not belong to it. One possible meaning it could have in the case of Kleopatra, is that this application was unable to establish a secure way for key-strokes to be received by ‘gpg-agent’.

The fact that a reboot was required, after the other software was uninstalled, before Kleopatra would work again, could also mean several things:

  1. The other application could have installed a library to our Windows System, which remained loaded, even though the DLL File was already deleted. Specifically, this could be a Linux application using the Qt GUI libraries, that was ported to Windows, but that also set its version of the Qt libraries as the system-wide default, which might not be compatible with the Qt libraries that Kleopatra uses, and which the latter defines properly, in a way staying local to it.
  2. Windows could have digested a corrupted Registry entry during the previous reboot, in a way that would affect the entire session, even after this Registry entry was removed from the version stored on the HD.
  3. The other application could have left some process running in the BG, which could have affected how key-strokes are entered, even though we weren’t using that other application.


There is a more specific term for Case 3 above: We call that a key-logger. And it comes in a fitting context, that a program we use to manage our secret encryption keys, would announce to us that something was wrong.

In this case I would ask myself, whether I have actually typed in any passwords since the preceding reboot, including the password that unlocks the session. I assume that the first time we start a Windows session, this key-logger would not get the password to the machine, because processes have not yet launched, which do so after we start the first session. But if the screensaver came on, and if we entered our password to unlock that, then the BG processes would presumably be running already, and would be able to log that password.

And so aside from getting rid of such a potential threat, we also need to ask ourselves whether some immediate effort needs to be made, to change sensitive passwords…

In my own case I also observed, that the simpler GUI named ‘GPA’, which does not use Qt as its GUI library, and which also installs with ‘GPG4Win’, was still working 100%, and that the ‘gpg-agent’ process was successfully launched and running. A more critical error would have stemmed from ‘gpg-agent’ instead of from attempting to launch the GUIs.

Another observation which applies to my scenario is, that After I Uninstalled the other application and rebooted, the Error Went Away. I did not use a System Restore Point. If somebody was to install a key-logger intentionally, then he would also configure his uninstall script in such a way, as to leave that key-logger installed, if we simply gave the command to uninstall the application, which would in this case be the Trojan.


(Edit : ) It is worth pointing out, that Kleopatra is an application, where the EXE File is not installed in the same folder, as the DLL Files it will link to. But it is normal Windows behavior, first to look in the folder of the EXE to try finding the DLLs there. Only after those are not found there, does Windows ‘look for them elsewhere’.

This could explain why Kleopatra was one of the fewer programs on my machine, that were malfunctioning, which the majority of the programs were not.

It should also be pointed out, that the other application which was causing this malfunction in my scenario, had its libraries distributed in numerous folders local to it. Therefore, it would have made sense on some level, for its developer to enter those folders into the path, in which his EXE Files were supposed to search for them.

The result could easily have been, that the DLLs which belong to Kleopatra, and which Kleopatra would thus try to link to, matched the exact names of DLL Files in the other programmer’s folders by chance, to which Kleopatra could have linked falsely.

But this may not always be everybody’s scenario. Some people report getting this error message sporadically, and without the success of having gotten rid of. And then, what could it mean?