Code Monkey home page Code Monkey logo

claimqr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

claimqr's Issues

Use stronger digest derivation function

The current proposal of using salted SHA-256 digests offer minimal resistance to brute-forcing; consider using stronger functions (e.g., PBKDF2, Argon2id, bcrypt).

Can't parse QR when large claim

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)...

Use only one base64 encoding?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.