mitshell / card Goto Github PK
View Code? Open in Web Editor NEWFacilitates communications with telco smartcard (especially SIM and USIM)
Home Page: http://michau.benoit.free.fr/
License: GNU General Public License v2.0
Facilitates communications with telco smartcard (especially SIM and USIM)
Home Page: http://michau.benoit.free.fr/
License: GNU General Public License v2.0
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'
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.
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!
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 . ...11111111Incoming 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
I suggest to rename README.txt
in README.md
to get a nicer rendering of the file.
You will have to modify the file a bit to follow the markdown syntax but it is easy.
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)
are u able to sim swap with this or port numbers? USA
The condition:
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.