MatheGeniee@gmx.de (?mit Yildirim) wrote in message news:<4a2b6107.0408170147.77789ddb@posting.google.com>...
> Hallo,
>
> i have a problem with my RSA implementation in Java... if i have a
> string which is no longer then 64 Signs is there any problem. But as
> soon as a string is longer than 64 Signs i get an Exception about
> this:


BouncyCastle RSA gives an exception if you try to encrypt a block
which is longer than the key size. In your case the key size is 512
== 64 bytes. I think the only work around is to break your text into
64 byte blocks.

> RSAkeyPairGen.initialize(512,sunSha1prngSecRand);


Also 512 is pretty short for an RSA key, better to use 1024 or 2048.
And of course, the usual advice is to use RSA only for sending a
symmetric key, which is then used for encrypting the rest of the data.

-- Russ