shc-covid19-decoder icon indicating copy to clipboard operation
shc-covid19-decoder copied to clipboard

Government of Ab recognized as fake

Open P4R4NORM4L opened this issue 3 years ago • 9 comments

Please add Alberta support Thanks

P4R4NORM4L avatar Oct 01 '21 21:10 P4R4NORM4L

The AB public keys haven't been released yet. You can see the keys here when they're up: https://covidrecords.alberta.ca/smarthealth/issuer/.well-known/jwks.json

peacey avatar Oct 01 '21 22:10 peacey

oh ok

P4R4NORM4L avatar Oct 01 '21 22:10 P4R4NORM4L

They should of released it today maybe someone can look into it ?

P4R4NORM4L avatar Oct 13 '21 18:10 P4R4NORM4L

@P4R4NORM4L, they didn't activate their key server for some reason, however someone did find the keys embedded in a site file a few days ago. Please see my pull request here (steven676/shc-covid19-decoder#3) for more information.

Here are the keys,

keys: [
      { kid: "JoO-sJHpheZboXdsUK4NtfulfvpiN1GlTdNnXN3XAnM",
        alg: "ES256", kty: "EC", crv: "P-256", use: "sig",
        x: "GsriV0gunQpl2X9KgrDZ4EDCtIdfOmdzhdlosWrMqKk",
        y: "S99mZMCcJRsn662RaAmk_elvGiUs8IvSA7qBh04kaw0" },
]

peacey avatar Oct 13 '21 18:10 peacey

@peacey beat me to it.

To add (for background): I believe @grepme discovered (and posted on Reddit) that the public key was published within the JavaScript for the covidrecords site with the name publicSmartHealthKey.

RussellAult avatar Oct 13 '21 18:10 RussellAult

What is the point of having this decoder though, is it just to see the info?? They say that the app does not connect to any external server for checking so i'm assuming anyone could make their own QR code and have it validated on their app ?

https://globalnews.ca/news/8260170/alberta-covid-19-coronavirus-update-october-12/

So, to repeat, the app does not store any personal information, and it does not link to any external data, the QR code isn’t a hot link to an external database or website, all of the required information is contained within the code itself.

P4R4NORM4L avatar Oct 13 '21 18:10 P4R4NORM4L

What is the point of having this decoder though, is it just to see the info?? They say that the app does not connect to any external server for checking so i'm assuming anyone could make their own QR code and have it validated on their app ?

https://globalnews.ca/news/8260170/alberta-covid-19-coronavirus-update-october-12/

So, to repeat, the app does not store any personal information, and it does not link to any external data, the QR code isn’t a hot link to an external database or website, all of the required information is contained within the code itself.

@P4R4NORM4L How familiar are you with public-key cryptography?

The short answer is that the data in an Alberta-issued QR code includes a signature generated by a Government of Alberta private key, and any attempts to alter the contents of the QR code will break this signature. Validators (whether the official app or unofficial ones like this one) use the signing key's public key (which is what we've all been waiting for) to check whether the signature in the QR code is valid.

Because this validation process only requires knowledge of the public key used to sign the QR codes, an app can verify the validity of the QR code itself (and, by extension, its contents) entirely offline (i.e. without referencing an external database).

RussellAult avatar Oct 13 '21 19:10 RussellAult

@P4R4NORM4L, the Alberta app has the keys programmed into it, so it doesn't need to request them from the server.

The QR code contains your health data (name, DOB, vaccine status) unencrypted. The data is then signed with Alberta's private key (which can only be decoded with the public key shown above). Without the Alberta private key, you cannot sign the QR code.

Signing the QR code means taking all the unencrypted health data, hashing it (like md5sum), and encrypting the hash with the private key. This encrypted signature is then placed on the QR code. Validation of a QR code is done by hashing the current health data on the QR, decrypting the signature, and checking that the decrypted hash equals to the currently generated hash. If the hashes aren't equal or the signature could not be decrypted (because of incorrect encryption key) then the data was tampered with and the QR code is invalid.

So, to repeat, the app does not store any personal information, and it does not link to any external data, the QR code isn’t a hot link to an external database or website, all of the required information is contained within the code itself.

That's correct.

peacey avatar Oct 13 '21 19:10 peacey

oh ok well shit lol

P4R4NORM4L avatar Oct 13 '21 19:10 P4R4NORM4L