floysh / DCC-green-pass-decoder

A simple web app to decode EU Digital Covid Certificate/Green Pass QR codes.
https://floysh.github.io/DCC-green-pass-decoder/
MIT License
44 stars 13 forks source link
decoder digital-covid-certificate digital-green-certificate greenpass pwa qrcode


Markdownify

EU Digital COVID Certificate decoder

A Progressive Web App that can read EU Digital COVID Certificate QR-codes.

This is just a toy app I made while being curious to look at what's inside my own Green Certificate. Unlike other decoders available online, it doesn't require to set up dependencies or upload the certificate to a remote server. It can be used by average users without having to interact with the terminal (scary! hacker stuff! šŸ±ā€šŸ’»).

All the processing is done locally and your certificate never leaves your device.


šŸš€ Try it live on https://floysh.github.io/DCC-green-pass-decoder/


Features


How to edit

Clone the repository:

git clone https://github.com/floysh/DCC-green-pass-decoder

Install dependencies:

cd ./DCC-green-pass-decoder
npm install

Run the watcher:

npm run watch

this will generate new builds of the JS bundle whenever it detects something has changed in the src/ folder.

Then start your favorite local webserver in public/

When you're satisfied with the edits, stop the watcher and make an optimized JS bundle:

npm run build

This will minify the javascript and reduce the bundle.js file size.


How does it work

Decoding the QR-code

It's fairly easy to decode an EU DCC. The official EU repository states that the certificate is a COSE message / CBOR Web Token (CWT).

The COSE message structure is the following:

A more detailed description of this structure can be found on the Electronic Health Certificate Specification repository from the European Health Network.

This is the encoding pipeline:

docs/overview.png

so decoding can be done by following the same steps in reverse:

Signature validation

This was a bit more time consuming, mainly because there's no documented way to get some required files and I'm by no means an expert in dealing with crypto algorithms or digital signatures.

Further details on how this feature has been implemented can be found in docs/signature-validation.md.

Resources