Skip to main content

Decode the EU Covid-19 vaccine certificate

Project description

vacdec

Python script to decode the EU Covid-19 vaccine certificate, as specified by the EU.

This script takes an image with a QR code of a vaccine certificate as the parameter and will show the certificate's content. It will not validate the signature.

A fork of this script with signature verification exists.

The code is very short and should provide an easy way to understand how these certificates are encoded:

  • The QR code encodes a string starting with "HC1:".
  • The string following "HC1:" is base45 encoded.
  • Decoding the base45 leads to zlib-compressed data.
  • Decompression leads to a CBOR Web Token structure.

setup

You will need the python pillow, pyzbar, cbor2 and base45 packages. Additionally, you need zbar. For Mac OS X, it can be installed via brew install zbar, on Debian systems via apt install libzbar0. Source

You can install them via your distribution or via pip:

pip install base45 cbor2 pillow pyzbar

usage

Run:

./vacdec [image]

[image] can be an image in any format pillow supports, including of course PNG and JPG.

A test certificate can be found here.

author

Written by Hanno Böck.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vacdec-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vacdec-0.0.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file vacdec-0.0.2.tar.gz.

File metadata

  • Download URL: vacdec-0.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for vacdec-0.0.2.tar.gz
Algorithm Hash digest
SHA256 10c069ee3a7e6e08f233753bcdd05883e93fdbf15ece44caabcce963a80dabb8
MD5 6bb257e26e5b00c39373cd15270a6f32
BLAKE2b-256 24e2065c758c1e889f92ee7bfaf825828a3f06aa3d1ffc591708935542a78850

See more details on using hashes here.

File details

Details for the file vacdec-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: vacdec-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for vacdec-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb60ca0ed0c77c8871d6b0ac2b3721675fc5ffdd9d494272845257afcf6c3451
MD5 2bbf963480c8969f16d7a3bfd9087ab5
BLAKE2b-256 ba6ed685e4340d79e13061c0384e39cea551c822aef6ceb232ea9092a704ad43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page