Symmetric encryption padding

 

Today still debug MAC algorithm in Java card with Xuxu, I have to implement the MAC algorithm but there are so little document on it, I can only try time after time.

Girls are always girls, always play a passive role, such as in political, in leadership, in family life, and still, on beds. Thanks to Old Dou, who creak the problem with two sentences: “M 1 padding with all 0, M 2 padding with 0x 80 and 0” . Well just as the Chinese old saying “it’s great fortune to have a old at home”. With the hint I finished the MAC alg of ALG_DES_MAC8_NOPAD, ALG_DES_MAC8_ISO9797_M1,ALG_DES_MAC8_ISO9797_M2, but the ALG_DES_MAC8_ISO9797_1_M2_ALG3 is hard to deal with, I will try later.

 

There is the summary on padding:

 

    PKCS5: Pad with bytes all of the same value as the number of padding bytes. it’s also the same as PKCS5 and RFC 3852 Cryptographic Message Syntax (CMS)

    ISO 9797 method 1: Pad with zero (null) characters.

    ISO 9797 method 2:   Pad with 0x80 followed by zero bytes. if the last block is full, need to add an extra block begin with 0x80.

你可能感兴趣的:(java,Algorithm,cms,null,encryption)