Hash values are also useful for verifying the integrity of data sent through insecure channels. The hash value of received data can be compared to the hash value of data as it was sent to determine whether the data was altered. Source.
A common approach used in data transmission is for the sender to create a unique fingerprint of the data using a one-way hashing algorithm. The hash is sent to the receiver along with the data. The data's hash is recalculated and compared to the original by the receiver to ensure the data wasn't lost or modified in transit. Source.
If the hash of some data is computed and sent along w/ the data, can't an attacker alter the data, re-compute the hash and the receiver would be none the wiser?
apt-getworks: you get pgp keys baked into your distribution (with the iso whose hash you get from the distribution's website) and the package downloads themselves can be plain HTTP from various mirrors hosted by all sorts of third parties. – Luc May 27 '20 at 08:11