{"id":15693573,"url":"https://github.com/stefh/dutch-coronacheck-qr-code-decoder-and-verifier","last_synced_at":"2026-03-07T20:04:42.064Z","repository":{"id":149586540,"uuid":"413562457","full_name":"StefH/Dutch-CoronaCheck-QR-Code-Decoder-and-Verifier","owner":"StefH","description":"Decoding and verifying the Dutch CoronaCheck QR Code","archived":false,"fork":false,"pushed_at":"2022-02-16T21:31:52.000Z","size":93,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-11T01:13:45.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StefH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-10-04T19:47:46.000Z","updated_at":"2022-01-17T09:29:36.000Z","dependencies_parsed_at":"2023-09-24T07:17:47.337Z","dependency_job_id":null,"html_url":"https://github.com/StefH/Dutch-CoronaCheck-QR-Code-Decoder-and-Verifier","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":0.09090909090909094,"last_synced_commit":"36af84012203a05bf57f94d597b5b138a3ca4cd0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StefH/Dutch-CoronaCheck-QR-Code-Decoder-and-Verifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefH%2FDutch-CoronaCheck-QR-Code-Decoder-and-Verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefH%2FDutch-CoronaCheck-QR-Code-Decoder-and-Verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefH%2FDutch-CoronaCheck-QR-Code-Decoder-and-Verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefH%2FDutch-CoronaCheck-QR-Code-Decoder-and-Verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StefH","download_url":"https://codeload.github.com/StefH/Dutch-CoronaCheck-QR-Code-Decoder-and-Verifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefH%2FDutch-CoronaCheck-QR-Code-Decoder-and-Verifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005925,"owners_count":26083983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T18:46:00.215Z","updated_at":"2025-10-11T01:13:45.893Z","avatar_url":"https://github.com/StefH.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decoding and verifying the Dutch CoronaCheck QR Code\n\nBased on this [blog - Decoding the Dutch domestic CoronaCheck QR code](https://www.bartwolff.com/Blog/2021/08/21/decoding-the-dutch-domestic-coronacheck-qr-code) I created C# code to decode the Dutch CoronaCheck QR Code.\n\n## Blog\nFor a full blog related to QR Codes in general and more details on this project, see [mstack.nl : decoding-coronacheck-qrcode](https://mstack.nl/blog/20211013-decoding-coronacheck-qrcode/).\n\n## Overview\n![overview](https://github.com/StefH/Dutch-CoronaCheck-QR-Code-Decoder-and-Verifier/blob/main/resources/overview.png)\n\n## Steps\n\n### 1. Get QR Code data\n\nUse a library to decode a QR Code image to data : https://github.com/StefH/QRCode\n\n![overview](https://github.com/StefH/Dutch-CoronaCheck-QR-Code-Decoder-and-Verifier/blob/main/resources/qr.png)\n\n``` c#\nvar qrCodeData = \"NL2:B4V.W9D:LWJ5W2S6A$XQ9N* Y252O4%%  ZNK**$840VPY8T7$J0GR$8L2%VMO/20/3C.C.L XO:FN%IWW.TI+G3KW2RA+ $6T1 BQAGU6HJ35D.2YPIT*6Y3C733IOBZIKEWP4L/$9TX6QUVQFFZWJ+RY/JV6N3%NX%Y4XX43J182O/.AELM1%E-D*Q+8*O1CG*9/5ENUJ0HXT*PJXJ*XE-6QFMM7*B$IFEY04:-PN14PX3% Q5-JQF9$YJFVBSUD*P/AXHJRNUIA:SCX*SBIQ*BHZG$PJ+LG-S*:0.GZ8M4HO.XLM$BKZG7H/BVRUW$7WH$B3$L-T58KK$20EDRZW1B*VJ1Q5VC:X/.5*OQJ/EA92-8J*-QL6J+3NX:C5%%XZ4LLIS31KKPA9:1FP++KT:.QFRZ%M5R$I2*DM36M%BW/3.LS9MX6YE8KU4S-.Q%W2ZCI7CQ79E/X342+5T3ODK8X.-F02J-GMF18KCE.5NDV2V8I/5L0GVNPQRF+T3A*$%HI3-$R3+*RO/X8N.RG7LBFJP5SO9QAD:KYRP978DTHFL39368JXWSO2CKLQTYDZ45CF0FE9J3$$6+ZX RSNRQ6+HV%DE$V:O/Q8FYO+.NZFL6R8R8UE.0:A*Q9$8HYB+WZ26UM%.4R4 25AA7XQW.NYAJCO6+-C QZEPKLYS6G0Z/YGHPR*+YKEDO*3LE:KP HT3NCJPRNRG9K0Y84*C-7N2-BQJXY/+D-VF IIQTJ6-AV83%1Y8JMXN1I6/JSHS+HEG+VU+8UX:LL*Y%B*$G$D4H9HZVMHKWT2-87UTR+EZIWJ*IOTQ70.V%CLHVY  2-HFW4BA6-+FWIW6C:WDS /FU2I9G$LXL$B/MY*WQYMN*R00IQZJJ- 6QFX*$%-9ZGS3%G\";\n```\n\n### 2. Decode this string using the Dutch Base45 decoder\n\nMake sure to skip the first 4 characters.\n\n``` c#\nvar base45Decoded = DutchCoronaCheckBase45Utils.Decode(qrCodeData.Substring(4));\n```\n\n### 3. Decode the Base45 string using an ASN1 decoder\n\n``` c#\nvar topLevelStructure = DutchCoronaCheckASN1Utils.Read(base45Decoded);\n```\n\n### 4. Print the info as json\n\nNote that you need a specfic BigIntegerJsonConverter to show the BigInteger value correctly.\n\n``` c#\nvar options = new JsonSerializerOptions\n{\n    WriteIndented = true\n};\noptions.Converters.Add(new BigIntegerJsonConverter());\nvar json = JsonSerializer.Serialize(topLevelStructure, options);\n```\n\n### 5a. Decoded structure as JSON\n\n``` json\n{\n  \"DisclosureTimeSeconds\": 0,\n  \"DisclosureTimeAsDateTime\": null,\n  \"C\": 8552691641371642315207690017304824071043033037718558536544370073022402689101,\n  \"A\": 49268998317399832353736153768064371574626738522454049754099967437769709104310153609419233826877129804699795832362376712815509777453876457088841057013114352195643598128717108189839059529627445516705110559750713315964799043200407446690141492417247324685581653291574436663012628249066333485906592079172004705549,\n  \"EResponse\": 49545515259154895522776867107959247032241047651980572443481917331143789403307139106555023968391340296360761238102083435099286993359857518,\n  \"VResponse\": 7463954613777398261540270129601931803174222687130155761347994847425322491183229539732191198415826129672984792140024846081031144727556269931620272207040926338693607156199863455849443514025962426861121889546981280059686356901102682907001113258526002924172374302439709804314739830145508425336941142618773720272632415685260123356955161489134413604652892038340458427564488213207319660351733296444266493507445217438295664429771376840180237292580120261971321393055748802007069008017175471042800839302970504855484030669136380196262086189703554019361768087619371773861096653352702590133156777381984232268805659708171263123,\n  \"AResponse\": 8995728107811269294519662596375119434427697506197921896277098071616873267360774813635548449786430125954107935654004828703451862806879219403683135630175078760507502448619423267753,\n  \"ADisclosed\": {\n    \"Metadata\": {\n      \"CredentialVersion\": 2,\n      \"IssuerPkId\": \"VWS-CC-2\"\n    },\n    \"IsSpecimen\": \"1\",\n    \"IsPaperProof\": \"1\",\n    \"ValidFrom\": \"1627466400\",\n    \"ValidFromAsDateTime\": \"2021-07-28T10:00:00\",\n    \"ValidForHours\": \"25\",\n    \"FirstNameInitial\": \"B\",\n    \"LastNameInitial\": \"B\",\n    \"BirthDay\": \"31\",\n    \"BirthMonth\": \"7\"\n  }\n}\n```\n\n### 5b. Decoded structure from real QR code (phone)\n``` json\n{\n  \"DisclosureTimeSeconds\": 1636813015,\n  \"DisclosureTimeAsDateTime\": \"2021-11-13T14:16:55\",\n  \"C\": ⭐,\n  \"A\": ⭐,\n  \"EResponse\": ⭐,\n  \"VResponse\": ⭐,\n  \"AResponse\": ⭐,\n  \"ADisclosed\": {\n    \"Metadata\": {\n      \"CredentialVersion\": 2,\n      \"IssuerPkId\": \"VWS-CC-1\"\n    },\n    \"IsSpecimen\": \"0\",\n    \"IsPaperProof\": \"0\",\n    \"ValidFrom\": \"1636797600\",\n    \"ValidFromAsDateTime\": \"2021-11-13T10:00:00\",\n    \"ValidForHours\": \"24\",\n    \"FirstNameInitial\": \"⭐\",\n    \"LastNameInitial\": \"⭐\",\n    \"BirthDay\": null,\n    \"BirthMonth\": \"⭐\"\n  }\n}\n```\n\n##### Differences with the PaperProof version\n- The `DisclosureTimeSeconds` defines the time when this code was generated/displayed on the screen.\n- The `IssuerPkId` version is different\n- The `BirthDay` is null\n- The `ValidForHours` is 24 instead of 25\n- The `ValidFrom` differs 1 hour","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefh%2Fdutch-coronacheck-qr-code-decoder-and-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefh%2Fdutch-coronacheck-qr-code-decoder-and-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefh%2Fdutch-coronacheck-qr-code-decoder-and-verifier/lists"}