Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 30 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/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>
<script src="https://unpkg.com/docx@7.1.0/build/index.js"></script>
Expand Down Expand Up @@ -289,7 +290,8 @@ <h5 class="fw-bold">Drag & Drop Evidence Files Here</h5>
<th width="5%">#</th>
<th width="30%">Filename</th>
<th width="20%">MD5 Hash</th>
<th width="40%">SHA-256 (Section 63 BSA Compliant)</th>
<th width="20%">SHA-256 (Section 63 BSA Compliant)</th>
<th width="20%">SHA-3-256 (FIPS 202)</th>
</tr>
</thead>
<tbody id="hashTableBody" style="background: white;"></tbody>
Expand Down Expand Up @@ -497,6 +499,7 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>
</td>
<td class="hash-font md5">Calculating...</td>
<td class="hash-font sha256">Calculating...</td>
<td class="hash-font sha3">Calculating...</td>
</tr>
`);
fileQueue.push({ file, rowId });
Expand All @@ -519,6 +522,9 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>
if (row) {
row.querySelector('.md5').innerText = CryptoJS.MD5(wordArray).toString();
row.querySelector('.sha256').innerText = CryptoJS.SHA256(wordArray).toString();
const sha3Hash = CryptoJS.SHA3(wordArray, { outputLength: 256 }).toString();
row.querySelector('.sha3').innerText = sha3Hash;
console.log(`[SHA-3] ${file.name}: ${sha3Hash}`);
}
processQueue();
}, 50);
Expand Down Expand Up @@ -715,7 +721,8 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>
rows.push([
cells[1].innerText,
cells[2].innerText,
cells[4].innerText
cells[4].innerText,
cells[5].innerText
]);
}
});
Expand All @@ -727,22 +734,23 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>

doc.autoTable({
startY: 70,
head: [['#', 'Filename', 'SHA-256']],
head: [['#', 'Filename', 'SHA-256', 'SHA-3-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: 250 },
2: { cellWidth: 250, font: 'courier' },
3: { cellWidth: 250, font: 'courier' }
}
});

Expand Down Expand Up @@ -777,11 +785,18 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>
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-256", bold: true, color: "FFFFFF" })],
alignment: AlignmentType.CENTER
})],
shading: { fill: "003366" }
})
]
}));
Expand All @@ -793,8 +808,11 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>
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 })]
})] })
]
}));
Expand Down Expand Up @@ -837,7 +855,7 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>

// ===== 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-256\n";

let counter = 1;
const promises = [];
Expand All @@ -848,7 +866,7 @@ <h6 class="fw-bold mt-3">Yahoo/Outlook:</h6>
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`;
})
);
}
Expand Down