GithubHelp home page GithubHelp logo

mitshell / card Goto Github PK

View Code? Open in Web Editor NEW
144.0 144.0 53.0 148 KB

Facilitates communications with telco smartcard (especially SIM and USIM)

Home Page: http://michau.benoit.free.fr/

License: GNU General Public License v2.0

Python 100.00%

card's People

Contributors

laf0rge avatar mitshell avatar p1-bmu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

card's Issues

Port the code to Python3

I used 2to3 to port the files to Python3.
That would generate a big PR. You may want to use 2to3 on your side instead to not have to review a big patch.

I was able to make the code work fine on both Python 2 and Python 3. But maybe you want to drop Python 2 support to ease the maintenance.

If you need more help just tell me.

Reading sysmocom ISIM cards and is not working.

I use this module in some applicatons i have done, and I was trying to use it with sysmocom ISIM, and when i try to select USIM application to read the IMSI or to do an authenticate operation, it fails:

root@ubuntu:/home/fabricio/Documents#python3
Python 3.8.10 (default, Jun 2 2021, 10:49:15)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from card.USIM import *
a = USIM(0)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.8/dist-packages/card-0.3-py3.8.egg/card/USIM.py", line 195, in init
File "/usr/local/lib/python3.8/dist-packages/card-0.3-py3.8.egg/card/USIM.py", line 205, in SELECT_ADF_USIM
File "/usr/local/lib/python3.8/dist-packages/card-0.3-py3.8.egg/card/ICC.py", line 1244, in select
File "/usr/local/lib/python3.8/dist-packages/card-0.3-py3.8.egg/card/ICC.py", line 1594, in parse_file
File "/usr/local/lib/python3.8/dist-packages/card-0.3-py3.8.egg/card/ICC.py", line 728, in parse_file
File "/usr/local/lib/python3.8/dist-packages/card-0.3-py3.8.egg/card/ICC.py", line 788, in parse_FCP
File "/usr/local/lib/python3.8/dist-packages/card-0.3-py3.8.egg/card/ICC.py", line 940, in parse_compact_security_attribute
NameError: name 'self' is not defined

Using this slightly modified version https://github.com/sysmocom/sysmo-usim-tool/tree/master/card it works:

root@ubuntu:/home/fabricio/Documents# cd sysmo-usim-tool/
root@ubuntu:/home/fabricio/Documents/sysmo-usim-tool# python3
Python 3.8.10 (default, Jun 2 2021, 10:49:15)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from card.USIM import *
a = USIM(0)
a.get_imsi()
'901700000050900'

A littile bug in readme

Hi,

I found a little bug in the "USIM" example in readme.

It's in the "In [4]: ", I think the correct version is:

u.interpret_AID(u.AID_USIM)

Best wishes!

Wrong URL in setup.py

The URL in setup.py:

url="http://michau.benoit.free.fr/codes/smartcard/",

now reports Erreur 403 - Refus de traitement de la requête (Interdit - Forbidden)

sim swap

are u able to sim swap with this or port numbers? USA

5GS EF5GS3GPPLOCI Unable to read it

I have tried to read following information from SIM card:
image

To be more precise reading 4F01 but it always returns me empty values? Any advise how to read this field and if its supported by card tool at all?

verify/change PIN on a VISA

Hello,

Can you please help me how could I verify/change PIN on a VISA?

Thanks

Outgoing APDU (13 bytes):
00 20 00 01 08 31 31 31 31 31 31 31 31 . ...11111111

Incoming APDU (2 bytes):
6D 00 m.

iso7816.c:121:iso7816_check_sw: Instruction code not supported or invalid

Unable to verify PIN code: Unsupported INS byte in APDU

Multi-Byte length handling is wrong

The condition:

Length coded with more than 1 byte

if bytelist[i+1] > 0x50:

is wrong. The extended length is indicated in bit 0x80 and the rest then is either the amount of octets needed to describe the length or uses the indefinite length. The issue can be seen by using USIM with the sysmoUSIM-SJS1 card.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.