2

I support an application who call a CMD line to decrypt a file. The application is a .exe file that is called by the Windows Task Scheduler and is execute as the same user who have all right.

The application run every week day in the evening at 6h30pm and sometimes the CMD line return the message: no secret key. The application failed because the file was not decrypted. But it doesn't failed every evening, just random evening. It looks totally random.

And if I run the application myself after it failed with the same user, it worked.

The secret key is imported in Kleopatra and it work fine with other application that run in the morning. And it work fine when I used it.

What can cause this?

Thank you

Bradford1138
  • 65
  • 1
  • 1
  • 7
  • If this is the KDE project, a post for support would probably be your best bet. https://bugs.kde.org/ – lit Dec 05 '17 at 19:30

2 Answers2

1

We fix the problem. We must not log off the application user. If we log off the user, one key is not working, but the others are working.

Bradford1138
  • 65
  • 1
  • 1
  • 7
0

Some ideas to help you run down the problem:

  1. Check the private keys available to the machine on which the application fails

    gpg --list-secret-keys

    (IIRC Kleopatra runs on top of GnuPG, so I assume your application does as well. I've been wrong before.) You might notice something out of place with your private (decryption) keys. For example, if the key is listed as either

    sec#
    ssb>
    

    Then it's a (primary or sub respectively) key located on a smart card for storage. If the card, for whatever reason, isn't in the machine when the app runs it'll fail to decrypt.

  2. Check the disk containing the private keyring is attached/inserted/mounted at the time the application ran and failed to decrypt. If the keys are stored on removable (or unreliable) media then that could also result in a failure to decrypt.

  3. Check that the item failing to decrypt was encrypted properly. If there is some secondary recipient necessary for the app to run there may be a required key that you don't know about (I gather from your post you didn't create this app, just maintain it.) It may even be that the app is trying to decrypt a different file erroneously, but that kind of thing can only be found out by stepping through your source code and resident files.

Failing those, pray for @Jens Erat to notice your question.

user8675309
  • 591
  • 1
  • 6
  • 24
  • 1. I know that the key is not located on a smart card. 2. The keys is on the hard drive with the application. 3. The Item was encrypted properly, I can decrypt them myself, it's just the application that failed sometimes. – Bradford1138 Dec 06 '17 at 20:12