Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

DES decryption implementation in java and java card

JavaCard Applet Development Related Questions and Answers.
mose05
Posts: 18
Joined: Mon Jan 25, 2016 3:11 am
Points :170
Contact:

DES decryption implementation in java and java card

Post by mose05 » Thu Feb 09, 2017 11:01 pm

Recently, I found a difference between DES decryption implementation in java and java card.

In UPDATE method, DES CBC (M1, M2, or, PK5)
- In java, it need to have at least 16 bytes input to have output data.
- In java card, you should have at least 8 byte to have output data.

Why does this difference there? Could anybody explain it to me? Thanks.

Crawford
Posts: 39
Joined: Thu Sep 17, 2015 11:50 pm
Points :246
Contact:

Re: DES decryption implementation in java and java card

Post by Crawford » Fri Feb 10, 2017 3:15 am

mose05 wrote:- In java, it need to have at least 16 bytes input to have output data.


Have you got 8 bytes in the response? If you have 8 bytes only, you should call doFinal().

mose05
Posts: 18
Joined: Mon Jan 25, 2016 3:11 am
Points :170
Contact:

Re: DES decryption implementation in java and java card

Post by mose05 » Fri Feb 10, 2017 5:12 am

I know that calling doFinal will give me final result.
The problem is that in Java, if input data is less than 16 bytes,there will be no output after calling update .
But in javacard it will give output of update method if the input data is more than 8 bytes length.
Is there any advantage between them?

Crawford
Posts: 39
Joined: Thu Sep 17, 2015 11:50 pm
Points :246
Contact:

Re: DES decryption implementation in java and java card

Post by Crawford » Fri Feb 10, 2017 6:17 am

IMO, there is no advantage or dis-advantage in this case. You should not rely on intermediate results of update anyway because the operation is not completed until doFinal(...) method is called.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 21 guests

JavaCard OS : Disclaimer