Code Monkey home page Code Monkey logo

ll-smartcard's Introduction

         _      _          _____                      _    _____              _  
        | |    | |        / ____|                    | |  / ____|            | | 
        | |    | |  _____| (___  _ __ ___   __ _ _ __| |_| |     __ _ _ __ __| | 
        | |    | | |______\___ \| '_ ` _ \ / _` | '__| __| |    / _` | '__/ _` | 
        | |____| |____    ____) | | | | | | (_| | |  | |_| |___| (_| | | | (_| | 
        |______|______|  |_____/|_| |_| |_|\__,_|_|   \__|\_____\__,_|_|  \__,_|

                Authors: Chad Spensky ([email protected])
                           Hongyi Hu ([email protected])

Contents

  • examples/ Some example scripts on how to use the library to interact with various smartcards

  • docs/ Contains some useful documents when working with smart cards that define some of the APDUs and RIDs.

Install

  • Install pyDes python library

  • Install pyscard python library

  • Install PC/SC

    $ sudo apt-get install pcsc-tools pcscd

  • To install all of these just run:

    $ ./install_dependencies.sh

Usage

  • For developing your own smart card application using llsmartcard, see template.py

  • See examples/

Certificates

This section discusses how to work with the certificates on the CAC.

  • Extract Certificates python cac_crypto.py -x test

  • Working with certs (Referenced from here).

  • Encrypt

$ openssl pkeyutl -encrypt -in -pubin -inkey [input public key] -out [output file]

  • Extract Public Key

$ openssl x509 -inform DER -pubkey -in [input certificate] > output.key

  • Example using certs:

    $ echo "Hello World!" > input.txt

    $ python cac_crypto.py -E -k test/cac/cac_pki_enc.pub -i input.txt -o input_encrypted.ssl

    $ python cac_crypto.py -D -i input_encrypted.ssl -c KEY_PKI_ENC -o input_decrypted.txt -p 77777777

Notes

  • Certificates are returned in gzipped form.

$ gunzip [cert.gz]

  • Certificates are in DER form

$ openssl x509 -inform DER -in [cert] $ openssl x509 -issuer -email -startdate -enddate -inform DER -in [cert] $ openssl x509 -inform DER -noout -text -in [cert]

Citation

Please use this DOI number reference, published on Zenodo, when citing the software:
DOI

Disclaimer

This work is sponsored by the Defense Information Systems Agency under Air Force Contract #FA8721-05-C-0002. Opinions, interpretations, conclusions and recommendations are those of the author and are not necessarily endorsed by the United States Government.
© 2015 Massachusetts Institute of Technology

ll-smartcard's People

Contributors

cspensky avatar gusmann avatar hhu-work avatar rlbellaire avatar

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.