Posted: 6 Apr 2016 16:20 EDT Last activity: 6 Jun 2017 4:00 EDT
RSAWrapper.encryptString coming out different between 6.2 and 7.2 PRPC
We are in the process of upgrading our Decisioning Hub at our customer site. One of the issues we are having is that the customer can no longer read our encrypted RSA data. We encrypt the same string in both the 6.2 and 7.2 environments - using the same inputs and even the same RSA data file. The encrypted strings come out the same length but different in the encryption. In 6.2, the customer's server could decrypt and process our message, but in 7.2, they cannot read the encrypted string and are returning "INVALID XML".
Although, both the 6.2 and 7.2 are using the same Java Home, I am seeing different cipher suites for the two.
For 6.2, they start with the following.
For 7.2, they start with these.
I notice in 7.2 we use jcajce.provider on the bouncy castle vs. just jce.provider on 6.2. I don't even know if that matters. I believe we are failing because our client's server to which we are encrypting data does not share all of our cipher suites. The java system property for rsaKeyClass is null. I have two questions.
1) Is there a way to know which cipher suite we are using in our encryption when we call RSAWrapper.encryptString?
2) Can we change it to a specific cipher - or is cipher and keyClass not the same?
Posted: 5 years ago
Posted: 8 Apr 2016 20:13 EDT
Kevin Zheng (KevinZheng_GCS)
Director, Software Solutions Engineering
We are now seeing that the 7.2 URL encoding going out to the wire on HTTP connections is not converting the '+' to '%2B'. The 6.2 URL encoding is converting '+' to '%2B'. If we call the Java URLEncoder.encodeString, it converts '+' to '%2B'.
Should + be converted to '%2B'? Should it matter? Should it be done under certain conditions? This is the only difference I am seeing between the code that is working in 6.2 and the code that is failing in 7.2. It does not appear to be an encryption issue as the strings we encrypt on 7.2 work fine when sent out on 6.2 and the encrypted response received in 6.2 can be decrypted successfully by 7.2. It does appear to be a URL encoding issue. If anyone has seen this or knows something about it, please let us know. Otherwise, I will post the answer here once we track it down.
The SR details are not published on PDN. The Pega Global Customer Support Team had provided HFix-27140 which resolved the issue. This HFix was for Pega 7.2 product version. In case you are seeking the same HFix, please create an SR with the Pega Global Customer Support Team. This blog could help you with that: Raising Support Requests for Hotfixes now made easy!
In case your use case is slightly different for your Pega is of a different version, we suggest that you create an SR and mention the URL to this post.