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

Re: [iaik-jce] RSA type "PKCS #1 v1.5 block type 2"

What happens depends on the IAIK JCE version you are using, I suggest
2.51 and will describe this version only.

If you do a getInstance() with "RSA" or "RSA/ECB/PKCS1Padding" the
blocktype will be automatically selected as 1 or 2 as appropriate for the
type of operation you are doing. You can also use "RSA/2/PKCS1Padding"
which will basically do the same and throw an exception if blocktype is
inappropriate (i.e. signature operation, for example private key

Again, if that does not work the problem is not in the padding but
someplace else (wrong key, corrupt data, etc.) as the two SSL
implementations interoperate ok.


 Andreas Sterbenz              mailto:Andreas.Sterbenz@iaik.tu-graz.ac.at

-----Ursprüngliche Nachricht-----
Von: Tom Schuring <TomS@esd.nec.com.au>
An: <iaik-jce@iaik.tu-graz.ac.at>
Gesendet: Freitag, 23. Juli 1999 01:01
Betreff: [iaik-jce] RSA type "PKCS #1 v1.5 block type 2"

> Hello,
> I'm trying to find a "common" setting for RSA encryption between
> IAIK-RSA and the OpenSSL-RSA. Apparently I need to specify  "PKCS #1
> v1.5 block type 2" ,but I'm not sure which of the settings for IAIK I
> should use to get these settings. I have tried all of the following:
> Cipher.getInstance("RSA");
> Cipher.getInstance("RSA/0/PKCS1Padding");
> Cipher.getInstance("RSA/1/PKCS1Padding");
> Cipher.getInstance("RSA/2/PKCS1Padding");
> just before I do a:
> rsa.init(Cipher.ENCRYPT_MODE, key );
> return rsa.doFinal(myData);
> but I'm not sure what will give me "PKCS #1 v1.5 block type 2"
> Any Idea's would be most welcome,