Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.security > #35

IllegalBlockSizeException

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "swetha" <swetha@THRWHITE.remove-dii-this>
Subject IllegalBlockSizeException
Message-ID <1193214247.982547.102290@v29g2000prd.googlegroups.com> (permalink)
X-Comment-To comp.lang.java.security
Newsgroups comp.lang.java.security
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 39
Date Wed, 27 Apr 2011 16:07:47 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303920467 96.60.20.240 (Wed, 27 Apr 2011 11:07:47 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 11:07:47 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.security:35

Show key headers only | View raw


  To: comp.lang.java.security
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.security | Previous | NextNext in thread | Find similar


Thread

IllegalBlockSizeException "swetha" <swetha@THRWHITE.remove-dii-this> - 2011-04-27 16:07 +0000
  Re: IllegalBlockSizeExcep "swetha" <swetha@THRWHITE.remove-dii-this> - 2011-04-27 16:07 +0000

csiph-web