Re: IllegalBlockSizeException when .jar compiled into .NET dll
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Sat, 27 Oct 2007 13:22:39 -0400
javadev wrote:
I have the following piece of code as part of my .jar file which is
then compiled into a .NET dll using IKVM. The code runs fine when run
as a jar but on using the .NET dll I receive an
IllegalBlockSizeException. Apparently the conversion into the dll is
causing the error, but I can't figure out what I need to do work
around this problem. Any help will be greatly appreciated.
Cipher ecipher = Cipher.getInstance("DES");
ecipher.init(Cipher.ENCRYPT_MODE, mySpec);
byte[] utf8 = "encryptThis".getBytes("UTF8");
byte[] enc = ecipher.doFinal(utf8); // IllegalBlockSizeException here
IKVM is a very cool tool, but it is in no way supported !
Try encrypt a string that is a multipla of 8.
If that works then try:
Cipher.getInstance("DES/ECB/PKCS5Padding")
Arne
.
- References:
- Prev by Date: Re: Way too much time spent with Eclipse
- Next by Date: Re: Great SWT Program
- Previous by thread: IllegalBlockSizeException when .jar compiled into .NET dll
- Next by thread: https acess aspx
- Index(es):