CryptoException while decrypting in AEM | Community
Skip to main content
Level 3
April 25, 2018

CryptoException while decrypting in AEM

  • April 25, 2018
  • 3 replies
  • 5048 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

edubey
Level 10
April 25, 2018

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

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

Level 3
April 25, 2018

Hi Edubey

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

smacdonald2008
Level 10
April 25, 2018

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

June 9, 2021

I'm seeing the same exception during package install for an OSGI xml config file containing an encrypted password.

anjali_biddanda
Level 4
June 9, 2021

I was seeing the same error during package install for an OSGI xml config file. Escape the curly braces for the package to install.