microsoft / claimqr Goto Github PK
View Code? Open in Web Editor NEWIssue and verify QR-encoded claims
License: MIT License
Issue and verify QR-encoded claims
License: MIT License
With KMAC you can just set the output length so that you don't have to truncate a 32 byte digest to 16 bytes when trying to save space.
The current proposal of using salted SHA-256 digests offer minimal resistance to brute-forcing; consider using stronger functions (e.g., PBKDF2, Argon2id, bcrypt).
When I test to create QR VC what includes did:ion(many characters), it can create QR but can't verify QR.
testing vc (masaki-issuer/jwt.json)
{
"iss": "did:ion:EiA86kbo6KlmoYaUSchoIBSYqwK37AHpoD_qMT4Uk-zABw:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiJzaWduaW5nIiwicHVibGljS2V5SndrIjp7ImNydiI6InNlY3AyNTZrMSIsImt0eSI6IkVDIiwieCI6IldCSWFYTlJnYjFfbEVHdVdOTFJPbUdtNkZISWJfMHB6TFhMdEZrYVRuLVEiLCJ5IjoiNGNKYXRDTXFVM0RBNGJoVldOdGtqc1RFX3hmd0FhNnk2NF9RWjdVZ1ktOCJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiIsImtleUFncmVlbWVudCJdLCJ0eXBlIjoiRWNkc2FTZWNwMjU2azFWZXJpZmljYXRpb25LZXkyMDE5In1dLCJzZXJ2aWNlcyI6W119fV0sInVwZGF0ZUNvbW1pdG1lbnQiOiJFaUJra1dIOXJTMmxrVDJnT2Y0dEdWY3A3V2R3UUhJVFdqaXotVUpnOUFvU1NnIn0sInN1ZmZpeERhdGEiOnsiZGVsdGFIYXNoIjoiRWlDaVl0cTE5YmVwVFZHZE1hRUh4Q2MtU0hBTTl1NlRSeEg5b21vUDJod09LdyIsInJlY292ZXJ5Q29tbWl0bWVudCI6IkVpREp4ZmlCdFdRc09nZ0F6ZWpBZUdfUkZCWHFObXZ6QXhnb3l5QkhiWVYwaVEifX0",
"sub": "did:ion:EiA86kbo6KlmoYaUSchoIBSYqwK37AHpoD_qMT4Uk-zABw:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiJzaWduaW5nIiwicHVibGljS2V5SndrIjp7ImNydiI6InNlY3AyNTZrMSIsImt0eSI6IkVDIiwieCI6IldCSWFYTlJnYjFfbEVHdVdOTFJPbUdtNkZISWJfMHB6TFhMdEZrYVRuLVEiLCJ5IjoiNGNKYXRDTXFVM0RBNGJoVldOdGtqc1RFX3hmd0FhNnk2NF9RWjdVZ1ktOCJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiIsImtleUFncmVlbWVudCJdLCJ0eXBlIjoiRWNkc2FTZWNwMjU2azFWZXJpZmljYXRpb25LZXkyMDE5In1dLCJzZXJ2aWNlcyI6W119fV0sInVwZGF0ZUNvbW1pdG1lbnQiOiJFaUJra1dIOXJTMmxrVDJnT2Y0dEdWY3A3V2R3UUhJVFdqaXotVUpnOUFvU1NnIn0sInN1ZmZpeERhdGEiOnsiZGVsdGFIYXNoIjoiRWlDaVl0cTE5YmVwVFZHZE1hRUh4Q2MtU0hBTTl1NlRSeEg5b21vUDJod09LdyIsInJlY292ZXJ5Q29tbWl0bWVudCI6IkVpREp4ZmlCdFdRc09nZ0F6ZWpBZUdfUkZCWHFObXZ6QXhnb3l5QkhiWVYwaVEifX0",
"vc": {
"@context": ["https://www.w3.org/2018/credentials/v1"],
"type": ["VerifiableCredential", "Credential"],
"credentialSubject": {
"name": "name",
"age": "18"
}
},
"nbf": 1638507401,
"exp": 2038511001,
"jti": "d0577601-a431-4959-aba2-4a14d33b7b8b"
}
Error Message
> [email protected] verify-qr
> ts-node --files src/verify-qr-cl.ts "--qrPath" "./masaki-issuer/qr.png" "--jwtPath" "./masaki-issuer/outjwt.json" "--jwksPath" "./masaki-issuer/.well-known/jwks.json"
Verifying QR image from ./masaki-issuer/qr.png
Error: Can't parse QR code
at decodeQr (/Users/masakiobayashi/main/Blockbase/ClaimQR/src/verify-qr.ts:70:19)
at verifyQrFiles (/Users/masakiobayashi/main/Blockbase/ClaimQR/src/verify-qr.ts:171:18)
at async /Users/masakiobayashi/main/Blockbase/ClaimQR/src/verify-qr-cl.ts:26:9
I think it not working decoding QR (jsqr module)...
Based on the examples, it looks like you're mixing base64 (the digests) and base64url (the compact JWS+appendix). Probably best to just use base64url uniformly everywhere?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.