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

Add and document app-init helper script #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BryanJacobs
Copy link

I'm well aware this repository hasn't been updated in five years, and I can see a valid-looking PR already open to fix a bug, so I don't anticipate this PR will be merged. Nonetheless I hope this will help someone who uses the working code in this repository.

The applet here can generate HMAC challenge-response codes on a JavaCard that isn't a Yubikey. When you set it up that way, you need to get the "slot config" - the HMAC secret - into the applet somehow.

This pull request contains a simple Python script that will emit the correct ADPUs to program an arbitrary JavaCard with an HMAC secret of the user's choice. I had to learn ISO7816 to write this script; perhaps with it in hand, someone else can skip that journey of discovery and make easier use of their own smartcard.

Documentation for the use of the script is also included.

@jkingsman
Copy link

Thanks so much for this!

I had trouble getting Python to behave with

with open(0, 'rb') as f:
    raw_key = f.read(20)

so I just had it read from random directly and replaced that block with

import os
raw_key = os.urandom(20)

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

Successfully merging this pull request may close these issues.

None yet

2 participants