PGP encryption and decryption in

Hi All.

i have tried PGP encryption and decryption in I followed the steps as in techcommunity and it is working fine when i encrypt using my public and decrypting using my private key.

Here in the input for decryption i didnt pass any secretKey in bytes or passphrase but it still worked

i have given my public key to my colleague so from his instance he tried to encrypt the data using my public key and when i try to decrypt the data using my private key

It is not working fine.

i tried adding string to bytes and passed bytes to secretkey and also passphrase still the same issue

Hi. I got it to work sending both from a local IS to my WMIO tenant and from another service on the same tenant over HTTP, so it should work equally well from another WMIO tenant.

When you define the PGP connector account, you upload your .asc public and private key files. So, there is no need to send them as inputs separately.

When you encrypt, it’s best to loadAs bytes.
When you send in the input data to decrypt, only send in encrypted message, not the PGP headers and trailers. Then, if sending over HTTP base64 encode the bytes - set use new line to false. Use variable substitution to send the data in the body of the POST. For example, {“encryptedString”:“%encryptedString%”}

The tutorial here uses the raw bytes and streams to and from Azure blob storage: Integration PGP encryption & decryption - Knowledge base - Software AG Tech Community & Forums

It’s not obvious, because loadAs defaults to bytes.

Hope this helps,

Hi Theo

Thank you for your reply. I will try this and got mine working in other way, I see when I copy the encrypted string from email or from chat in notepad++ seems it is getting corrupted and when I copy the encrypted string in notepad and send the data it is working fine.

I used loadAs String and it still worked

I have shared by public key to other tenant admin and asked him to encrypt using my pub key and I decrypted using my private key and

I have imported his pub key in to my account and sent him encrypted string using his pub key and at his end he will use his private key to decrypt

Hope the process i followed is correct