Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin question #1

Open
achapkowski opened this issue Mar 23, 2018 · 4 comments
Open

Pin question #1

achapkowski opened this issue Mar 23, 2018 · 4 comments

Comments

@achapkowski
Copy link

If I have a user pass their pin like 1234, will this package convert it to it's bytes format? The example is unclear.

@cspensky
Copy link
Collaborator

Programmatically you would do the following:

PIN = [0x31, 0x32, 0x33, 0x34, 0x00, 0x00, 0x00, 0x00] # 1234
data, sw1, sw2 = card.apdu_verify_pin(PIN, 0x00)

Honestly it's been a while since I looked at the spec, but I believe you just append 0's to ensure that you always send an 8 digit PIN. Let me know if this isn't working for you.

@dplaniel
Copy link

dplaniel commented Nov 9, 2022

So is the expectation that the user hard-codes their PIN in plaintext into the script?
Isn't that insane?

@dplaniel
Copy link

dplaniel commented Nov 9, 2022

examples/cac_crypto.py allows the user to pass the pin as a command line argument, but having your PIN in plaintext in your bash history is scarcely better, right?

@cspensky
Copy link
Collaborator

cspensky commented Nov 9, 2022

This library is for exploring smartcard functionality, not for production use. We assume the users of the library know what they are doing. You are free to augment the library anyway you see fit to protect your own PIN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants