apdu | quick smartcard APDU read-evaluate-print loop shell | Telnet library
kandi X-RAY | apdu Summary
kandi X-RAY | apdu Summary
Type APDU commands as hex strings like 00 A4 0400 08 A000000003000000 00. Spaces are ignored unless theya are separating single numbers. Hexstring input 00 1 2 0304 is the same as 00 01 02 03 04.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of apdu
apdu Key Features
apdu Examples and Code Snippets
Community Discussions
Trending Discussions on apdu
QUESTION
So there is project idena.io, and community made ledger nano s app https://github.com/idelse/idena-ledger and when I run it normally I get this error
...ANSWER
Answered 2021-May-13 at 11:42Here just need to run one command I hope i it fixed it for someone
QUESTION
hello i'm working with APDU command for writting and reading a RFID card . I can read from the block num 2 and write a data of 16 bytes . but i have a problem in writting a longer data so how can i mange i have tried to write in two blocks but it doesnt work. this the way that i have implemented my code in the operation of writing
...ANSWER
Answered 2021-Apr-21 at 14:08You need to send each block separately. The Mifare Classic Write
command will only write one block at once.
See Section 12.3 of the Card's Data sheet
So RFTransmit the write command for the first 16 bytes to the first block and RFTransmit the write command for the second 16 bytes to the next block.
QUESTION
Hellow,
Hope you are doing great.
I am reading data from AHUs but while fetching the list of objects it gives an error:
segmentationNotSupported.
On sending WhoIsIAm (bacnet_scan.py
), I get this response:
ANSWER
Answered 2021-Apr-16 at 12:58Just because your client can (supposedly) support segmentation for "Both" directions - transmit & receive, the server/device/AHU doesn't.
So in order to read the full object-list, you have to fallback to looping thru the Object-List array - one element at a time.
Element/array-index 0 of the array (- the first element), contains the count of the number of data elements; for each element that you want to read - including the first one/element, you have to specify the target/desired element/index that you wish to read.
QUESTION
I'm trying to send my public key from my key pair in an APDU so that a signature can be verified in another program. So far I've not been able to find anyway to get the key into the APDU buffer.
I have found solutions online that use RSAPublicKey.getExponent()
to store the key in a byte array (then add it to the buffer) but as I'm not using an RSAPublicKey this has not been that helpful. Is this the only way to do it? Do I need to use RSAPublicKey instead of a key pair, or is there some way of putting the public key from my key pair into the APDU buffer?
This is my key generation code:
...ANSWER
Answered 2021-Feb-25 at 13:19I don't have a valid JavaCard IDE in front of me but something along the lines should work:
QUESTION
everyone, I'm developing a project with LTE 4G module and having a problem described as following:
- I write a SIM card application (with Java tech) and download it into the SIM Card.
- After downloading the applet, inert the SIM card into a card reader, then I can send APDUs to the applet through this card reader. applet works fine ,it accepts the APDU and gives the response back.
- After finishing the APDU test , I insert the SIM card to the LTE 4G module ,and send AT+CCHO="A0BB01020304050001"(A0BB01020304050001 is my applet DF name) through uart to open the applet, the 4G module returns +CME ERROR: 15(SIM Wrong).But some other original applet(such as USIM) in the card can be opend normally in this way.
so,does anyone know whether there are some key points I have to pay attention to my applet or the AT+CCHO command? I'll be very appreciated and willing to give what all I have.
...ANSWER
Answered 2021-Feb-19 at 08:25Ok,finally it proved that no matter what you sent to the App through CGLA, the App must gave back something to the 4G module, otherwise the module released +CME ERROR: 15.
QUESTION
I'm trying to write to a Mifare Ultralight NFC but I get this error:
...ANSWER
Answered 2021-Feb-09 at 14:36Yes you are doing something wrong, A Mifare Ultralight is not a ISO7816 capable card.
If you look at https://developer.apple.com/documentation/corenfc/nfcmifaretag/3153114-sendmifareiso7816command
It says
Use this method to send commands to tags that have a mifareFamily value of either NFCMiFareFamily.plus or NFCMiFareFamily.desfire.
You cannot send a Mifare Ultralight APDU's, some of the Mifare cards like the desfire are multi standard cards.
Update:
Tag connection lost quite often mean that the card has a error and it goes in to the HALT state and no further comms can be made to the card until it is reset by usually going in and out of the RF field.
In your original question you say
I'm writing to a custom device where the value "0xFF" means a write request.
But you seem to be sending it 0xF0
instead which is different and might not be a valid command to it.
QUESTION
I am developing an android application creating NFC card ID. I can get info from scanned NFC cards by phone. But I can't create them with my app. First, I tried to do that with this method. Then, I realized need to have Tag object and tried to save it in different ways. Although it didn't work.
Secondly, I found this from android documentations. Then, I tried to do with HostNfcFService and HostApduService. To use them I created XML files and service classes like below;
nfcfservice.xml:
...ANSWER
Answered 2021-Feb-07 at 14:25I think your problem is that the MFRC522 RFID reader is a very basic/old design and really only supports MIFARE type cards (which are the non standardised original card format). While Host Card emulation uses ISO/IEC 14443A (mostly) as a base it uses other higher level protocols to emulate a NFC Type 4 card which is not supported by that card reader.
If you look at an Arduino library for the reader https://github.com/miguelbalboa/rfid#troubleshooting
My mobile phone doesn't recognize the MFRC522 or my MFRC522 can't read data from other MFRC522
Card simulation is not supported.
Communication with mobile phones is not supported.
Peer to peer communication is not supported.
As the library suggest if you want more feature use a PN532 based modules instead.
If you look at an Arduino library for the PN532 https://github.com/Seeed-Studio/PN532#Features
Communicate with android 4.0+(Lists of devices supported)
QUESTION
I am currently working on adding auto-detection of KNX devices as part of the Apache PLC4X KNX drivers (Currently working on the Golang version). I have made great progress on inspection of KNX devices, but just encountered a situation where a device claims to have a Max APDU of 55 bytes, but when reading some memory, it only responds with Standard frames which can only carry 12 bytes of payload.
I would like to be able to detect in advance if the device is able to send more than 12 bytes. But I'm a bit unsure how to do that. The device descriptor is 0701 which indicates a BIM M112 device. Does this profile of devices have a fixed APDU size of 15? I have multiple devices with that same profile and they don't respond with a Max APDU (They return with a count of 0 implying "not available" or "not permitted") so I default to 15. This particular ABB device however responds with 55, but doesn't send more than 12 bytes (which is identical to having a Max APDU of 15).
Help greatly appreciated.
Chris
...ANSWER
Answered 2021-Feb-07 at 06:27Unfortunately, there are some legacy devices out there which in principle support MaxApduLength > 15, but have restrictions on specific services like Memory services limited to 12 bytes.
There is no specific discovery other than trial and error.
In any case you will have to implement a fallback to 15 bytes as the value reported in PID_MAX_APDU_LENGTH might be totally wrong (I've seen such devices...). Also, there might be couplers between the interface and the target device further restricting the usable APDU length.
QUESTION
I'm trying to implement the functionality for emulating a Mifare One (1K/S50, ISO14443A) chip to be able to use a phone with NFC capability instead of a physical Mifare card or, if possible sending only the data to the reader.
I have this type of reader/writer: https://www.evelta.com/er302-high-frequency-nfc-writer-usb/
After looking around on forums, stackoverflow questions I found this article to be the best example:
I implemented the HCE part, run the program, and the reader beleives my phone is a Mifare chip, so far so good.
My problems:
No matter what "standard" Authentication key I tried to use...it gives me Auth error. I read this question about Auth: Authentication failure for Mifare 1K NFC tag using ACR122U NFC reader, it works on a physical Mifare card...but I don't know how to set or get to know the keys for the emulated one.
I don't get why this example emulates that exact Mifare chip type...even breakpoints don't work in the APDUService, but the reader detecting a Mifare cheap somehow.
After reading about it, I get I can't 100% emulate a physical card, so I have to send all the data I want in my APDU response with the service somehow (I beleive it's the transreceive part).
However I can't even authenticate.
I tried to look for other possible solutions:
AndroidBeam: Android - Android p2p...sounds simple, relatively high-level API, but it's being deprecated, moreover it's not guaranted that the reader will even use Android...it might be a 'simple' USB reader hardware like the one I use.
SecureElement: Ironically...it seems to be the most recommended, I read that 'yes, it's possible for mifare' and things like that, yet I couldn't find a good example of it and the official Google docs don't have any good example. I read that it's for "ISO/IEC 7816-4", but Mifare 1K is ISO14443A, so I'm a bit sceptic about this API.
"Simply" sending the data to the reader: If I could just simply "push" the data out to the reader when it's reading the phone without complicating the matter or emulating anything...it would be great but I don't know if it's even possible. This whole NFC topic seems to be more and more complex.
So alltogether I only need to do one thing: taking the data and send it to the reader.
I realized it's a fairy tale like illusion to beleive it's as simple as it sounds, still, I hope there is a way to do it.
If I could send the data in it's own, without emulating Mifare or anything...after all what matters is that the data on the card, not the type of the chip, the more simple the solution will be, the better.
Sorry for possible English grammar mistakes.
...ANSWER
Answered 2021-Jan-21 at 20:08The problem is you cannot use HCE on Android to emulate a Mifare Classic 1K (https://www.nxp.com/docs/en/data-sheet/MF1S50YYX_V1.pdf) as this is a custom Type NFC card. As HCE is about emulating Type 4 cards. See https://developer.android.com/guide/topics/connectivity/nfc/hce#SupportedProtocols
And the below image helps understand the type.
You can see this from it's datasheet, nowhere does it talk about AID's and standard Type 4 NFC commands
Though Type 2 and Type 4 can share the Anti Collision mechanism and Reading the UID (which is part of the process) any other access methods are not shared.
Type 4 Spec for reference is at http://apps4android.org/nfc-specifications/NFCForum-TS-Type-4-Tag_2.0.pdf
I have seen some USB readers that offer on reader emulation of other card types but not HCE where the host does the emulation not the NFC hardware.
The Authentication on Type 4 Cards or emulated ones is handled differently.
You can emulate a MIFARE DESFire Card as that is a Type 4 card.
The specs of your card reader are not documented well and it looks very "lite" and that it does not support any of the higher level protocols needed to talk to non Mifare Classic cards. It could support them but as Mifare protocol was the original spec, it could be possible for it to be and old design and only support the Mifare protocol.
QUESTION
I'm going to delete an existent key from my card's ISD. To do so I sent a DELETE Key APDU command with corresponding KeyID and KeyVersion to the ISD after a successful Mutual Authentication as below:
...ANSWER
Answered 2020-Dec-27 at 13:47Some card are simply not supporting it. As alternative you can rotate the keys to a random value.
The tag for key templates is 00E0. You can use this with GET DATA. E.g. GPShell provides the command
get_key_information_templates -keyTemplate index
. Use 0 as index. This output returns a more readable list.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install apdu
You can use apdu like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page