apdu

En-/Decryption output in Java Card + corresponding APDUs

风流意气都作罢 提交于 2019-12-22 09:43:32
问题 I'm new to the whole topic of Java Card and tried to look at a few code examples to get a better understanding. I found a sample for AES usage in the oracle forum but have a few problems with the following part: private void doAES(APDU apdu) { byte b[] = apdu.getBuffer(); short incomingLength = (short) (apdu.setIncomingAndReceive()); if (incomingLength != 24) ISOException.throwIt(ISO7816.SW_WRONG_LENGTH); //perform encryption and append results in APDU Buffer a[] automatically cipherAES.init

ePassport reading with PN532, Keep Getting SW1 SW2 = 0x69 0x88 (Incorrect Secure Messaging Data Objects)

强颜欢笑 提交于 2019-12-22 09:28:53
问题 I'm trying to read the EF.COM file from an ePassport (a.k.a MRTD). What I have successfully done: -Selected the ePassport application using the AID 0xA0,0x00,0x00,0x02,0x47,0x10,0x01 -Requested a challenge nonce from the epassport chip -Successfully authenticated by responding to that challenge as per doc9303 appendix 5. Doc 9303 can be viewed here: http://www.icao.int/publications/Documents/9303_p1_v2_cons_en.pdf It worked and now I am attempting to read the EF.COM file using the secure

libnfc with ACR122U gives no response on SELECT (by AID) APDU

我的未来我决定 提交于 2019-12-22 04:42:55
问题 See NFC reader "SELECT (by AID)" APDU is not routed to Android device on debugging and eventual results. TL;DR the reader might simply be defunct. I have ACR122U nfc reader. I try to run this example http://www.nfc-tools.org/index.php?title=Libnfc:APDU_example#apdu_example.c on my Ubuntu machine. This is the log output I get when I tap my Android device (should be in HCE mode) to the reader: ./apdu_example debug libnfc.general log_level is set to 3 debug libnfc.general allow_autoscan is set

authentication error for mifare card “6982:Security status not satisfied”

这一生的挚爱 提交于 2019-12-21 23:52:43
问题 I know. This question asked before under same tag and same name here. But the answers are useless for me. and i opened again for real answers. I have pc/sc reader and Contactless card(mifare card), I can connect to the card and also I execute getdate command successfully, but when I want to authenticate I see this error "6982:Security status not satisfied" I've tried these 4 different commands for authentication but I get the same error for all of them. FF 88 00 00 06 FF FF FF FF FF FF FF 88

Use APDU commands to get some information for a card

橙三吉。 提交于 2019-12-21 21:21:34
问题 I have a terminal that has its own API to stablish and send commands between chip and terminal, there is a function that transmits the APDU command and returns the answer in a byte array. For example, if a want to read the tag 5A (Application PAN), I send the following command: byte[] byteArrayAPDU = new byte[]{(byte)0x00, (byte)0xCA, (byte)0x00, (byte)0x5A}; int nResult = SmartCardInterface.transmit(nCardHandle, byteArrayAPDU, byteArrayResponse); The variable byteArrayResponse gets the

Parse CV Rule from CVM List for EMV

房东的猫 提交于 2019-12-21 04:51:36
问题 I have succesfully retrieved the CVM List from EMV card. 0000 0000 0000 0000 4103 4203 1E03 1F02 From the EMV specification book 3, the first 4 bytes and second 4 bytes are amount and rest is CV rules. Making these the CV Rule 4103 4203 1E03 1F02 The book also shows how to parse the CV rules, as shown below: I am assuming that I need to convert the first two bytes in a CV rule to binary and match with the table above? But why does the table above have empty cells? Also can someone explain in

generate AC cryptogram manually

ぐ巨炮叔叔 提交于 2019-12-21 03:16:32
问题 I am trying to generate AC manually, I have a tool to generate AC but I want to generate it by my own to understand the algorithm for the same. My calculation is fine for Discover card but it is failing for MasterCard. As per my understanding, data used to generate AC is depend on Tag 8C - CDOL1 which we provide to card with Gen AC command + AIP + ATC. AIP and ATC - accessed internally by ICC. Data used to generate AC is:- data part of Gen AC command + value of tag 82 + value of tag 9f36 + 80

generate AC cryptogram manually

眉间皱痕 提交于 2019-12-21 03:16:03
问题 I am trying to generate AC manually, I have a tool to generate AC but I want to generate it by my own to understand the algorithm for the same. My calculation is fine for Discover card but it is failing for MasterCard. As per my understanding, data used to generate AC is depend on Tag 8C - CDOL1 which we provide to card with Gen AC command + AIP + ATC. AIP and ATC - accessed internally by ICC. Data used to generate AC is:- data part of Gen AC command + value of tag 82 + value of tag 9f36 + 80

How can I check INITIALIZE UPDATE and EXTERNAL AUTHENTICATE correctness?

微笑、不失礼 提交于 2019-12-20 15:32:11
问题 I sent 80 50 00 00 08 00 00 00 00 00 00 00 00 [ INITILIZE UPDATE Command] via opensc-tool to my java card and received 00 00 11 60 01 00 8A 79 0A F9 FF 02 00 11 79 11 36 5D 71 00 A5 A5 EC 63 BB DC 05 CC [ Init Response ] as its response from the card. As you see: In the command,I send 00 00 00 00 00 00 00 00 as Host Challenge , And in the response : 00 00 11 60 01 00 8A 79 0A F9 = Key diversification data FF 02 = Key information 00 11 79 11 36 5D 71 00 = Card challenge A5 A5 EC 63 BB DC 05 CC

Process method does not receive full APDU command from host?

◇◆丶佛笑我妖孽 提交于 2019-12-19 09:53:52
问题 The host sends the following command to applet to select EF file 00 A4 02 00 02 40 01 The purpose is to select EF file with ID 40 01 (which is specified in the data field of the command). But when I debug the process(APDU apdu) method, the APDU buffer only contains the 5 first bytes 00 A4 02 00 02 . The data field is set to 00 00 . So my applet cannot select the EF using EF ID. Could you tell me what is wrong with my APDU command above? 回答1: Depending on the card (or emulator), the APDU