Hi!
Is there any java Provider for encryption with rsa/ecb/pkcs#1 for texts
longer than the keysize?
I have tried BouncyCasle and Cryptix, but both give me errors, that the text
is to long...
so it seems, that they don't splitt the text in blocks themselves...
ThanX,
Chris
PS: I know, that normaly you shouldn't encrypt large texts with RSA but
their is no way around it
in my App...
Michael Amling - 05 Jul 2004 21:16 GMT
> Is there any java Provider for encryption with rsa/ecb/pkcs#1 for texts
> longer than the keysize?
[quoted text clipped - 9 lines]
> PS: I know, that normaly you shouldn't encrypt large texts with RSA but
> their is no way around it in my App...
Encrypt the data with AES, using a proper mode and a MAC, both with
keys selected at random by SecureRandom, then encrypt the AES encryption
key and the MAC key with RSA.
--Mike Amling
Greg Stark - 05 Jul 2004 22:23 GMT
> Is there any java Provider for encryption with rsa/ecb/pkcs#1 for texts
> longer than the keysize?
I've never header of any provider with this capability, so you'll have to do
it
yourself. It should not be too hard; you just have to think about how many
bytes are available for your data in a given RSA block. It depends on
the details of the padding scheme you choose.

Signature
===================
Greg Stark
notgreg_stark@pobox.com
remove the "not" to get my address
===================
Harry Potter - 09 Jul 2004 17:50 GMT
I do not know but I a cannot find an example of RSA encryption on the
internet ('cause of restrictions), but I know Cryptix is able to use it.
What does your code look like?
> Hi!
>
[quoted text clipped - 12 lines]
> their is no way around it
> in my App...
Roedy Green - 09 Jul 2004 21:40 GMT
>I do not know but I a cannot find an example of RSA encryption on the
>internet ('cause of restrictions), but I know Cryptix is able to use it.
>What does your code look like?
If you want to see it done without JCE, using just BigInteger, have a
look at the source for http://mindprod.com/products.html#WRAPPER
The actual guts of it is just one line of code.

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.