Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Security > IllegalBlockSiz...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1734 of 1792
Post > Topic >>

IllegalBlockSizeException thrown from .NET dll

by swetha <swethasivaram@[EMAIL PROTECTED] > Oct 24, 2007 at 01:24 AM

Hello all

I had posted this query a few days back on the
comp.java.lang.programmer group and after trying a few things I still
am facing the problem of IllegalBlockSizeException being thrown from
the .NET dll that I have compiled with the message - "1 trailing
bytes".

Following is the link to the earlier post:

http://groups.google.co.in/group/comp.lang.java.programmer/browse_thread/thread/dfa5d6d5bd7cd5fe?hl=en

Since then I have changed my key to an 8 byte array just in case the
conversion from the String and the adding of parity bits was causing
problems and hence my code now is:

Cipher ecipher = Cipher.getInstance("DES");
byte[] raw = {0x0051, 0x0041, 0x003C, 0x003A, 0x0041, 0x0050, 0x0033,
0x003D};

SecretKey mySpec = new SecretKeySpec(result, "DES");
ecipher.init(Cipher.ENCRYPT_MODE, mySpec);

byte[] utf8 = "encryptThis".getBytes("UTF8");
byte[] enc = ecipher.doFinal(utf8); // IllegalBlockSizeException here

However, I still get the same IllegalBlockSizeException error with the
message - "1 trailing bytes" and I would like to know if there is a
workaround to this solution as I am now stuck and cannot think of
anything else that I can do. Any ideas will be appreciated.

Thanks
Swetha
 




 2 Posts in Topic:
IllegalBlockSizeException thrown from .NET dll
swetha <swethasivaram@  2007-10-24 01:24:07 
Re: IllegalBlockSizeException thrown from .NET dll
swetha <swethasivaram@  2007-10-24 04:03:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 23:34:45 CDT 2008.