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
decrypt DES in javacard vs java
decrypt DES in javacard vs java
Hi all!
I tested DES decryption on java card and I also did comparison between java card and java.
I got the following result:
In update method, DES CBC (M1, M2, or, PK5);
- If implementing in java, I need to have at least 16 bytes input to have output data.
- If implementing in java card, I need to have at least 8 byte to have output data.
So what reason results in this difference?
If anyone can share your knowledge with me, I would be greatly appreciated.
I tested DES decryption on java card and I also did comparison between java card and java.
I got the following result:
In update method, DES CBC (M1, M2, or, PK5);
- If implementing in java, I need to have at least 16 bytes input to have output data.
- If implementing in java card, I need to have at least 8 byte to have output data.
So what reason results in this difference?
If anyone can share your knowledge with me, I would be greatly appreciated.
Re: decrypt DES in javacard vs java
For Java implementation, Do you get 8 bytes in the response? If you have 8 bytes only, you should call doFinal(...).
The greatest glory in living lies not in never falling, but in rising every time we fall.--Nelson Mandela
Re: decrypt DES in javacard vs java
Tarantino wrote:For Java implementation, Do you get 8 bytes in the response? If you have 8 bytes only, you should call doFinal(...).
@Tarantino, Thanks for your answer!
I do understand that calling doFinal will give me final result.
The problem is that in Java, there will be no output after calling update if input data is less than 16 bytes
However, javacard will give output of update method if the input data is more than 8 bytes length.
Re: decrypt DES in javacard vs java
Just keep in mind that you should not rely on intermediate results of update anyway since the operation is not complete until doFinal is called.
The greatest glory in living lies not in never falling, but in rising every time we fall.--Nelson Mandela
Who is online
Users browsing this forum: No registered users and 16 guests