Verifying Open-Source Desktop Downloads in the Browser with Web Crypto SHA-256
When an open-source desktop app goes viral, two things happen immediately: people ask "is it safe?", and unofficial download mirrors start popping up. While maintaining PhotoCraft Online — an independent guide library a
When an open-source desktop app goes viral, two things happen immediately: people ask "is it safe?", and unofficial download mirrors start popping up.
While maintaining PhotoCraft Online — an independent guide library and self-hosted WebAssembly instance of the open-source PhotoCraft editor by the ArtCraft team and contributors (we are not the official project and are not affiliated with Adobe) — we noticed that two of the most common user questions were:
- Which Windows/macOS/Linux installer matches my CPU architecture?
- How do I verify the SHA-256 checksum without opening PowerShell or Terminal?
Why a Client-Side Verifier Works Better Than Asking Users to Run certutil
Most non-technical users skip checksum verification because Get-FileHash or shasum -a 256 adds too much friction. On the other hand, asking users to upload a 90 MB installer to a server just to hash it is slow, wasteful, and terrible for privacy.
Modern browsers already expose crypto.subtle.digest('SHA-256', buffer) over HTTPS, which runs completely locally in the browser without uploading the file anywhere.
The Guardrails That Actually Matter
Writing the hash call is three lines of JavaScript, but shipping a reliable browser verifier needs a few practical guardrails:
export const MAX_DOWNLOAD_VERIFICATION_BYTES = 128 * 1024 * 1024; // 128 MiB
export async function verifyPhotoCraftDownload(
file: Pick<File, 'name' | 'size' | 'arrayBuffer'>
) {
const hashes = PHOTOCRAFT_DOWNLOAD_RELEASE.hashes;
if (!Object.hasOwn(hashes, file.name)) {
return { status: 'unknown-file' };
}
if (file.size > MAX_DOWNLOAD_VERIFICATION_BYTES) {
return { status: 'too-large' };
}
if (!globalThis.crypto?.subtle) {
return { status: 'unsupported' };
}
const digest = await globalThis.crypto.subtle.digest(
'SHA-256',
await file.arrayBuffer()
);
const actualHash = Array.from(new Uint8Array(digest), (byte) =>
byte.toString(16).padStart(2, '0')
).join('');
const expectedHash = hashes[file.name as keyof typeof hashes];
return {
status: actualHash === expectedHash ? 'match' : 'mismatch',
expectedHash,
actualHash,
};
}
Four details turned out to be important in practice:
-
Refuse oversized files before
file.arrayBuffer(): Web Crypto buffers the full input in memory. Since all nine official PhotoCraft v0.16.0 packages (Windows x64/ARM64/x86 MSI & portable ZIP, macOS universal DMG, and Linux x86_64/aarch64 AppImage) are under 100 MB, capping at 128 MiB avoids crashing low-memory tabs if someone accidentally selects a multi-gigabyte file. -
Strict filename lookup with
Object.hasOwn: Never match against prototype properties, and surface an explicitunknown-filestate when a file was renamed or comes from another release, along with manual CLI fallback commands. -
Check
crypto.subtleavailability: Web Crypto is unavailable in insecure HTTP contexts or restricted webviews, so degrade cleanly to command-line instructions. -
Be honest about what SHA-256 does (and does not) prove: A matching hash confirms the file matches the upstream GitHub release
SHA256SUMS.txt. It is not a virus scan or a code audit.
You can try the live browser-local verifier alongside the architecture selection guide on our PhotoCraft download and checksum verification page, or read the full breakdown of official builds vs. browser hosting vs. third-party plugins in our PhotoCraft safety guide.
Separating Web v0.5.0 From Desktop v0.16.0 & Third-Party AI Plugins
Another major source of confusion for users is that the hosted browser build (WebAssembly v0.5.0) and the desktop releases (v0.16.0) are different builds with different capabilities:
- Browser editing runs locally via WebAssembly/WebGPU with no account and no built-in cloud generative AI.
- Desktop AI workflows (such as generative fill) rely on separate third-party local integrations like OpenFill 0.2.4 or ComfyUI Bridge, which depend heavily on OS, desktop build hash, and GPU (CUDA vs. AMD vs. Apple Silicon).
To prevent users from installing incompatible plugins, we paired our documentation with a small interactive PhotoCraft AI workflow selector and a step-by-step OpenFill generative fill setup guide that checks environment compatibility before people download multi-gigabyte models.
If you maintain documentation or download hubs for open-source desktop software, embedding small browser-local verification tools right next to the release links is one of the highest-signal UX improvements you can add — zero backend cost, zero file uploads, and far fewer confused users.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.