javacard

ECDSA Signature in Javacard

只谈情不闲聊 提交于 2019-12-10 17:53:11
问题 I'm implementing the signing code using ECDSA in Javacard. My code outputs 0x0003(NO_SUCH_ALGORITHM) in exception part which means this card does not support the algorithm. I don't understand that because my vendor told me that it supports ECC. I concluded I don't know how to sign with ECDSA and I want to know that. Here is my full source code package MyECDSA; import javacard.framework.*; import javacard.security.*; import javacardx.crypto.*; public class MyECDSA extends Applet{ private byte[

Restricted elliptic curves in Java Card

给你一囗甜甜゛ 提交于 2019-12-10 13:58:45
问题 I am trying to implement cryptographic algorithms on elliptic curve in Java Card. First, I implemented it on 256bits elliptic curve (the NIST one) and it worked well. Now I want to test it on a 512bits curve (and not 521 like the NIST one). My card support this size and I found a database of elliptic curves (well defined for cryptography) of this size. But I am encountering a strange problem... When I try to initialize my key: ECPublicKey pubKey = (ECPublicKey) KeyBuilder.buildKey( KeyBuilder

Java Card applets, secure data transmission and Secure Channel

馋奶兔 提交于 2019-12-10 08:11:44
问题 I want to write my applet in a way that its APDU commands and status words wasn't be clear in the transmission channel between my card and my reader. I mean I don't want to send APDU commands and responses to be plain text for third parties. I think I have two option : After selecting my applet on the card, for all the other commands, do an encryption function on the data section of APDU commands and decrypt them on the card and after that analyze them. Note that I can't encrypt whole the

Javacard beginner - questions

你说的曾经没有我的故事 提交于 2019-12-10 00:12:31
问题 first of all i want to let you know that i am new regarding javacards. I am in the research phase of writing a javacard applet and i have some questions which suprisingly are not so easy to answer through google-search. I want to create an android application which triggers a javacard application via NFC. So far i established a connection to the card with IsoDep. Lets say i have a cap-file. How do I put/install it on an actual javacard? (Do i need a card reader/writer with PC/SC? Which ones

Some questions about SELECT APDU command in Javacards

痴心易碎 提交于 2019-12-09 20:49:21
问题 The quoted below passage is a part of an article that named How to write a Java Card applet: A developer's guide and written by Zhiqun Chen. I saw it here Once an applet is selected, the JCRE forwards all subsequent APDU commands (including the SELECT command) to the applet's process() method. In the process() method, the applet interprets each APDU command and performs the task specified by the command. For each command APDU, the applet responds to the CAD by sending back a response APDU,

Installing applet in javacard

夙愿已清 提交于 2019-12-09 11:36:41
问题 I made a .cap file of the popular "Hello World" javacard code via Eclipse And now I want to load it in a real javacard via GPShell and ACR38 smart card reader. question: Am I need any key to load the .cap file in the card? I mean, should I authenticate before uploading my applet in the card or it's not necessory? I think it is mndatory to authenticate. it is irrational to upload .cap without authentication. but I don't know , how to authenticate. question: What's wrong in this? C:\Users

Using SAM modules for storing secure keys

旧街凉风 提交于 2019-12-08 15:29:23
问题 As i understand SAM modules are kind of SMART Cards which connect to the MCU via ISO 7816 protocol. Is there any other application for them except storing secure keys? Can I used usual mobile sim-cards instead of SAM module to storing keys? As i know when we store keys in the SAM module ,it is almost impossible to retrieve the keys, & SAM used a sequence of random challenge & polyphase authentication to verify the card.Then how SAM send this verification to MCU?is there direct access between

Smartcard reader naming: when removing any reader, the name of the rest changes

我只是一个虾纸丫 提交于 2019-12-08 14:37:42
问题 I am writting a smartcard application. This application connects card in reader and sometimes works with it. I need to watch when reader is no longer available (either card is ejected or reader is removed from USB). Readers are watched using SCardStatusChange. This function requires reader name to watch. I insert two readers with cards into USB slots. They are recognized as "USB Smart Card Reader 0" and "USB Smart Card Reader 1". I remove one reader. Windows says, "USB Smart Card Reader 1" is

read records failed on real smart card

喜夏-厌秋 提交于 2019-12-08 08:32:40
问题 I develop an applet which return some simulate bytes data(6 bytes) when it receive Read Records command from host application. I test applet with JCIDE, it work well. I also test it with virtual card reader by using pyApdutool, it work well too. But when I install applet on a card by using pyApdutool, use the same Read Records command, the card return "Unknown error" message. But when I don't set data in respond, the card return "90 00" message. apdu.setOutgoingAndSend((short) 0, (short)0)

Why I can't receive APDU buffer contents?

笑着哭i 提交于 2019-12-08 07:42:49
问题 I wrote the following program to return all the APDU buffer contents on reception of each APDU command: package testPack; import javacard.framework.APDU; import javacard.framework.Applet; import javacard.framework.ISOException; public class BufferReturner extends Applet { private BufferReturner() { } public static void install(byte bArray[], short bOffset, byte bLength) throws ISOException { new BufferReturner().register(); } public void process(APDU arg0) throws ISOException { if