[jboss-jira] [JBoss JIRA] Created: (JGRP-538) ENCRYPT protocol throwing IllegalBlockSizeException

vivek v (JIRA) jira-events at lists.jboss.org
Tue Jun 19 15:32:28 EDT 2007


ENCRYPT protocol throwing IllegalBlockSizeException
---------------------------------------------------

                 Key: JGRP-538
                 URL: http://jira.jboss.com/jira/browse/JGRP-538
             Project: JGroups
          Issue Type: Bug
    Affects Versions: 2.5
         Environment: Windows, Linux
            Reporter: vivek v
         Assigned To: Bela Ban
            Priority: Critical
             Fix For: 2.5


I use NotificationBus channel and in the member joined method I call, bus.sendNotification(Node) - passing a custom Node object. Upon this I get the following error on the newly joined member,

javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher 
at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) 
at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) 
at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA13*..) 
at javax.crypto.Cipher.doFinal(DashoA13*..) 
at org.jgroups.protocols.ENCRYPT._decrypt(ENCRYPT.java:838) 
at org.jgroups.protocols.ENCRYPT.decryptMessage(ENCRYPT.java:831) 
at org.jgroups.protocols.ENCRYPT.handleUpMessage(ENCRYPT.java:672) 
at org.jgroups.protocols.ENCRYPT.up(ENCRYPT.java:533) 

I could reproduce the same problem using NotificationBusDemo.java in JGroups 2.5 CR1. Here is what I did, 
 
1) Generate a keystore using JGroups' KeyStoreGenerator  (I also tried with JDK 1.6's keytool to generate secret key)
2) Add the following line in the protocol stack of NotificationBusDemo.java in the main(),  
"ENCRYPT(key_store_name=jgroups.keystore;store_password=storePassed;alias=mykey):" + 
 
3) Add the following line in the memberJoined(..) method of NotificationBusDemo.java  
bus.sendNotification("Member Joined");  
 
4) Run 2 instances of NotificationBusDemo.java 
5) You'll get the following error message, 
 
> 3828 [WARN] ENCRYPT.up(): - exception occurred decrypting message 
javax.crypto.BadPaddingException: Given final block not properly padded 
at com.sun.crypto.provider.SunJCE_h.b(DashoA12275) 
at com.sun.crypto.provider.SunJCE_h.b(DashoA12275) 

I am running this on Windows using JGroups 2.5 CR1.  The original thread for this issue is at,

    http://sourceforge.net/forum/forum.php?thread_id=1751571&forum_id=18795


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list