https://github.com/fabiangroeger96/parktang-legic
HSLU IoT & Blockchain Hackaton
https://github.com/fabiangroeger96/parktang-legic
blockchain digitalsignature hackathon hslu iot
Last synced: about 1 month ago
JSON representation
HSLU IoT & Blockchain Hackaton
- Host: GitHub
- URL: https://github.com/fabiangroeger96/parktang-legic
- Owner: FabianGroeger96
- Created: 2019-09-14T06:42:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-14T06:44:37.000Z (over 5 years ago)
- Last Synced: 2025-01-28T21:35:14.970Z (3 months ago)
- Topics: blockchain, digitalsignature, hackathon, hslu, iot
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
-----------------------------------------------------------------------------
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 hexSite-Packages:
- pyserial (latest): for serial communication with LEGIC SM6300
- ecdsa (latest): for signature verificationUse 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 TrueMake 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.