Skip to content

test: add hash resilience benchmark for ZK pipeline (#38)#45

Open
Tenerife-Q wants to merge 2 commits intoc2siorg:mainfrom
Tenerife-Q:test/hash-fragility-benchmark
Open

test: add hash resilience benchmark for ZK pipeline (#38)#45
Tenerife-Q wants to merge 2 commits intoc2siorg:mainfrom
Tenerife-Q:test/hash-fragility-benchmark

Conversation

@Tenerife-Q
Copy link
Copy Markdown

Added a standalone benchmark script to simulate how decentralized storage gateways (e.g., IPFS/NFT.storage) handle image uploads. Gateways often apply benign compression, such as stripping EXIF data or a 95% quality re-encode, to save bandwidth.

TL;DR: The current SHA-256 verification fails entirely under normal network conditions due to the avalanche effect. pHash effectively survives.

Here is the benchmark execution output:

Original SHA-256 : 509a84a2a30c7bd9e8914958a3dc447e7bc4a35cda5575d70383e659fee918dd
Original pHash   : c7c7383830c7c7c6

[Stage 2: Simulated Storage Gateway (95% JPEG Quality)]
New SHA-256      : 6d012dc328363b130b85fc2ea60626aaeec050a311d916433e66fceb60c7aecb
New pHash        : c6c7383830c7c7c7

[Stage 3: Verification Analysis]
SHA-256 Match    : False
                   (Strict hashing failed due to avalanche effect)
pHash Match      : True
Hamming Distance : 2
                   (Passed within configurable threshold <= 5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant