arekinath / PivApplet

PIV applet for JavaCard 2.2.2 and 3.0.4+ with full ECDSA/ECDH support
109 stars 37 forks source link

Is it possible to use Cipher.ALG_RSA_PKCS1 on JC222 #52

Open ble0 opened 3 years ago

ble0 commented 3 years ago

Is it possible to use Cipher.ALG_RSA_PKCS1 in PIV_SUPPORT_RSA instead on the default Cipher.ALG_RSA_NOPAD? Will the PIV applet work the same?

mistial-dev commented 2 years ago

For your first question, the best reference for what cards support what is going to be this page.

https://www.fi.muni.cz/~xsvenda/jcalgtest/table.html

As you can see, ALG_RSA_PKCS1 was introduced prior to JC2.2.2, and is well supported (even if a few cards don't support it).

PKCS1 padding is different from no padding at all, but as I understand it you can still have the client application do the PKCS1 padding if you want it, with the applet just doing it "raw" at that point.

Will the PIV applet work the same?

I believe (though am not certain) that doing so would break the applet such that TLS (for example) would be limited to TLS 1.1. Essentially, you force the use of specific padding, rather than leaving it to the client.

Why do you want to do this?