[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] Using RSA for encryption



Hi

When using the RSA algorithm to encrypt some data I am getting the 
following exceptions:

If I use Cipher.doFinal(byte[]) then I get:

   javax.crypto.BadPaddingException: Data is too long.

and then I try to use Cipher.update(byte[]) to avoid the problem and get:

   java.lang.RuntimeException: RSA algorithm does not implement engineUpdate

Could anyone advise my of a way to encrypt of data using RSA as the 
algorithm (I have to use RSA as I have to use a specific key, which is 
an RSA key).  I have tried using my code with a simple string and it 
works fine.  The data I am attempting to encrypt are 4-16KB large zip files.

Thanks in advance

Andrew

--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-jce