Add SHA-3 hash reporting support - #13
Open
MolhamHamwi wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds SHA-3-256 hashing to the evidence workflow so the UI table and generated forensic outputs include an additional SHA-3-256 value alongside existing hashes.
Changes:
- Added a SHA-3-256 column to the on-page evidence hash table and compute it via
CryptoJS.SHA3(..., { outputLength: 256 }). - Included SHA-3-256 values in the Hash PDF/Word exports and in the email forensic PDF + CSV export paths.
- Introduced a generic
calculateHashhelper to support SHA-256 and SHA-3-256 calculations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <th width="25%">Filename</th> | ||
| <th width="18%">MD5 Hash</th> | ||
| <th width="32%">SHA-256 (Section 63 BSA Compliant)</th> | ||
| <th width="20%">SHA-3-256 Hash</th> |
Comment on lines
523
to
+525
| row.querySelector('.sha256').innerText = CryptoJS.SHA256(wordArray).toString(); | ||
| row.querySelector('.sha3').innerText = CryptoJS.SHA3(wordArray, { outputLength: 256 }).toString(); | ||
| console.log(`SHA-3-256 calculated for ${file.name}`); |
Comment on lines
617
to
621
| const text = await readFile(files[i]); | ||
| const emailData = parseEml(text); | ||
| const sha256 = await calculateSHA256(files[i]); | ||
| const sha256 = await calculateHash(files[i], 'SHA256'); | ||
| const sha3 = await calculateHash(files[i], 'SHA3-256'); | ||
|
|
Comment on lines
+904
to
914
| async function calculateHash(file, algorithm = 'SHA256') { | ||
| return new Promise(resolve => { | ||
| const reader = new FileReader(); | ||
| reader.onload = e => { | ||
| const wordArray = CryptoJS.lib.WordArray.create(e.target.result); | ||
| if (algorithm === 'SHA3-256') { | ||
| resolve(CryptoJS.SHA3(wordArray, { outputLength: 256 }).toString()); | ||
| return; | ||
| } | ||
| resolve(CryptoJS.SHA256(wordArray).toString()); | ||
| }; |
Comment on lines
867
to
870
| readFile(tr.fileData).then(text => { | ||
| const eml = parseEml(text); | ||
| return `${counter++},"${eml.subject}","${eml.from}","${eml.to}","${eml.date}","${eml.serverIP}","${eml.dkim}","${cells[4].innerText}"\n`; | ||
| return `${counter++},"${eml.subject}","${eml.from}","${eml.to}","${eml.date}","${eml.serverIP}","${eml.dkim}","${cells[4].innerText}","${cells[5].innerText}"\n`; | ||
| }) |
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.
Summary
Verification
node --checkagainst the inline script extracted fromindex.htmlCloses #2