Java Card DES generator applet output is different from online-tools output

前端 未结 2 920
一生所求
一生所求 2020-12-17 05:35

The below applet is written to do a DES encryption/Decryption on the APDU data field :

package cryptoPack;

import javacard.framework.APDU;
import javacard.f         


        
相关标签:
2条回答
  • 2020-12-17 06:22

    As I didn't know which one of DES_ECB_PKCS5, DES_ECB_NOPAD, DES_ECB_ISO9797_M2 or DES_ECB_ISO9797_M1 being used by the online tool

    That´s the problem. Blockmode, padding and other things are very important (and there are so much more than 4 combinations). And in case of online tools, charset stuff (input interpretation in general) is also a problem.

    Without knowing the online tool in detail, you won´t get anything right with it.
    Just don´t use it and search for standardized test vectors.

    Other than that, why you´re using DES!? Stop that.
    It´s not secure anymore.

    0 讨论(0)
  • 2020-12-17 06:28

    You make encrypt with '00 C1 04 01 08 30 30 30 30 30 30 30 30) not (30 30 30 30 30 30 30 30);

    modify just this MyCipher.doFinal(buffer, ISO7816.OFFSET_CDATA, datalen, CipheredData, (short) 0);

    Really good worls you make sorry for delay

    0 讨论(0)
提交回复
热议问题