Skip to content

feat: add SHA-3 (Keccak-256) hashing support - #32

Open
vkehs58-oss wants to merge 1 commit into
amithmandassociates-oss:mainfrom
vkehs58-oss:add-sha3-keccak-hashing
Open

feat: add SHA-3 (Keccak-256) hashing support#32
vkehs58-oss wants to merge 1 commit into
amithmandassociates-oss:mainfrom
vkehs58-oss:add-sha3-keccak-hashing

Conversation

@vkehs58-oss

@vkehs58-oss vkehs58-oss commented Jun 10, 2026

Copy link
Copy Markdown

Add SHA-3 (Keccak-256) Hashing Support

Closes #2

What this does

  • New table column — "SHA-3 (Keccak-256)" added to the Bulk Evidence Hash Reporter, computed in the same client-side FileReaderWordArray pipeline as the existing MD5/SHA-256 columns. No new dependencies: the CryptoJS 4.1.1 bundle already shipped with the page includes CryptoJS.SHA3.
  • All report exports updated — the SHA-3 digest is included in:
    • Hash PDF (generateHashPDF, new column with courier styling to match SHA-256)
    • Hash Word (generateHashWord, new header + body cells)
    • Email CSV (downloadSelectedCSV, new trailing column)
    • Email Forensic PDF (generateEmailReport, new "SHA-3 (Keccak-256) Hash" row via a new calculateSHA3() helper mirroring calculateSHA256())
  • Real-time console logging — every SHA-3 calculation logs [System Console] SHA-3 (Keccak-256) calculated for "<file>": <digest> as requested.

A note on Keccak vs FIPS 202 (why the column says "Keccak-256")

CryptoJS.SHA3 implements original Keccak padding, not the final FIPS 202 padding. I verified this against known test vectors before wiring it in:

Input CryptoJS.SHA3(…, {outputLength: 256}) Matches
empty c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 Keccak-256 ✔ (FIPS SHA3-256 would be a7ffc6…)
"abc" 4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 Keccak-256 ✔

Since the issue explicitly requests CryptoJS.SHA3 integration and is titled "SHA-3 (Keccak)", I used it as requested but labeled the column "SHA-3 (Keccak-256)" so reports are honest about the exact algorithm — important for forensic/evidentiary use. If you'd rather have strict FIPS 202 SHA3-256 output, I'm happy to swap in a FIPS-compliant implementation (e.g. js-sha3) in a follow-up commit — just say the word.

I picked the 256-bit output length to match the security level and visual width of the existing SHA-256 column (CryptoJS defaults to 512-bit otherwise, which overflows the table and PDF layouts).

Verification

Tested in headless Chromium by dropping a file with known content ("abc") into the live page:

  • MD5 900150983cd24fb0d6963f7d28e17f72
  • SHA-256 ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
  • SHA-3 (Keccak-256) 4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 ✔ (matches published Keccak-256 test vector)
  • Console shows the real-time [System Console] log line ✔
  • Existing exports keep working: the new column is appended after SHA-256 everywhere, so no existing cell indices shifted ✔

Single-file diff (+47/−15), follows the existing code style throughout.

/claim #2

Adds a SHA-3 (Keccak-256) column to the Bulk Evidence Hash Reporter,
computed client-side via the already-loaded CryptoJS bundle. The new
digest is included in the Hash PDF, Hash Word, Email CSV, and Email
Forensic PDF exports, and each calculation is logged in real time to
the browser console.

Closes amithmandassociates-oss#2
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

1 participant