RSA CBC encoding

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RSA CBC encoding

Usman Ismail
Hi,

I am newbie to bouncy castle so try to accomodate my ignorance. I am trying to use RSA keys to encrypt a message and it is working fine is I use Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding","BC"); however if I try to use CBC (Cipher cipher = Cipher.getInstance("RSA/CBC/PKCS1Padding","BC");) I get the following error:

java.security.NoSuchAlgorithmException: No such algorithm: RSA/CBC/PKCS1Padding
        at javax.crypto.Cipher.getInstance(DashoA13*..)
        at javax.crypto.Cipher.getInstance(DashoA13*..)
        at RSACoder.encrypt(RSACoder.java:92)
        at RSACoder.main(RSACoder.java:36)

The reson seams obvious but I am sure CBC is supported by bouncy castle as the documentation clearly states this.

What am I doing wrong?

regards
Usman

PS: Source file is attachedRSACoder.java