Giter Site home page Giter Site logo

eu-covid-qr-parser-demo's Introduction

EU Covid QR extractor & generator

Quick Node.js PoC to parse and generate european vaccination certificate QR codes

๐Ÿ›‘ DISCLAIMER PLEASE READ ๐Ÿ›‘

I'm receiving a lot of messages from people asking if it's possible to create a valid EU Covid Vaccination QRcode so I'll make it clear for you here: NO YOU CAN'T.

The QRcode is signed with a private key to certify its authenticity, so except if you found a way to get it (which is nearly impossible), yes, your QRcode will be decoded with your personal details BUT marked as invalid. This project allows you to play with the QRcodes, not to do forgery, or counterfeiting.

If it's your main goal, please: educate yourself, and get vaccinated.

How it works

1) Read image
2) Find & decode QRcode
3) Remove HC1 (health certificate) prefix
4) Base45 decode
5) zlib inflate (decompress)
6) CBOR decode required fields

Same thing for the QRcode creation... reverse order.

Prerequisites

Requires Node.js 12 at least, otherwise you'll get the ReferenceError: TextDecoder is not defined error.

nvm use 12

Install

git clone https://github.com/rascafr/eu-covid-qr-parser-demo.git
cd eu-covid-qr-parser-demo
npm i

Usage

npm start <your_certif_qr_image>

# example return
Opening eu_digital_att.png ...
Decoded in 499 ms: {
  v: [
    {
      ci: 'urn:uvci:01:FR:AZERTY123456#7',
      co: 'FR',
      dn: 2,
      dt: '2021-06-17',
      is: 'CNAM',
      ma: 'ORG-PFIZER',
      mp: 'EU/BIONTECH',
      sd: 2,
      tg: '1234567',
      vp: 'XXAA000'
    }
  ],
  dob: '1993-12-12',
  nam: { fn: 'LEPAROUX', gn: 'FRANCOIS', fnt: 'LEPAROUX', gnt: 'FRANCOIS' },
  ver: '1.3.0'
}

Helpful sources

Used libraries

  • jsQR
  • jimp
  • base45
  • cbor
  • zlib

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.