qr code | HackLAB https://www.geeks3d.com/hacklab 3D Programming, Prototyping and Gamedev with GeeXLab Tue, 14 Sep 2021 16:31:38 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 EU Covid-19 Vaccine Certificate (Health Pass) QR Code Reader in Python 3 https://www.geeks3d.com/hacklab/20210914/eu-covid-19-vaccine-certificate-health-pass-qr-code-reader-in-python-3/ https://www.geeks3d.com/hacklab/20210914/eu-covid-19-vaccine-certificate-health-pass-qr-code-reader-in-python-3/#comments Tue, 14 Sep 2021 16:31:38 +0000 https://www.geeks3d.com/hacklab/?p=1614 Downloads Python 3 Demopack Demo: geexlab-demopack-python3/qr-code/eu_health_pass_qrcode_reader/ GeeXLab full with Python3 (win64) How to run the demo? Download and unzip GeeXLab where you want, launch GeeXLab and drop the demo (main.xml) in GeeXLab. The full version of GeeXLab for Windows is recommended for this demo. The EU health pass (or Covid-19 vaccine certificate) is a document that contains some information about you (essentially your name and … Continue reading EU Covid-19 Vaccine Certificate (Health Pass) QR Code Reader in Python 3 »

The post EU Covid-19 Vaccine Certificate (Health Pass) QR Code Reader in Python 3 first appeared on HackLAB.]]>

GeeXLab - Health Pass / Covid-19 vaccine certificate QR Code Reader in Python 3



Downloads

How to run the demo?
Download and unzip GeeXLab where you want, launch GeeXLab and drop the demo (main.xml) in GeeXLab. The full version of GeeXLab for Windows is recommended for this demo.

The EU health pass (or Covid-19 vaccine certificate) is a document that contains some information about you (essentially your name and date of birth) as well as your current vaccine status (number of doses) and a big QR code that gathers all data. Here is a small demo coded in Python 3 that scans the QR code of the EU vaccine certificate, decodes it and shows you the data hidden behind this QR code.

The demo works on Windows only because of the built-in webcam functions I used for scanning QR codes. If necessary, the demo can be updated later to bypass the webcam and scan the image of a QR code you dropped in. You will be able then to run the demo on Linux too.

Moreover, the full GeeXLab for Windows contains all Python3 packages required by the demo. Just download the full version of GeeXLab, unzip it, run GeeXLab and drop the QR code demo in GeeXLab. A serious webcam is also required. A webcam that can do a clear focus on very close objects like your health pass QR code (on your mobile phone or on paper). Some tries (on the button SCAN a QR Code) will be likely necessary to read the QR code.

The core of the QR code decoding step has been adapted from this source and can be summed up to this:

– the QR code is a string starting with HC1:
– the string following HC1: is base45 encoded.
– the decoded base45 string leads to zlib-compressed data.
– the decompression leads to a CBOR Web Token structure.

To decode the QR code, you need the following Python 3 packages:
– base45
– cbor2
– zlib
– pprint

base45 and cbor2 packages be installed using pip:

pip install base45
pip install cbor2

base45 and cbor2 are already shipped with the full version of GeeXLab so don’t worry about installing them.

zlib and pprint are shipped with Python 3.

Here is the decoding function of the demo you can find in the frame.py file:

def DecodeHealthPass(payload):
  # The HC1: prefix nust be removed before decoding.
  s = payload.replace("HC1:", "")

  # decode Base45
  b45payload = base45.b45decode(s)

  # decompress using zlib
  cbordata = zlib.decompress(b45payload)
  
  # load the CBOR structure
  decoded = cbor2.loads(cbordata)
  decoded_qrcode = cbor2.loads(decoded.value[2])

  # prepare the CBOR structure in a readable way (newlines are added). 
  decoded_qrcode_str = pprint.pformat(decoded_qrcode)
  return decoded_qrcode_str

 
The demo:
GeeXLab - Health Pass / Covid-19 vaccine certificate QR Code Reader in Python 3

 
Here are the two steps to display the decoded QR code:

1/ click on SCAN a QR Code
This first step will show you the content (payload) of the QR code that must start with HC1: to be a valid health pass. You can now copy the payload to the clipboard if you need it.

2/ click on the Show decoded health pass button
This second step will decode the payload and display it in a small window. You can also copy to the clipboard the decoded health pass.

The decoded health pass contains information about the number of doses, the type of vaccin and its manufacturer. Here is a little help to decrypt these fields:

Field: ci --> "Unique Certificate Identifier, UVCI"
Field: co --> "Country of Test"
Field: is --> "Certificate Issuer"

Field: dob --> "Date of Birth, ISO 8601"

Field: dn --> "dose number"
Field: sd --> "Number of doses"

Field: mp  (medicinal product)
  EU/1/20/1528 --> Comirnaty
  EU/1/20/1507 --> COVID-19 Vaccine Moderna
  EU/1/21/1529 --> Vaxzevria
  EU/1/20/1525 --> COVID-19 Vaccine Janssen
 
Field: ma (vaccine manufacturer)
  ORG-100030215 --> Biontech Manufacturing GmbH
  ORG-100001699 --> AstraZeneca AB
  ORG-100001417 --> Janssen-Cilag International
  ORG-100031184 --> Moderna Biotech Spain S.L.
  ORG-100006270 --> Curevac AG

I added a PDF file in the demo folder that contains the specifications of the EU Covid-19 vaccine certificate.

The post EU Covid-19 Vaccine Certificate (Health Pass) QR Code Reader in Python 3 first appeared on HackLAB.]]>
https://www.geeks3d.com/hacklab/20210914/eu-covid-19-vaccine-certificate-health-pass-qr-code-reader-in-python-3/feed/ 2
(Demo) QR Code Shaders https://www.geeks3d.com/hacklab/20200814/demo-qr-code-shaders/ https://www.geeks3d.com/hacklab/20200814/demo-qr-code-shaders/#respond Fri, 14 Aug 2020 14:51:06 +0000 https://www.geeks3d.com/hacklab/?p=1563 Downloads OpenGL 2.1 Demopack Demo: geexlab-demopack-gl-21/d55-qr-code/qrcode_shader/ GeeXLab for Windows 64-bit GeeXLab for Linux 64-bit Forum thread (EN)   For most people, QR codes are a way to store a web link. In reality, we can store more data in QR code than a simple web link. Take a look at the following QR code:   It stores a complete pixel shader. If you drop this … Continue reading (Demo) QR Code Shaders »

The post (Demo) QR Code Shaders first appeared on HackLAB.]]>

GeeXLab demo - Shaders in QR codes



Downloads

 
For most people, QR codes are a way to store a web link. In reality, we can store more data in QR code than a simple web link. Take a look at the following QR code:

GeeXLab demo - Shaders in QR codes

 
It stores a complete pixel shader. If you drop this QR code in the GeeXLab demo you will get:

GeeXLab demo - Shaders in QR codes

 
And the following one:
GeeXLab demo - Shaders in QR codes

 
produces this effect:
GeeXLab demo - Shaders in QR codes

 
QR code shaders are an original ways to store your GLSL shaders. And for the same price, you get an extra layer of protection (easily crackable with a QR code reader).

All QR codes have been created with the QR code generator available in THIS POST.

This demo requires GeeXLab 0.35.1+ (the latest version is still a good choice) and an OpenGL 3.2 support, sorry for Raspberry Pi users but I was too lazy to convert GL3 shaders to GL2 shaders. The demo is available in the OpenGL 2.1 demopack in the d55-qr-code/qrcode_shader/ folder.

Load the demo in GeeXLab and drag and drop any QR code available in the d55-qr-code/qrcode_shader/qr_shaders/ folder.

The post (Demo) QR Code Shaders first appeared on HackLAB.]]>
https://www.geeks3d.com/hacklab/20200814/demo-qr-code-shaders/feed/ 0
(Demo) QR Code Generator and Reader https://www.geeks3d.com/hacklab/20200801/demo-qr-code-generator-and-reader/ https://www.geeks3d.com/hacklab/20200801/demo-qr-code-generator-and-reader/#respond Sat, 01 Aug 2020 16:23:34 +0000 https://www.geeks3d.com/hacklab/?p=1552 Downloads (APP) QR Code Generator for win64 (APP) QR Code Reader for win64 OpenGL 2.1 Demopack Demo: geexlab-demopack-gl-21/d55-qr-code/ Forum thread (EN) GeeXLab 0.35 comes with the support of QR Codes (or Quick Response codes). We can now read a QR code (from an image or using the webcam) and we can generate a QR code with any reasonable (not too big) payload. The payload is … Continue reading (Demo) QR Code Generator and Reader »

The post (Demo) QR Code Generator and Reader first appeared on HackLAB.]]>

GeeXLab - QR Code Reader and Generator demo



Downloads

GeeXLab 0.35 comes with the support of QR Codes (or Quick Response codes). We can now read a QR code (from an image or using the webcam) and we can generate a QR code with any reasonable (not too big) payload. The payload is the real content of the QR code. For example a web link. Wikipedia has a detailed page about QR codes HERE.

QR code support is available on Windows, Linux and Raspberry Pi. I prepared two small standalone utilities (generator and scanner) for Windows. For Linux / RPi, the generator is available in the OpenGL 2.1 demopack (geexlab-demopack-gl-21/d55-qr-code/ folder). The QR code scanner does not work on Linux / RPi because there is no built-in webcam support in GeeXLab for those platforms. But you can hack the demo to load (or drag and drop) any QR code texture. You can also use OpenCV to drive the webcam (see THIS DEMO).

 

QR Code Generator

This QR code generator allows to create a QR code from a payload (a string). You can type any payload or copy and paste it (few hundred of characters max otherwise nothing is generated). Then just click on the GENERATE QR CODE button, and a QR code image (.png) will be saved in the qrcodes/ folder.

 
– Example with a web link:
GeeXLab - QR Code Generator

 
– Example with a text:
GeeXLab - QR Code Generator

 

QR Code Scanner

The QR Code Scanner is a simple QR code reader that uses a webcam. Once the webcam is reading the QR code, click on [SCAN QR CODE]. If the QR code is correctly detected and is valid, the QR code payload is displayed as well as the corners coordinates of the bounding square. If the payload is an url (starting with http), a button is displayed to open the url in the default browser.

GeeXLab - QR Code Scanner with a webcam

The post (Demo) QR Code Generator and Reader first appeared on HackLAB.]]>
https://www.geeks3d.com/hacklab/20200801/demo-qr-code-generator-and-reader/feed/ 0