All Projects → obrassard → shc-extractor

obrassard / shc-extractor

Licence: MIT License
Extract the JSON payload from SHC QR codes (i.e Québec Covid Vaccination QR Codes)

Programming Languages

javascript
184084 projects - #8 most used programming language
Handlebars
879 projects
CSS
56736 projects

Projects that are alternatives of or similar to shc-extractor

covidpass
Scan your vaccination, test and recovery certificates in QR code representation and save them to your Apple Wallet
Stars: ✭ 137 (-13.84%)
Mutual labels:  qr-code, vaccination, covid, covid19, vaccination-pass
impf-bot
💉🤖 Bot for the German "ImpfterminService - 116117"
Stars: ✭ 167 (+5.03%)
Mutual labels:  vaccination, covid, covid19
CoWin-Vaccine-Notifier
Automated Python Script to retrieve vaccine slots availability and get notified when a slot is available.
Stars: ✭ 102 (-35.85%)
Mutual labels:  vaccination, covid, covid19
CoronaVirusOutbreakAPI
A tiny and small program to crawler and analyze outbreak of COVID-19 in world and every country using PHP.
Stars: ✭ 20 (-87.42%)
Mutual labels:  covid, covid19
SPREAD
Spread visualizes how viruses and other pathogens are spreading in time and space. It creates compellable shareable, interactive and time-animated visualization.
Stars: ✭ 9 (-94.34%)
Mutual labels:  covid, covid19
coviddata
Daily COVID-19 statistics by country, region, and city
Stars: ✭ 49 (-69.18%)
Mutual labels:  covid, covid19
COVID-19-historical-data-visualization-2019-nCoV-
使用BlankerL提供的数据仓库实现的新型冠状病毒疫情数据可视化
Stars: ✭ 47 (-70.44%)
Mutual labels:  covid, covid19
data2019nCoV
COVID-19 Pandemic Data R Package
Stars: ✭ 40 (-74.84%)
Mutual labels:  canada, covid
rid-covid
Image-based COVID-19 diagnosis. Links to software, data, and other resources.
Stars: ✭ 74 (-53.46%)
Mutual labels:  covid, covid19
covid19twtbot
A Twitter bot that automatically replies to tweets requesting COVID related resources with links containing information about the availability.
Stars: ✭ 18 (-88.68%)
Mutual labels:  covid, covid19
austria-covid-data
Hourly mirror from data.zip containing the Austrian Covid information
Stars: ✭ 17 (-89.31%)
Mutual labels:  covid, covid19
covid-19
COVID-19 World is yet another Project to build a Dashboard like app to showcase the data related to the COVID-19(Corona Virus).
Stars: ✭ 28 (-82.39%)
Mutual labels:  covid, covid19
covid-xprize
Open-source repository containing examples and documentation for the Cognizant XPRIZE Pandemic Response Challenge
Stars: ✭ 36 (-77.36%)
Mutual labels:  covid, covid19
vaccipy
Automatische Impfterminbuchung für www.impfterminservice.de
Stars: ✭ 548 (+244.65%)
Mutual labels:  vaccination, covid
cowin-vaccine-booking
The app enables tracking coivid vaccine availability and automatically book a vaccination slot. This is based on Cowin API and supports the recently added Captcha code of Cowin.
Stars: ✭ 150 (-5.66%)
Mutual labels:  vaccination, covid19
covid-pass-verifier
🦠 Scan, parse and verify HCERT compliant government-issued COVID-19 passes.
Stars: ✭ 25 (-84.28%)
Mutual labels:  covid, covid19
quagga2-reader-qr
Quagga2 sample external reader for QR codes
Stars: ✭ 20 (-87.42%)
Mutual labels:  qr-code, qrcode-reader
covid-19-self-assessment
The tool takes the public through a series of questions to inform those who are concerned they may have contracted COVID-19.
Stars: ✭ 31 (-80.5%)
Mutual labels:  government, covid
COVID breakdown
COVID-19 statistics in Taiwan
Stars: ✭ 15 (-90.57%)
Mutual labels:  covid, covid19
corona tracker
COVID-19 tracking app - submission for https://wirvsvirushackathon.org/
Stars: ✭ 13 (-91.82%)
Mutual labels:  covid, covid19

shc-extractor

Extract and validate the JSON payload from SMART Health Cards QR Codes.

🚩 L'objectif de ce projet est le décodage des SHC. S'il vous plait, ne me sollicitez pas pour générer des codes QR personnalisés à partir d'un fichier JSON. Cela ne fonctionnera pas car la signature des codes QR personnalisés ne sera pas vérifiée par les applications de validation officielles

🚩The purpose of this project is SHC decoding. Please do not ask me to generate custom QR codes from a JSON file. It won't work since the signature of custom QR codes won't be accepted by official validation apps.

For more information please refer to FAQ about shc-extractor.


Introduction

Plusieur provinces et territoires canadien ont mis en place un système passeport vaccinal utilisant une preuve de vaccaination numérique (le fameux code QR) afin de luter contre la propagation de la COVID-19. Ces codes QR sont généré avec le protocole Smart Health Cards (https://smarthealth.cards), fonctionnant l'aide de JWT (un système de jeton numérique généralement utilisé pour l'authentification d'APIs qui permet d'empêcher la falcification des codes QR). En bref, toutes les données de la preuve de vaccination sont directement encodées en JSON dans le contenu du code QR, puis signées avec une clé secrète. Cela permet par la suite de valider l'authenticité des données d'un code QR sans qu'il soit nécessaire de conserver une copie des données relatives aux personnes vaccinées sur un quelconque serveur. Or, puisque les données sont disponible dans le payload du code QR, il est possible d'extraire ces données afin de les consulter et de verifier leur authenticité.

Several Canadian provinces and territories have introduced a vaccination passport system using digital proof of vaccination (the infamous QR code) to help prevent COVID-19 spread. These QR codes are generated through the Smart Health Cards protocol (https://smarthealth.cards), using JWT (a digital token system generally used for Web API authentication, that prevents QR code forgery). In short, all the relevant immunization data will be directly encoded as JSON in the QR code payload, and then signed with a secret key. This allows to validate the authenticity of the QR code data without the need to keep a copy of the vaccination data on any server. Since the data is available in the QR code payload, it is possible to extract this data in order to review it and verify its trustworthiness.

🇨🇦 Now supporting new provinces and territories! 🇨🇦

SHC-extractor now supports QR codes decoding for the following provinces and territories :

  • Québec
  • British Columbia
  • Saskatchewan
  • Alberta
  • Newfoundland and Labrador
  • Nova Scotia
  • Ontario
  • Northwest Territories
  • Yukon
  • New Brunswick/Nouveau-Brunswick
  • Japan

⚠️ Disclaimers

FR :

  • Ce projet n'est pas affilié au Gouvernement du Québec, ni à aucun gouvernement de Province ou Territoire canadien.
  • Cette application est destinée à des fins éducatives et ne fournit aucune garantie, y compris concernant la validation des données.
  • Cette application ne doit pas être utilisée pour recueillir des données personnelles sans le consentement du propriétaire des données. En outre, elle ne doit pas être utilisée à des fins de vérification des preuves vaccinales dans le cadre de la loi sur les passeports de vaccination dans une province ou un territoire canadien. Les commerçants doivent utiliser l'application officielle mise à leur disposition dans leur juridiction.
  • Le développeur de cette application se détache de toute responsabilité lié à un usage illégal de l'application par une tierce personne.

EN :

  • This project is not affiliated with the Government of Quebec, nor any other government of canadian province or territory.
  • This app is intended for educational purposes and do not provide any warranty of any kind including data validation.
  • This application should not be used to collect personal data without the consent of the data owner. Furthermore, it cannot be used for verifying proof of vaccination in the context of the law on vaccination passports in any Canadian province or territory. Merchants and venue owners must use the official application for their jurisdiction.
  • The developer of this application disclaims any responsibility for illegal use of the application by a third party.

Usage

git clone https://github.com/obrassard/shc-extractor.git
cd shc-extractor
npm install
node shc.js '/path/to/the/qrcode.png'

Where '/path/to/the/qrcode.png' is a path to the QR Code image (in PNG).

The extracted JSON will be saved in ./out


NEW : Visualize QR code data in a more friendly way using the Web UI

Why reading a JSON file when you can visualize your QR code data in a cute Web UI?

screenshot

How ?

GET {host}/card?shc={shc-raw-content}

You can try it with the sample QR code (or your own) on the live demo page : https://shc.obrassard.ca (no data is collected or stored by this server). On the main page, you'll be prompted to scan a QR code to decode.

💡 Tip : If you have an iOS device, you can also use this shortcut to scan the QR code and quickly open the Web UI : https://www.icloud.com/shortcuts/435d6706c43e45e4a9b78e700bdfcdf8

If you prefer you may use it locally using the following commands :

npm install
npm start

# Then navigate to :
GET http://localhost:1234/

Note that some browsers may not let you access the camera if you are not using https.


Credits and inspiration :


Sample data

./sample/sample-qr-code.png :

Sample QR Code

Extracted data :

node shc.js './sample/sample-qr-code.png'
{
    "header": {
        "zip": "DEF",
        "alg": "ES256",
        "kid": "3Kfdg-XwP-7gXyywtUfUADwBumDOPKMQx-iELL11W9s"
    },
    "payload": {
        "iss": "https://smarthealth.cards/examples/issuer",
        "nbf": 1620847989.837,
        "vc": {
            "type": [
                "https://smarthealth.cards#health-card",
                "https://smarthealth.cards#immunization",
                "https://smarthealth.cards#covid19"
            ],
            "credentialSubject": {
                "fhirVersion": "4.0.1",
                "fhirBundle": {
                    "resourceType": "Bundle",
                    "type": "collection",
                    "entry": [
                        {
                            "fullUrl": "resource:0",
                            "resource": {
                                "resourceType": "Patient",
                                "name": [
                                    {
                                        "family": "Anyperson",
                                        "given": [
                                            "John",
                                            "B."
                                        ]
                                    }
                                ],
                                "birthDate": "1951-01-20"
                            }
                        },
                        {
                            "fullUrl": "resource:1",
                            "resource": {
                                "resourceType": "Immunization",
                                "status": "completed",
                                "vaccineCode": {
                                    "coding": [
                                        {
                                            "system": "http://hl7.org/fhir/sid/cvx",
                                            "code": "207"
                                        }
                                    ]
                                },
                                "patient": {
                                    "reference": "resource:0"
                                },
                                "occurrenceDateTime": "2021-01-01",
                                "performer": [
                                    {
                                        "actor": {
                                            "display": "ABC General Hospital"
                                        }
                                    }
                                ],
                                "lotNumber": "0000001"
                            }
                        },
                        {
                            "fullUrl": "resource:2",
                            "resource": {
                                "resourceType": "Immunization",
                                "status": "completed",
                                "vaccineCode": {
                                    "coding": [
                                        {
                                            "system": "http://hl7.org/fhir/sid/cvx",
                                            "code": "207"
                                        }
                                    ]
                                },
                                "patient": {
                                    "reference": "resource:0"
                                },
                                "occurrenceDateTime": "2021-01-29",
                                "performer": [
                                    {
                                        "actor": {
                                            "display": "ABC General Hospital"
                                        }
                                    }
                                ],
                                "lotNumber": "0000007"
                            }
                        }
                    ]
                }
            }
        }
    },
    "verifications": {
        "trustable": true,
        "verifiedBy": "3Kfdg-XwP-7gXyywtUfUADwBumDOPKMQx-iELL11W9s"
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].