Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1257

ENCRYPT protocol UnrecoverableKeyException: Given final block not properly padded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 2.12
    • 2.7, 2.8, 2.11
    • None
    • Hide

      Add the ENCRYPT code described to the 2.7.0 GA bin distribution, and try to run any example. It should throw the exception.

      Reproducing the same steps with versions 2.6.15 GA or earlier won't throw the exception.

      I prepared an example if needed.

      Show
      Add the ENCRYPT code described to the 2.7.0 GA bin distribution, and try to run any example. It should throw the exception. Reproducing the same steps with versions 2.6.15 GA or earlier won't throw the exception. I prepared an example if needed.

      Recently I updated my jgroups version from 2.4.x to 2.11. Suddenly my applications thrown this exception.

      org.jgroups.ChannelException: unable to setup the protocol stack: Given final block not properly padded
      at org.jgroups.JChannel.init(JChannel.java:1574)
      at org.jgroups.JChannel.<init>(JChannel.java:257)
      at org.jgroups.JChannel.<init>(JChannel.java:240)
      at org.jgroups.demos.Draw.<init>(Draw.java:52)
      at org.jgroups.demos.Draw.main(Draw.java:141)
      Caused by: java.security.UnrecoverableKeyException: Given final block not properly padded
      at com.sun.crypto.provider.SunJCE_z.a(DashoA13*..)
      at com.sun.crypto.provider.JceKeyStore.engineGetKey(DashoA13*..)
      at java.security.KeyStore.getKey(Unknown Source)
      at org.jgroups.protocols.ENCRYPT.initConfiguredKey(ENCRYPT.java:269)
      at org.jgroups.protocols.ENCRYPT.init(ENCRYPT.java:231)
      at org.jgroups.stack.ProtocolStack.initProtocolStack(ProtocolStack.java:641)
      at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:468)
      at org.jgroups.JChannel.init(JChannel.java:1570)
      ... 4 more

      The ENCRYPT protocol config is

      <ENCRYPT sym_init="448"
      sym_algorithm="Blowfish"
      encrypt_entire_message="true"
      key_store_name="cloudencrypt.keystore"
      store_password="password"
      alias="test"/>

      I tested the same code with different versions. 2.6.15 GA is the last working version, and every version I tested from 2.7 GA to 2.11 GA throw the same exception. I made a little use case with it. Maybe I am missing something?

              rhn-engineering-bban Bela Ban
              angarg12 Andres Garcia Garcia (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: