> I've started playing around creating public and private keys and using them
> to encrypt byte[]s.
[quoted text clipped - 5 lines]
> Is this expected funtionality? I'm using an RSA cipher on Java1.4.1 with the
> BouncyCastle provider installed.
Yes, the naive use of c=m**e mod n is subject to certain attacks, so
randomized "padding" of the message m is needed to preclude those
attacks. I haven't looked at the padding scheme that Bouncy Castle uses,
but it could be OAEP, which is a good padding scheme. The output is
c=OAEP(m)**e mod n. OAEP xors the message with hashed output of a random
number. Bouncy Castle comes with source, right? So you could search the
source to find the padding algorithm.
You'll also find that repeated digital signatures of the same
document are all different.
--Mike Amling
Digby - 09 Oct 2003 20:22 GMT
Thanks. Think I've got a bit to learn!
> > I've started playing around creating public and private keys and using them
> > to encrypt byte[]s.
[quoted text clipped - 17 lines]
>
> --Mike Amling