Page 1 of 1

des cbc with PKCS5 issue

Posted: Fri Nov 10, 2017 7:48 am
by stanneraustin
Hello
i having issue on javacard 2.1.2 not accepting ALG_DES_CBC_PKCS5 install and select return with 6A88 if i change to ALG_DES_CBC_ISO9797_M1 or ALG_DES_CBC_ISO9797_M2 it work with installation.

i am using JCOP21 and JCIDE .
is there any short version of pad unpad PKCS5 ? I found many which are int base my card not support it.
also is there any issue speed if i use custom pad unpad ?
second question its possible to build custom AES support for javacard 2.1.2 ?

ps: working excellent on debug and PCSC support etc. only thing i noticed it some time corrupt java source.. i recommend to add history save or backup save automatic .
i have also emailed javacardos for some cards still waiting for reply.

Re: des cbc with PKCS5 issue

Posted: Tue Nov 21, 2017 5:01 am
by roundtable
For the 1st problem, ALG_DES_CBC_PKCS5 is not supported on older vesion javacard or JCOP. but the scheme is so simple, you can implement it by yourself combining ALG_DES_CBC_NOPAD and simple pad alg. for example, if 3 bytes to be needed to block align in the last block, so just pad it with 3 0x33, e.g. XX XX XX XX XX 33 33 33 as the last block for CBC cipher. If 5 bytes is needed, then the pattern is XX XX XX 55 55 55 55 55.

the 2nd question , if you use the JCOP without AES support, it is impossible to implement AES, you have to chose another javacard product.