Coder Social home page Coder Social logo

parktang-legic's Introduction


Copyright (C) 2019 LEGIC (R) Identsystems AG, CH-8623 Wetzikon Restricted use for HSLU Hackathon 2019. All rights reserved!

The modules LEGIC_SM6300_Signature and DigitalSignature should contain all functions you need to know for the Hackathon.

Dependencies:

  • python >= v3.5: uses builtin bytes and hex

Site-Packages:

  • pyserial (latest): for serial communication with LEGIC SM6300
  • ecdsa (latest): for signature verification

Use LEGIC_SM6300_Signature (LEGIC_SM6300_Signature.py) to create signatures using LEGIC SM6300 chip. The SM6300 will create signatures with the pre-loaded private key. Create digital-signatures:

signature = LEGIC_SM6300_Signature('/dev/ttyUSB0').create(b'your data')

Use DigitalSignature (DigitalSignature.py) to verify signatures created with LEGIC SM6300. Verify digital-signature:

valid = DigitalSignature.verify(b'your data', signature, pub_pem_path='public_key.pem')
assert valid is True

Make sure you use the correct public-key for the verification. The LEGIC USB-Stick (EVS) should be already labeled with its unique chip ID. The class LEGIC_SM6300 will print the chip ID to the console on every successful connect(). The corresponding key files are located under './keys/_public.pem' e.g. the public key for Chip-ID: "LEGIC-SM6300-1D37BCF9A62CBF08" is './keys/LEGIC-SM6300-1D37BCF9A62CBF08_public.pem'

Checkout main section in LEGIC_SM6300_Signature for example calls.

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.