-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Government of BC cards being recognized as fake #14
Comments
@fproulx's version (https://fproulx.github.io/shc-covid19-decoder/) only recognizes QC QR code because its uses a built-in public signing key. |
The version from @steven676 works, if I disable verification! Thanks for the tip. |
Be careful with my current version or no verification, because it means anyone could produce those codes and it could be completely fake. You need to verify it some way. With the verification off, is there an ISS field? If so, can you post it here? |
https://smarthealthcard.phsa.ca/v1/issuer PHSA.ca is legit. 👍 |
If it helps with development, I can post the full dump of my BC one (with personal information redacted). It’s also worth noting, this just launched today, and the official “verifier” app does not yet exist until next week 😅 |
BC payload, without the credentialSubject: {
iss: 'https://smarthealthcard.phsa.ca/v1/issuer',
nbf: 1630863179,
vc: {
type: [
'https://smarthealth.cards#covid19',
'https://smarthealth.cards#immunization',
'https://smarthealth.cards#health-card'
],
...
}``` |
Key from https://smarthealthcard.phsa.ca/v1/issuer/.well-known/jwks.json: $ sha256sum jwks.json dc6c1e25fecbaa4362cd17ede14e862071bc5a0bd74085b7f37a2d369c61e810 jwks.json With thanks to Mitch Brown and Dave Hughes; closes fproulx#14.
Thanks for the heads-up. I've updated https://steven676.github.io/shc-covid19-decoder/ with the BC signing key; does that now work with BC Vaccine Cards when signature verification is enabled? (The code is off in a separate more-keys branch for now -- I suspect I'll end up redoing my main branch to go back to selecting keys using the iss field, given the discussion in #12 and the fact that everyone else seems to be doing it that way.) |
I tested it on my BC card and it works with verify enabled |
And I've seen articles that say that any QR reader can scan the codes, which seems totally wrong. |
GregSwallow beat me to it, but yes. Signature verification works for BC with that key.
@csisop A QR code is a QR code is a QR code. It's a general purpose scheme for encoding any data in a 2D optical matrix, so of course any QR reader can scan it. But most readers will just give you a string of digits (eg, "shc:/65432545..."). The data encoded in the vaccine passport QR codes is typically SHC data, which uses JWS (JSON Web Signatures) with asymmetric encryption to sign the data. The SHC data does not protect any of the information, but the signing mechanism does allow purpose-built verifier apps to validate the signature, which allows for detection of tampered data (ie, detecting a fake passport). That's what this project does. It reads the SHC data from a QR code, converts it to JWS, verifies the signature, and dumps the data. |
Key from https://smarthealthcard.phsa.ca/v1/issuer/.well-known/jwks.json: $ sha256sum jwks.json dc6c1e25fecbaa4362cd17ede14e862071bc5a0bd74085b7f37a2d369c61e810 jwks.json With thanks to Mitch Brown and Dave Hughes; closes fproulx#14.
The shc:/ link provided by the BC Vaccine Card QR code, are shown as fake by this system.
The text was updated successfully, but these errors were encountered: