Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/russss/python-emv
EMV Smartcard Protocol Tool and Library
https://github.com/russss/python-emv
banking chip-and-pin credit-card emv emv-smartcard-protocol python python-3 smartcard
Last synced: 3 days ago
JSON representation
EMV Smartcard Protocol Tool and Library
- Host: GitHub
- URL: https://github.com/russss/python-emv
- Owner: russss
- License: mit
- Created: 2016-12-20T16:10:14.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-03-20T17:01:33.000Z (7 months ago)
- Last Synced: 2024-09-24T12:07:04.183Z (9 days ago)
- Topics: banking, chip-and-pin, credit-card, emv, emv-smartcard-protocol, python, python-3, smartcard
- Language: Python
- Homepage:
- Size: 196 KB
- Stars: 116
- Watchers: 11
- Forks: 28
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
EMV for Python
==============![Tests](https://github.com/russss/python-emv/workflows/Tests/badge.svg)
A Pythonic implementation of the EMV smartcard protocol, which is used
worldwide for chip-and-PIN payments. This is intended to be readable,
tested, and heavily cross-referenced with the appropriate sections of the
[EMV Specification](http://www.emvco.com/specifications.aspx).This also includes an implementation of the `EMV CAP` (aka Pinsentry)
standard which is known to work for Barclays cards.Installation
------------You'll need the pcsc smartcard libraries on your system in order to build the
smartcard bindings. On Ubuntu:sudo apt-get install build-essential swig libpcsclite-dev python-pip python-devel
Then you can install emv from pip:
sudo pip install emv
To check if everything's working, plug in a smartcard reader, put a bank
card in, and run:emvtool info
If all goes well, you should see some data about your card.
Warning
-------Although this tool has been relatively well tested, it's technically possible
to block or even damage your card, as well as get in trouble with your card
issuer, using this tool. Please make sure you understand the risks.Commands marked in the `--help` output with [!] will initiate a transaction
on the card, resulting in a permanent change to the card's internal state
which could potentially be detected by your card issuer, particularly if you
initiate many transactions.Command Line
------------This library ships with `emvtool` - a simple command-line tool for testing
and CAP password generation. To fetch some card metadata, run:emvtool info
If you have more than one smartcard reader (or smartcard-like devices, such as a YubiKey)
connected, you may have to select a specific reader. List all the readers with:emvtool readers
Then use the `-r` option to select the specific reader ID, e.g.:
emvtool -r 1 info
To generate an EMV CAP one-time passcode:
emvtool -p cap
You can also conduct CAP signing and challenge-response:
emvtool -p cap -c
emvtool -p cap -c -aLegal Stuff
-----------`EMV` is a trademark of [EMVCo](http://www.emvco.com/) and is used
purely for descriptive purposes. This library is not affiliated with
EMVCo.