Skip to content

Instantly share code, notes, and snippets.

@mlouielu
Created January 20, 2022 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlouielu/40e637518453ba232f436f87a82052d5 to your computer and use it in GitHub Desktop.
Save mlouielu/40e637518453ba232f436f87a82052d5 to your computer and use it in GitHub Desktop.
Decode EU Digital COVID Certificate (EU-DCC) QR-Code from command line tools

Prereuiqrements

  • sed
  • zbar
  • zlib
  • python-base45
  • python-cbor2

Snippet

$ zbarimg qrcode.jpg -q | sed "s/HC1://g" | sed "s/QR-Code://g" | base45 --decode | zlib-flate -uncompress | python -c 'import pprint;import cbor2;f=open(0, "rb");pprint.pprint(cbor2.loads(cbor2.loads(f.read()).value[2]))'
{-221: {9: {'dob': '1900-01-01',
            'nam': {'fn': '', 'fnt': '', 'gn': '', 'gnt': ''},
            'v': [],
            'ver': ''}},
       7: '',
       9: '',
       3: ''}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment