Skip to content

Add FIPS-202 SHA3-256 to Bulk Evidence Hash Reporter (#2) - #30

Open
quantamShade0337 wants to merge 2 commits into
amithmandassociates-oss:mainfrom
quantamShade0337:feat/sha3-256-fips202
Open

Add FIPS-202 SHA3-256 to Bulk Evidence Hash Reporter (#2)#30
quantamShade0337 wants to merge 2 commits into
amithmandassociates-oss:mainfrom
quantamShade0337:feat/sha3-256-fips202

Conversation

@quantamShade0337

Copy link
Copy Markdown

Closes #2 — adds SHA3-256 (FIPS 202) to the Bulk Evidence Hash Reporter.

What's added

  • A SHA3-256 (FIPS 202) column in the evidence table, computed per uploaded file alongside MD5/SHA-256.
  • SHA3-256 included in the PDF and Word (.docx) forensic report exports.
  • A System Console panel with real-time logging when SHA-3 is calculated (as requested in the issue).

Correctness note (important for forensic / FIPS compliance)

This uses js-sha3's sha3_256 — standards-compliant FIPS 202 SHA-3 — not CryptoJS.SHA3, which is legacy Keccak and produces different digests:

input FIPS-202 SHA3-256 (this PR) CryptoJS.SHA3 (Keccak)
"" a7ffc6f8…f8434a c5d24601…85a470
"abc" 3a985da7…431532 4e03657a…2d6c45

Since the issue specifies FIPS 202, using Keccak would yield non-compliant hashes; this PR avoids that pitfall. js-sha3 is loaded from cdnjs and accepts the file ArrayBuffer directly.

Notes

  • Existing MD5/SHA-256 behaviour and exports are unchanged.
  • The unrelated email-header CSV export was left untouched.

/claim #2

…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>
Copilot AI review requested due to automatic review settings June 4, 2026 03:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-sha3 and 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 thread index.html Outdated
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 thread index.html Outdated
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 thread index.html
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 thread index.html Outdated
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;
}
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.

Add SHA-3 (Keccak) Hashing Support

2 participants