Questions tagged [pyscard]

pyscard - python smart card library is a python module adding smart cards support to python.

45 questions
27
votes
1 answer

how to create a sha1 hash in python

My objective is to perform "Hashsigning" using smart card in python. there are hashlib's used but there is no specific SHA1 or SHA256 functions in python. My Work: hash_object = hashlib.sha1(b'HelWorld') pbHash = hash_object.hexdigest() but the…
Swetha
  • 523
  • 1
  • 4
  • 11
19
votes
2 answers

How to send commands to smart card reader (and not to the smart card) while no card present?

Preface: I have a dual interface smart card reader that has some extended capabilities (other than sending APDU commands to card and receiving APDU responses). For example in its document it is mentioned that you can get firmware version of your…
Ebrahim Ghasemi
  • 5,850
  • 10
  • 52
  • 113
10
votes
1 answer

Authentication on website using smart card in python

So I have a smart card provided by the company which looks like a credit card with a chip. This card logins on a website after the card is inserted into the card reader. Now I have to write a program in python which can read the card and login on…
Anudocs
  • 686
  • 1
  • 13
  • 54
5
votes
1 answer

How to read certificate from smart card via python?

I have a Smart Card (actually USB Token) with some certificate and keys written on it. Now I need to retrieve this certificate using python on Windows. How can it be achieved? I had a look on pyscard package but it seems too low-level and probably…
fbjorn
  • 722
  • 12
  • 27
5
votes
1 answer

pyscard - windows - How to re-open connection to a smartcard (open/close/open again)

On windows 8.1, Python 2.7, pyscard(latest) i list readers from my software like so: for reader in readers(): print "list of readers:" print readers try: conn = reader.createConnection() …
NoobTom
  • 555
  • 1
  • 9
  • 21
4
votes
1 answer

Sending and receiving data using same T=1 APDU

I'm trying to send an APDU that contains some command data, and then expect some data in response from the card. I'm using this example code by Ludovic Rousseau as a starting to point (modified code below). The APDU I'm sending is the…
Joost
  • 4,094
  • 3
  • 27
  • 58
4
votes
3 answers

Extended APDUs and T=0/1 communication protocols

I have a JCOP V2.4.2 R3 java card that it is mentioned in its datasheet "The card support both T=1 and T=0 communication protocols" I have also an ACR38 smart card reader that it support both T=0 and T=1 protocols. (I have T=0 communication with one…
Jean
  • 687
  • 1
  • 9
  • 25
2
votes
2 answers

How to retrieve essential smart card info

I am using a simple smart card reader and am wanting to retrieve information that is stored on an EMV chip using the same reader. Currently, I found a library to do so, called pyscard, and it uses python. At the moment, I have managed to use the…
john_snow5214
  • 192
  • 1
  • 14
2
votes
2 answers

Install Pyscard in python 3.7

How to install pyscard on python 3.7? Are there other modules for smart card readers in python 3.7? the error after: pip install pyscard: ERROR: Command errored out with exit status 1: command:…
Yahel
  • 21
  • 1
  • 3
2
votes
1 answer

Can't read card with NFC/RFID reader through Python

I've bought a NFC card reader (ACS / ACR122U) that I plug in my raspberry 3 thru an USB port; I've installed swig, pcsc-tools, pcscd ,libpcsclite... The pcscd service is launched by systemctl and is bind to pcscd.socket. I can see the reader when I…
David
  • 492
  • 8
  • 17
2
votes
1 answer

Python ACR122U Poll

I was wondering if there is a way to poll an ACR122U in python and if so how? My script below gets the UID of a card but continuously runs. I know it runs because of while1 but it shows what i want to achive from smartcard.scard import * from…
shaggs
  • 600
  • 7
  • 27
2
votes
0 answers

JavaCard encrypt and decrypt function called from pyscard

I have a java card applet that implements encryption and decryption using RSA PKCS#1 with key CRT (Chinese Remainder Theorem) 1024. Here some of my code below: Constructor: private CryptoApplet() { generateKeyPair(); cipher =…
Leonardo
  • 31
  • 5
2
votes
3 answers

smartcard: pyscard get remaining bytes from apdu

I currently can use pyscard correctly to talk with my smartcard, however when the apdu size is above 255 bytes, i need to receive the remaining bytes for the command. What method gets me the remaining bytes in pyscard? To my understanding sw2 should…
NoobTom
  • 555
  • 1
  • 9
  • 21
1
vote
1 answer

Python pyscard control the buzzer of an NFC reader

I have two NFC reading devices: ACR12U and ACR1252U I have a short script in python using pyscard to read the UIDs of NFC tags: from smartcard.CardMonitoring import CardMonitor, CardObserver from smartcard.util import toHexString from…
Gábor Erdős
  • 3,599
  • 4
  • 24
  • 56
1
vote
0 answers

How to send peripheral commands to an ACS smart card reader with python and pyscard

I would like to programmatically control the buzzer of a smart card reader ACS ACR1281U-C1 but I am not sure to understand correctly how to use ESCAPE command for this. I use python 3.9.6 + pyscard 2.0.1. Windows 10 (x64). I have installed the ACS…
Baldorius
  • 11
  • 1
1
2 3