diff --git a/index.html b/index.html index d276a17..9ddccbd 100644 --- a/index.html +++ b/index.html @@ -287,9 +287,10 @@
Drag & Drop Evidence Files Here
# - Filename - MD5 Hash - SHA-256 (Section 63 BSA Compliant) + Filename + MD5 Hash + SHA-256 (Section 63 BSA Compliant) + SHA-3 (Keccak-256) @@ -497,6 +498,7 @@
Yahoo/Outlook:
Calculating... Calculating... + Calculating... `); fileQueue.push({ file, rowId }); @@ -519,6 +521,9 @@
Yahoo/Outlook:
if (row) { row.querySelector('.md5').innerText = CryptoJS.MD5(wordArray).toString(); row.querySelector('.sha256').innerText = CryptoJS.SHA256(wordArray).toString(); + const sha3 = CryptoJS.SHA3(wordArray, { outputLength: 256 }).toString(); + row.querySelector('.sha3').innerText = sha3; + console.log(`[System Console] SHA-3 (Keccak-256) calculated for "${file.name}": ${sha3}`); } processQueue(); }, 50); @@ -613,6 +618,7 @@
Yahoo/Outlook:
const text = await readFile(files[i]); const emailData = parseEml(text); const sha256 = await calculateSHA256(files[i]); + const sha3 = await calculateSHA3(files[i]); // HEADER WITH WRAPPED FILENAME doc.setFillColor(0, 51, 102); @@ -646,7 +652,8 @@
Yahoo/Outlook:
['Message-ID', emailData.messageId], ['Originating IP', emailData.serverIP], ['DKIM Status', emailData.dkim], - ['SHA-256 Hash', sha256] + ['SHA-256 Hash', sha256], + ['SHA-3 (Keccak-256) Hash', sha3] ], theme: 'grid', headStyles: { @@ -715,7 +722,8 @@
Yahoo/Outlook:
rows.push([ cells[1].innerText, cells[2].innerText, - cells[4].innerText + cells[4].innerText, + cells[5].innerText ]); } }); @@ -727,22 +735,23 @@
Yahoo/Outlook:
doc.autoTable({ startY: 70, - head: [['#', 'Filename', 'SHA-256']], + head: [['#', 'Filename', 'SHA-256', 'SHA-3 (Keccak-256)']], body: rows, theme: 'grid', - headStyles: { + headStyles: { fillColor: [0, 51, 102], fontSize: 11, fontStyle: 'bold' }, - bodyStyles: { + bodyStyles: { fontSize: 9, font: 'courier' }, columnStyles: { - 0: { cellWidth: 40 }, - 1: { cellWidth: 300 }, - 2: { cellWidth: 450, font: 'courier' } + 0: { cellWidth: 30 }, + 1: { cellWidth: 190 }, + 2: { cellWidth: 285, font: 'courier' }, + 3: { cellWidth: 285, font: 'courier' } } }); @@ -777,11 +786,18 @@
Yahoo/Outlook:
shading: { fill: "003366" } }), new TableCell({ - children: [new Paragraph({ + children: [new Paragraph({ children: [new TextRun({ text: "SHA-256", bold: true, color: "FFFFFF" })], alignment: AlignmentType.CENTER })], shading: { fill: "003366" } + }), + new TableCell({ + children: [new Paragraph({ + children: [new TextRun({ text: "SHA-3 (Keccak-256)", bold: true, color: "FFFFFF" })], + alignment: AlignmentType.CENTER + })], + shading: { fill: "003366" } }) ] })); @@ -793,8 +809,11 @@
Yahoo/Outlook:
children: [ new TableCell({ children: [new Paragraph(cells[1].innerText)] }), new TableCell({ children: [new Paragraph(cells[2].innerText)] }), - new TableCell({ children: [new Paragraph({ + new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: cells[4].innerText, font: "Courier New", size: 18 })] + })] }), + new TableCell({ children: [new Paragraph({ + children: [new TextRun({ text: cells[5].innerText, font: "Courier New", size: 18 })] })] }) ] })); @@ -837,7 +856,7 @@
Yahoo/Outlook:
// ===== DOWNLOAD CSV ===== function downloadSelectedCSV() { - let csv = "#,Subject,From,To,Date,Originating IP,DKIM,SHA-256\n"; + let csv = "#,Subject,From,To,Date,Originating IP,DKIM,SHA-256,SHA-3 (Keccak-256)\n"; let counter = 1; const promises = []; @@ -848,7 +867,7 @@
Yahoo/Outlook:
promises.push( 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`; }) ); } @@ -894,6 +913,19 @@
Yahoo/Outlook:
}); } + async function calculateSHA3(file) { + return new Promise(resolve => { + const reader = new FileReader(); + reader.onload = e => { + const wordArray = CryptoJS.lib.WordArray.create(e.target.result); + const sha3 = CryptoJS.SHA3(wordArray, { outputLength: 256 }).toString(); + console.log(`[System Console] SHA-3 (Keccak-256) calculated for "${file.name}": ${sha3}`); + resolve(sha3); + }; + reader.readAsArrayBuffer(file); + }); + } + function toggleAll(checkbox) { document.querySelectorAll('input[name="fileSelect"]').forEach(c => c.checked = checkbox.checked); }