cancel
Showing results for 
Search instead for 
Did you mean: 

PGP Decryption Failing - Looking for suggestions

JamesACA
Level 3

Hello,

I am working with PGP encryption for the first time and I have having issues decrypting a file using the “Bouncy Castle - PGP Utility” (ver 1.2.0). I am able to encrypt a file using the object but not decrypt it. I get the error “Private key for encrypted message was not found. Ensure the supplied Private Key Filepath contains a compatible private key for this file’s decryption”. Below I will detail the steps I have followed so far.

To create my key pair I am using GPG. I used the command “gpg --full-generate-key” and created an “RSA and RSA” key with no expiry date and 4096 bits long. For the name I selected “RPA” (as this will be used by the team), for the email address I use a shared email address and for the comment I put “TEST”. I was then prompted to input a passphrase (not within the CMD but via a popup from Kleopatra I believe). I saved the password is my password vault and then entered it. Afterword I ran the following command “--export -a "RPA" > "C:\Users\username\AppData\Roaming\gnupg\rpaTEST\rpaPublicTestKey.asc". I navigated to “C:\Users\username\AppData\Roaming\gnupg\private-keys-v1.d” and copied both private “.key” files into “C:\Users\username\AppData\Roaming\gnupg\rpaTEST”. I then created copies of both of them but changing the file extension from “.key” to “.asc”. I also created a text file called “passphrase” and in clear text entered the passphrase I originally put in. I copied the “rapTEST” folder to my Development machine in the documents folder. Now I will head over to what I did in Blue Prism.

I attached a screenshot to show my configuration for the “encrypt” action which works without a problem. I can also decrypt this file on my local desktop which I will show after. When decrypting I get the message “Private key for encrypted message was not found. Ensure the supplied Private Key Filepath contains a compatible private key for this file’s decryption”. I tried using both private keys and each their files types (“.asc” & “.key”). I tried with and without passphrase and nothing works.

Using Kleopatra on my desktop I am able to decrypt the file (that was encrypted in Blue Prism). I have attached screenshots of this process and I also included the audit logged after it was decrypted.

Please let me know what other troubleshooting steps I should follow.

Thank you,Blue Prism EncryptionBlue Prism EncryptionBlue Prism DecryptionBlue Prism DecryptionKleopatra StepsKleopatra Steps

Kleopatra SuccessKleopatra Success

AUDIT LOG:

<html><head>
<title>GnuPG Audit Log Viewer</title>
</head><body>
<pre>gpg: encrypted with rsa4096 key, ID 72F272752BB4DF1F, created 2025-02-26
&quot;RPA (TEST) &lt;rpa@email.ca&gt;&quot;
gpg: used key is not marked for encryption use.
gpg: WARNING: cipher algorithm CAST5 not found in recipient preferences
</pre>
</body></html>

0 REPLIES 0