Dev.to Security ๐Ÿ” Cybersecurity ๐Ÿ‘ 0 ๐Ÿ“– 2 min read

Part 2 - This Morning: Why Hash Compare Even Though Torrent Does One?

This Morning: Why Hash Compare Even Though Torrent Does One? The blog said torrent does a hash check, so do I still need to do one? Yes and no: Torrent DOES verify: It splits the ISO into thousands of small pieces, e

This Morning: Why Hash Compare Even Though Torrent Does One?

The blog said torrent does a hash check, so do I still need to do one?

Yes and no:

Torrent DOES verify: It splits the ISO into thousands of small pieces, each with its own
hash inside the .torrent file. It checks each piece as it downloads and re-downloads bad pieces. So at 100% you know the file matches what the torrent file said.

BUT manual SHA256 check proves it came from Canonical officially. Torrent proves integrity,
SHA256SUMS file from ubuntu.com proves authenticity. For a blog and for best practice, I do both.

Steps taken to do the compare this morning:

  1. Got back to the right folder in PowerShell (was stuck in System32): PS C:\users\thefamily1> cd downloads

  2. Ran the official PowerShell hash command:
    PS C:\users\thefamily1\downloads> Get-FileHash .\ubuntu-24.04.5-live-server-amd64.iso -Algorithm SHA256

  3. Got the result:
    Algorithm Hash Path

    SHA256 97F3D7FFB032C3EB3B23D2C8BE9CC76E60C2C1F2C0146BA5BA9FE01CAFAE0FD8 C:\users\thefamily1\downloads\ubuntu-24.04.5-live-server-amd64.iso

  4. Ubuntu's site says to run on Linux:
    echo "97f3d7ffb032c3eb3b23d2c8be9cc76e60c2c1f2c0146ba5ba9fe01cafae0fd8 *ubuntu-24.04.5-live-server-amd64.iso" | shasum -a 256 --check
    That gives an error in PowerShell because shasum doesn't exist on Windows.

  5. Did the PowerShell equivalent instead:
    $expected = "97F3D7FFB032C3EB3B23D2C8BE9CC76E60C2C1F2C0146BA5BA9FE01CAFAE0FD8"
    $actual = (Get-FileHash .\ubuntu-24.04.5-live-server-amd64.iso -Algorithm SHA256).Hash
    if ($actual -eq $expected) { "OK - $actual matches official" } else { "FAIL" }

  6. Result:
    OK - 97F3D7FFB032C3EB3B23D2C8BE9CC76E60C2C1F2C0146BA5BA9FE01CAFAE0FD8 matches official

The hash compare matched so all clear, Ubuntu server should boot this time.

Current DHT: 286 peer nodes, still seeding Ubuntu + running Snowflake to help someone
bypass censorship. Bandwidth sharing morning complete. Ready to mount in VirtualBox.

๐Ÿ“ฐ Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.