Skip to main content

Decode the EU Covid-19 vaccine certificate

Project description


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.


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



./vacdec [image]

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


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.

Files for vacdec, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size vacdec-0.0.1-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size vacdec-0.0.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page