Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

AEM CryptoException

Avatar

Level 5

Hi Frndzs,

We are facing the below issue when we try to access the hybris from AEM (AEM crypto unable to decrypt the password)

java.lang.IllegalStateException: com.adobe.granite.crypto.CryptoException: Cannot convert byte data

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

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

        at com.XXXX.aem.aemcore.hybris.security.XXXXAuthHandler.getUnprotectedValue(XXXXXAuthHandler.java:254)

        at com.XXXX.aem.aemcore.hybris.security.XXXXAuthHandler.authenticateUser(XXXXXAuthHandler.java:111)

        ... 135 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

2 Replies

Avatar

Level 10

Have you followed the docs here: hybris

Avatar

Level 3

Were you able to resolve this?

I'm facing this when copying the truststore between instances. I'm following the procedure in Managing Subscriptions  which I expected to fix this problem.

I've found the solution to this, see Security Checklist -> "Replicating Keys for AEM 6.3"