Skip to content

iaiting/iso7816

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iso7816

This project is direct python-wrapper of the lib "libpcsclite.so". It allows to use card-reader which connected throught USB and send/receive APDU data to communicate with smart-cards based on ISO7816.

The capabilities:

  • get and analyze ATR
  • transmit APDU
  • get attributs of smart-card

Keywords

  • smart-card
  • ISO7816
  • PC/SC

Additional info

pcsc-lite

pyscard

pyResMan

How to use cli

  • $sudo apt install pcsc-tools
  • $sudo apt install pcscd
  • $pcscd

Example:

// connect card-reader to PC

// insert smart-card to card-reader

import iso7816

my_card = iso7816.Iso7816()

reader = my_card.get_readers()  # get avaible readres

my_card.connect(reader[0])      # connect to the first reader

print my_card.get_atr()         # get ATR (Answer To Reset)

rx, sw1, sw2 = my_card.transmit('80 90 1B 13') # send data '80 90 1B 13' to smart-card and get answer

or

rx, sw1, sw2 = my_card.transmit([0x80, 0x90, 0x1B, 0x13]) # send data [0x80, 0x90, 0x1B, 0x13] to smart-card and get answer

How to use gui

run scgui.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%