Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > comp.lang.java.security > #35
| From | "swetha" <swetha@THRWHITE.remove-dii-this> |
|---|---|
| Subject | IllegalBlockSizeException |
| Message-ID | <1193214247.982547.102290@v29g2000prd.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.security |
| Date | 2011-04-27 16:07 +0000 |
| Organization | TDS.net |
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 | Next — Next in thread | Find similar
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