CryptoException while decrypting in AEM

Avatar

Avatar

sachin_solution

Avatar

sachin_solution

sachin_solution

25-04-2018

we are facing CryptoException while decrypting the text in AEM 6.0 version. Actually one of our environment is having this issue. we dont have this issue in other environments. This issue is specific to only one environment. Literally we tried all the options.

Tried options:- Deleted /etc/key folder in publish server and restarted Adobe Granite Crypto Bundle and restarted pub server too. But nothing is helped and still facing the same error.

Below is complete error message

Caused by: com.adobe.granite.crypto.CryptoException: Cannot convert byte data

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.unprotect(CryptoSupportImpl.java:160)

                at com.pearson.aem.aemcore.hybris.services.CommerceServiceImpl.getExternalUser(CommerceServiceImpl.java:326)

                ... 136 common frames omitted

Caused by: com.adobe.granite.crypto.CryptoException: Failed decrypting cipher text

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.decrypt(CryptoSupportImpl.java:96)

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.unprotect(CryptoSupportImpl.java:157)

                ... 137 common frames omitted

Caused by: com.rsa.jsafe.JSAFE_PaddingException: Invalid padding.

                at com.rsa.jsafe.JSAFE_SymmetricCipher.decryptFinal(Unknown Source)

                at com.adobe.granite.crypto.internal.jsafe.JSafeCryptoSupport.getPlainText(JSafeCryptoSupport.java:326)

                at com.adobe.granite.crypto.internal.jsafe.JSafeCryptoSupport.getPlainText(JSafeCryptoSupport.java:308)

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.decrypt(CryptoSupportImpl.java:94)

                  ... 138 common frames omitted

Is there any config which we should cross verify? Pls suggest

Replies

Avatar

Avatar

edubey

Avatar

edubey

edubey

25-04-2018

Was this encrypted by the same publisher which is decrypting it?

If you have multiple publish, make sure those are using same keys.

Avatar

Avatar

sachin_solution

Avatar

sachin_solution

sachin_solution

25-04-2018

Hi Edubey

This is not clustering environment. Encryption and decryption are happening in one pub servers.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

25-04-2018

Have you written custom code that performs encryption operations?  Never seen this happen OOTB.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

25-04-2018

I was talking to Support about this. As this is not a normal use case or even documented - there may be a bug somewhere. Please open a support ticket here.