JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
3Des encript and decrypt
3Des encript and decrypt
Hello Sir,
Can any one help me 3des encryption and after encryption what was the encrypted data length and how to decrypt it.
Thanks,
Thammineni Naresh
Can any one help me 3des encryption and after encryption what was the encrypted data length and how to decrypt it.
Thanks,
Thammineni Naresh
-
- Posts: 35
- Joined: Wed Jun 20, 2018 4:06 am
- Points :218
- Contact:
Re: 3Des encript and decrypt
the input data for 3DES encryption is divided into many blocks and every block has the fixed length: 64bit = 8bytes.
If the last block does not match the length, we need to pad this block, which make the block to be 64bit.
the padding mode have the followed:
public static final byte PAD_ISO9796
public static final byte PAD_ISO9796_MR
public static final byte PAD_ISO9797_1_M1_ALG3
public static final byte PAD_ISO9797_1_M2_ALG3
public static final byte PAD_ISO9797_M1
public static final byte PAD_ISO9797_M2
public static final byte PAD_NOPAD
If the last block is not 64bit and the padding mode is PAD_NOPAD, this will result in fail.
The input data for 3DES decryption must have the length of the multiple of 64bit and the input data is the cipher text.
COS decrypt the cipher text and unpad the result.
If you want to find the theory of the 3DES encryption and decryption. you can search it on the net.
If the last block does not match the length, we need to pad this block, which make the block to be 64bit.
the padding mode have the followed:
public static final byte PAD_ISO9796
public static final byte PAD_ISO9796_MR
public static final byte PAD_ISO9797_1_M1_ALG3
public static final byte PAD_ISO9797_1_M2_ALG3
public static final byte PAD_ISO9797_M1
public static final byte PAD_ISO9797_M2
public static final byte PAD_NOPAD
If the last block is not 64bit and the padding mode is PAD_NOPAD, this will result in fail.
The input data for 3DES decryption must have the length of the multiple of 64bit and the input data is the cipher text.
COS decrypt the cipher text and unpad the result.
If you want to find the theory of the 3DES encryption and decryption. you can search it on the net.
Who is online
Users browsing this forum: No registered users and 64 guests