<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>giantrobot</author><text>This has a number of problems.&lt;p&gt;The most egregious is if I&amp;#x27;m an attacker and I have the file you request I can hash the appropriate portion you&amp;#x27;d use to verify it but fill the rest with junk or exploits. You&amp;#x27;d receive the file, it would emit the correct hash, yet be not what you were expecting.&lt;p&gt;For video especially what you receive isn&amp;#x27;t necessarily predictable by the client. With HLS or MPEG DASH streaming the video you receive could be one of a number of different encoding e.g. lower or higher bitrates to deal with changing network conditions. The actual m3u8&amp;#x2F;mpd file you might receive could change arbitrarily as the video provider adds or drops different encodings. The hash of such a file today isn&amp;#x27;t guaranteed to match the hash tomorrow for entirely banal non-malicious reasons.&lt;p&gt;Fun fact: the UUHash algorithm used by the FastTrack network (Kazaa, Morpheus, etc) only hashed the first bit of a file. Hashing a large file took forever on hardware of the day. Even hashing small files was non-trivial. The RIAA through various fronts would insert spoofed files where the first portion of the file was legitimate but the content of the file would be junk or annoying sounds. The files would be named like any other MP3 someone was searching for and even have seemingly good IDv3 tags.</text><parent_chain><item><author>skipants</author><text>I don&amp;#x27;t have expertise in video codecs or file formats, but couldn&amp;#x27;t you hash the first N bytes of a stream? Stream those N bytes to the client and if it matches start the video, else stop the download and not start the video.</text></item><item><author>kazinator</author><text>Problem is, you have to download the entire video to check the hash. That&amp;#x27;s not how video embedding works; the client browser is just handed some link, and it obtains pieces of the video, rendering it instantly.&lt;p&gt;Basically, little segments of the video have to have a signature which is continuously validated. Or something like that.</text></item><item><author>elihu</author><text>One idea that&amp;#x27;s been around for awhile is to identify files by their hash.  That has pros and cons.  The good side of that is that the file is immutable; you can&amp;#x27;t accidentally link to something else unless someone can manufacture a hash collision somehow.  The down side is that if the file is corrected in some way, you don&amp;#x27;t get the fixes.&lt;p&gt;In a lot of the peer-to-peer distributed hash table designs, all you need to retrieve a file is its hash.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Content_addressable_network&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Content_addressable_network&lt;/a&gt;</text></item><item><author>ignitionmonkey</author><text>We can&amp;#x27;t and shouldn&amp;#x27;t expect people to keep their old domains forever. We need a way for pages to be signed and hyperlinks to enforce authorship. When we link to stuff, we should have a way to say whose stuff we&amp;#x27;re linking to. It&amp;#x27;s no different from installing signed software and using trusted repositories.&lt;p&gt;This is one of the reasons I created a proof-of-concept web extension that verifies links and pages using PGP. On a mismatch, it flags the page and offers a web archive link instead.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;webverify.jahed.dev&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;webverify.jahed.dev&amp;#x2F;&lt;/a&gt;&lt;p&gt;It was pretty fun to make, but currently due to performance, Web Extensions API doesn&amp;#x27;t provide the features to do this perfectly. Firefox provides just about enough additional APIs to hack it together.</text></item></parent_chain></comment><story><title>Old Vidme embeds turn into porn after domain purchase</title><url>https://www.theverge.com/2021/7/22/22589403/porn-site-bought-expired-video-hosting-site-old-embeds</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>AgentME</author><text>Merkle trees basically accomplish this with separate hashes over every N bytes, so that the content can be verified continuously as it&amp;#x27;s downloaded.</text><parent_chain><item><author>skipants</author><text>I don&amp;#x27;t have expertise in video codecs or file formats, but couldn&amp;#x27;t you hash the first N bytes of a stream? Stream those N bytes to the client and if it matches start the video, else stop the download and not start the video.</text></item><item><author>kazinator</author><text>Problem is, you have to download the entire video to check the hash. That&amp;#x27;s not how video embedding works; the client browser is just handed some link, and it obtains pieces of the video, rendering it instantly.&lt;p&gt;Basically, little segments of the video have to have a signature which is continuously validated. Or something like that.</text></item><item><author>elihu</author><text>One idea that&amp;#x27;s been around for awhile is to identify files by their hash.  That has pros and cons.  The good side of that is that the file is immutable; you can&amp;#x27;t accidentally link to something else unless someone can manufacture a hash collision somehow.  The down side is that if the file is corrected in some way, you don&amp;#x27;t get the fixes.&lt;p&gt;In a lot of the peer-to-peer distributed hash table designs, all you need to retrieve a file is its hash.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Content_addressable_network&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Content_addressable_network&lt;/a&gt;</text></item><item><author>ignitionmonkey</author><text>We can&amp;#x27;t and shouldn&amp;#x27;t expect people to keep their old domains forever. We need a way for pages to be signed and hyperlinks to enforce authorship. When we link to stuff, we should have a way to say whose stuff we&amp;#x27;re linking to. It&amp;#x27;s no different from installing signed software and using trusted repositories.&lt;p&gt;This is one of the reasons I created a proof-of-concept web extension that verifies links and pages using PGP. On a mismatch, it flags the page and offers a web archive link instead.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;webverify.jahed.dev&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;webverify.jahed.dev&amp;#x2F;&lt;/a&gt;&lt;p&gt;It was pretty fun to make, but currently due to performance, Web Extensions API doesn&amp;#x27;t provide the features to do this perfectly. Firefox provides just about enough additional APIs to hack it together.</text></item></parent_chain></comment><story><title>Old Vidme embeds turn into porn after domain purchase</title><url>https://www.theverge.com/2021/7/22/22589403/porn-site-bought-expired-video-hosting-site-old-embeds</url></story>