Git Product home page Git Product logo

Comments (5)

bafu avatar bafu commented on June 20, 2024

Choose cai.rights as example

hashlink

self#jumbf=cai/cb.adobe/cai.assertions/cai.rights?hl=mEiBChBVd8onGt71mftnzv4e9C6m67kAeHCK1K8TDtuKfDA

assertion

{"copyright":"Starling Labs"}

$ python3 utils/encode_hashlink.py -i starling.rights.2-spaces.json.txt
Input file: starling.rights.2-spaces.json.txt
hashlink param: mEiAUSYX4dM+r9uhZz4IVP8Z/LFBDJc/x/UAfi6urkpOjmw

$ python3 utils/encode_hashlink.py -i starling.rights.4-spaces.json.txt 
Input file: starling.rights.4-spaces.json.txt
hashlink param: mEiBzzxFzjFEAQUsPQwtzkUHefGTpMegWzfi+bxEUlWSZCw

$ python3 utils/encode_hashlink.py -i starling.rights.no-spaces.json.txt
Input file: starling.rights.no-spaces.json.txt
hashlink param: mEiDERxtUoEmJ2b13EgVVzBZDBcLLnz3GE9qMkCnMwacwEQ

from pyc2pa.

bafu avatar bafu commented on June 20, 2024

Extract the cai/cb.adobe/cai.rights Assertion Superbox

Superbox
LBox 00 00 00 51
TBox 6A 75 6D 62

Description Box
LBox 00 00 00 24
TBox 6A 75 6D 64
db_type 6A 73 6F 6E 00 11 00 10 80 00 00 AA 00 38 9B 71
db_toggle 03
db_label 63 61 69 2E 72 69 67 68 74 73 00 (cai.rights)

Content Box
LBox 00 00 00 25
TBox 6A 73 6F 6E (json)
Content 7B 22 63 6F 70 79 72 69 67 68 74 22 3A 22 53 74 61 72 6C 69 6E 67 20 4C 61 62 73 22 7D

Content (29)

{"copyright":"Starling Labs"}

from pyc2pa.

bafu avatar bafu commented on June 20, 2024

open will add a newline char 0a at the end of content bytes.

The length of read data will be 30 instead of 29. We need to add strip to prevent this issue.

from pyc2pa.

bafu avatar bafu commented on June 20, 2024

Bofu Chen 3:24 PM
@mfisher @dkozma Thanks for Maurice's suggestion and the Claim tool, I update the multi-claim injection function.

Q1 The verify site will only show the newly injected Claim. I took two screenshots of the Chrome console messages, and would you help check them?
From the output of the Claim tool, the multi-claim injection looks okay. The AssertionHash errors should not affect the Claim display because the verification in the verify site has not been enabled?

Q2 For the AssertionHash errors, would you help check the encoding algorithm is correct?
We use the same hashlink generation function for the two Claims: cb.reuters_1 and cb.starling_1, and the Claim tool only returned the AssertionHash errors for cb.starling_1.

Q3 When generating assertion hash, should we use Superbox or raw content (e.g., JSON bytes or thumbnail in a Content Box) as the input?


Leonard Rosenthol 8:25 PM
Q3 - assertion hash is on the raw content


Bofu Chen 2:17 AM
Based on Leonard's answer for Q3, I can answer Q2 by myself now: the hashlink algorithm is correct.
I use the cai/cb.adobe/cai.rights Assertion content as the input

{"coyright":"Starling Labs"}

and can generate the same hash mEiBChBVd8onGt71mftnzv4e9C6m67kAeHCK1K8TDtuKfDA

Checking that why the Claim tool returned the AssertionHash errors if the hashlink algorithm is correct. (root cause and solution)

from pyc2pa.

bafu avatar bafu commented on June 20, 2024

This issue had been fixed by commit 18026b7. Hash algorithm example is utils/encode_hashlink.py

from pyc2pa.

Related Issues (17)

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.