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

Re: [iaik-jce] RSA cipher initialisation



David Taylor wrote:
> 
> Some notes on how the different providers initialise the RSA cipher:
> 
> Padding:
> 
> DSTC defaults to PKCS1 padding
> ABA defaults to PKCS1 padding
> IAIK defaults to not using PKCS1 padding (odd one out)

This should definitely be defined by the JCE.
 
> Mode specification:
> 
> DSTC uses 1 or 2 as the mode specifier
> IAIK uses 0, 1 or 2 as the mode specifier
> ABA uses ECB as the mode specifier (odd one out)

The "mode" portion of the Cipher transformation is defined to be
the feedback mode to be used which is why we chose ECB.  The 0,1,2
in the other providers is a mechanism to alter the type of PKCS#1
padding (block type) to use.

The ABA provider uses the padding mechanism to choose the block
type.  PKCS1Padding indicates that block type 1 or 2 should be
used (depending on whether we are doing public or private key
encryption), NoPadding indicates that block type 0 should be used.

> So, if you just ask for Cipher.getInstance("RSA") and initialise it you'll
> get one result with ABA and DSTC (as they'll use PKCS1 padding) and another
> with IAIK (as it won't use PKCS1 padding in this case). If you want to be
> more specific the code won't work for all three because the mode specifiers
> are different.

The algorithm names (and modes & padding) definitely need to be
specified as part of the JCE.  It would appear however that Sun
have only defined those algorithms they have implemented as part
of their Java2 JCA provider.  Which basically means we the implementers
need to attempt some standardisation across our providers.

bernard.
--
Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html

To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce