Add FIPS-202 SHA3-256 to Bulk Evidence Hash Reporter (#2) - #30
Open
quantamShade0337 wants to merge 2 commits into
Open
Add FIPS-202 SHA3-256 to Bulk Evidence Hash Reporter (#2)#30quantamShade0337 wants to merge 2 commits into
quantamShade0337 wants to merge 2 commits into
Conversation
…associates-oss#2) - New "SHA3-256 (FIPS 202)" column computed per file, plus PDF and Word report columns, and real-time System Console logging when SHA-3 is computed. - Uses js-sha3's sha3_256 for standards-compliant FIPS-202 SHA-3. CryptoJS.SHA3 is legacy Keccak (SHA3("")=c5d2460..., vs FIPS-202 SHA3-256("")=a7ffc6f8...), so it is intentionally NOT used for this forensic-compliance column. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds SHA3-256 (FIPS 202) hashing support and a lightweight “System Console” UI to improve hashing transparency, and updates export generation to include SHA3-256.
Changes:
- Load
js-sha3and compute/display SHA3-256 alongside existing MD5/SHA-256 hashes. - Add a “System Console” panel and log hash-computation events to it.
- Update PDF/Word report generation to include SHA3-256 and make exports
async.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
11
to
15
| <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script> | ||
| <!-- js-sha3 provides standards-compliant FIPS 202 SHA-3 (CryptoJS.SHA3 is legacy Keccak, not FIPS 202). --> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/js-sha3/0.8.0/sha3.min.js"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.25/jspdf.plugin.autotable.min.js"></script> |
Comment on lines
+931
to
+941
| async function calculateSHA3(file) { | ||
| return new Promise(resolve => { | ||
| const reader = new FileReader(); | ||
| reader.onload = e => { | ||
| const sha3 = sha3_256(e.target.result); | ||
| addSystemLog(`SHA3-256 calculated for ${file.name}`); | ||
| resolve(sha3); | ||
| }; | ||
| reader.readAsArrayBuffer(file); | ||
| }); | ||
| } |
Comment on lines
+728
to
+741
| for (const tr of document.querySelectorAll("#hashTableBody tr")) { | ||
| if (tr.querySelector('input').checked) { | ||
| const cells = tr.querySelectorAll('td'); | ||
| const file = tr.fileData; | ||
| const sha256 = file ? await calculateSHA256(file) : cells[4].innerText; | ||
| const sha3 = file ? await calculateSHA3(file) : cells[5].innerText; | ||
| rows.push([ | ||
| cells[1].innerText, | ||
| cells[2].innerText, | ||
| cells[4].innerText | ||
| file ? file.name : cells[2].innerText, | ||
| sha256, | ||
| sha3 | ||
| ]); | ||
| } | ||
| }); | ||
| } |
Comment on lines
+943
to
+951
| function addSystemLog(message) { | ||
| const consolePanel = document.getElementById('systemConsole'); | ||
| if (!consolePanel) return; | ||
| const entry = document.createElement('div'); | ||
| entry.className = 'system-console-entry'; | ||
| entry.innerText = `[${new Date().toLocaleTimeString()}] ${message}`; | ||
| consolePanel.appendChild(entry); | ||
| consolePanel.scrollTop = consolePanel.scrollHeight; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2 — adds SHA3-256 (FIPS 202) to the Bulk Evidence Hash Reporter.
What's added
Correctness note (important for forensic / FIPS compliance)
This uses
js-sha3'ssha3_256— standards-compliant FIPS 202 SHA-3 — notCryptoJS.SHA3, which is legacy Keccak and produces different digests:""a7ffc6f8…f8434ac5d24601…85a470"abc"3a985da7…4315324e03657a…2d6c45Since the issue specifies FIPS 202, using Keccak would yield non-compliant hashes; this PR avoids that pitfall.
js-sha3is loaded from cdnjs and accepts the fileArrayBufferdirectly.Notes
/claim #2