javacard

Java Card to send data without get data APDU

回眸只為那壹抹淺笑 提交于 2019-12-11 12:16:59
问题 I'm new to this field, so forgive me if my question is naive. I want to issue a Java card which has an auto-select applet and almost all APDUs are going to get handled in this applet. I need this applet to send data to CAD not using the usual format in Java card standard (i.e. without sending 0x61 0xbytesToRead and waiting for 0x00 0xc0 ). For example I'd like to send 0x23 bytes in answer to 0xA0A40000027F20 which is almost a SELECT command but with wrong first byte! So is this possible to do

ElGamal on SmartCards

…衆ロ難τιáo~ 提交于 2019-12-11 11:09:30
问题 I was wondering if a smartcard/Javacard is able to perform ElGamal cryptography? Is it implemented anywhere, i.e. is there an API that can be used for such purposes? Cheers! 回答1: The SmartMX family of NXP supports ElGamal, it's in their public data sheets. I don't think I've seen in mentioned in any Java Card implementation though, it's not in the standard so if present, it must be in vendor supplied libs. Probably any Smart Card with a Montgomery multiplier will be able to support ElGamal

AESKey LinkedList/Array in Java Card

Deadly 提交于 2019-12-11 10:56:23
问题 This post is related to a question I asked a few days ago: Store symmetric keys in Java Card I want to implement LinkedList in Java Card to store AESKey . So I wrote a class KeyElement this way: package LinkedList; import javacard.security.AESKey; import javacard.security.KeyBuilder; class KeyElement { private KeyElement next; private short id; private AESKey key; private boolean isUsed; /** * Constructor. * * @param upperBound * An upper bound to indicate of many elements it cans contain at

What is the functionality of selectingApplet() method in JAVACARD2.2

时间秒杀一切 提交于 2019-12-11 09:35:35
问题 As mentioned in JavaCard 2.2 APIs documents here, selectingApplet() is a method that is used by the applet process() method to distinguish the SELECT APDU command which selected this applet, from all other SELECT APDU commands which may relate to file or internal applet state selection and it returns true if this applet is being selected. My question is that Why we need this method? and even more general : Why the selected applet need to receive SELECT-applet commands? I think the only entity

Rotate left on a 64-bit word byte array in JavaCard

老子叫甜甜 提交于 2019-12-11 06:46:14
问题 I am trying to perform a rotate left (ROTL) operation on an arbitrary amount of rotations on a 64-bit word currently represented as a byte array of 8 bytes in a JavaCard smart card. The ugly way around is to hard-code all 64 possible permutations of ROTL on a 64-bit word represented as an 8 byte array but that will simply bloat the entire codebase up. How do I make it leaner so that I can on-the-fly do any arbitrary amount of ROTL operations on demand on a 64-bit word (in byte array) with the

About Get Response command in javacard

两盒软妹~` 提交于 2019-12-11 02:37:20
问题 I'm confused about Get Response command. I thought I know it but actually I don't. I wanna know the mechanism in which the card returns 1000-bytes data in case 4. I guess the command is as follows. Please let me know the correct one if it is wrong. (Card) <== [CLA] [INS] [P1] [P2] [Lc] [Data] [Le] // response data size is 1000 bytes (Card) ==> 6100 (Card) <== 00 C0 00 00 00 (Card) ==> [Data(256)] 6100 (Card) <== 00 C0 00 00 00 (Card) ==> [Data(256)] 6100 (Card) <== 00 C0 00 00 00 (Card) ==>

what is secure box in smart card and what is role?

若如初见. 提交于 2019-12-11 02:34:55
问题 What is secure box in smart card? And any smart card have secure box? What is secure box access control policy? And how do I check the TOE shall explicitly deny access of subjects to objects based on the following additional rules: For S.SBNative Code it shall not be possible to perform OP.SB_ACCESS to O.NON_SB_CONTENT OP.SB_ACCESS : Any read, write or execution access to a memory area S.SBNative : Is the native code library residing in the Secure Box O.NON_SB_CONTENT : Any code and data

Generate random number bounded between two numbers in Java Card

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 02:17:30
问题 How to generate random number bounded between two number in Java Card? For example number should be generated between 0 and 50. 回答1: Note that I have only tested the distribution of the random numbers using SecureRandom within Java SE. I'm reasonably sure that this code is correct though. The code uses the "simple reject" method defined by NIST. So without further ado, the code. package nl.owlstead.jcsecurerandom; import javacard.framework.JCSystem; import javacard.framework.Util; import

How to add JavaCard packages to JavaCard applet?

大城市里の小女人 提交于 2019-12-11 00:47:41
问题 I am trying to build a simple Hello world JavaCard applet.I am using NetBeans IDE. I am following this tutorial. Here is my code: package classicapplet1; import javacard.framework.*; import java.rmi.Remote; import javacard.framework.service.Dispatcher; import javacard.framework.service.RMIService; import javacard.framework.service.Service; public class JavaCardApplet extends Applet { HelloWorld hello; Dispatcher disp; Service svc; public static void install(byte[] bArray, short bOffset, byte

Can a JavaCard emulate a MIFARE Ultralight or NTAG NFC tag?

我与影子孤独终老i 提交于 2019-12-10 19:28:24
问题 I would like to write a Java Card applet that responds to an NFC reader as if it was a regular MIFARE Ultralight or NTAG NFC tag. I am aware the MIFARE protocol is proprietary and may be a little more difficult but surely I should be able to achieve emulation of the NTAG protocol. If I match the NTAG specification and respond to the correct APDUs then I can surely emulate an NTAG? Update to original question I think I asked my original question incorrectly. I'm not looking to emulate a