<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>md5sums &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:md5sums</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 13:08:00 +0000</pubDate>
    <item>
      <title>File integrity</title>
      <link>https://personaljournal.ca/paulsutton/file-integrity</link>
      <description>&lt;![CDATA[File integrity&#xA;&#xA;If providing downloadable files, it is important to ensure that the downloaded file is the same as that provided on the host server, this ensures the file has not been tampered with in some way.  The end user needs a way to check what they have downloaded is safe.&#xA;&#xA;One way to do this is to create a file checksum with md5sum&#xA;&#xA;let&#39;s say we have two files&#xA;-rw-rw-r-- 1 psutton psutton  67200 May  3 19:42 jcr.pdf&#xA;-rw-rw-r-- 1 psutton psutton 433231 Apr 28 17:50 southwest1.png&#xA;We want to create a checksum for both files.  To do this we can run&#xA;&#xA;md5sum southwest1.png &#xA;502d4f9dacab9240f2622c032e6ea11f  southwest1.png&#xA;md5sum jcr.pdf &#xA;b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf&#xA;This sends the checksum to stdout&#xA;&#xA;So need a file to store this&#xA;&#xA;md5sum jcr.pdf southwest1.png   md5sum2&#xA;We can then view the contents if this with&#xA;&#xA;as previously discussed the   directs output to a specified file&#xA;&#xA;cat md5sums&#xA;502d4f9dacab9240f2622c032e6ea11f  southwest1.png&#xA;b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf&#xA;&#xA;In this example, we listed the files we want to create a checksum for.&#xA;&#xA;If we were to add a 3rd file say tux.png  then we can do this and append the new checksum with&#xA;md5sum tux.png     md5sums&#xA;Then example our new md5sums file&#xA;cat md5sums&#xA;502d4f9dacab9240f2622c032e6ea11f  southwest1.png&#xA;b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf&#xA;d52cd5e7164eccd6da50e10d5a9c3dbf  tux.png&#xA;&#xA;So now that we have 3 files and a md5sums file,  we can check all the files listed&#xA;&#xA;md5sum -c md5sums&#xA;southwest1.png: OK&#xA;jcr.pdf: OK&#xA;tux.png: OK&#xA;&#xA;Chat&#xA;&#xA;I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.&#xA;&#xA;Tags&#xA;&#xA;#Bash,#BashScripting,#Bashscripting,#md5sums,#md5sum,#file,&#xA;#integrity,#check&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>File integrity</p>

<p>If providing downloadable files, it is important to ensure that the downloaded file is the same as that provided on the host server, this ensures the file has not been tampered with in some way.  The end user needs a way to check what they have downloaded is safe.</p>

<p>One way to do this is to create a file checksum with md5sum</p>

<p>let&#39;s say we have two files</p>

<pre><code>-rw-rw-r-- 1 psutton psutton  67200 May  3 19:42 jcr.pdf
-rw-rw-r-- 1 psutton psutton 433231 Apr 28 17:50 southwest1.png
</code></pre>

<p>We want to create a checksum for both files.  To do this we can run</p>

<pre><code>md5sum southwest1.png 
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
md5sum jcr.pdf 
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf
</code></pre>

<p>This sends the checksum to stdout</p>

<p>So need a file to store this</p>

<pre><code>md5sum jcr.pdf southwest1.png &gt; md5sum2
</code></pre>

<p>We can then view the contents if this with</p>

<p><em>as previously discussed the &gt; directs output to a specified file</em></p>

<pre><code>cat md5sums
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf
</code></pre>

<p>In this example, we listed the files we want to create a checksum for.</p>

<p>If we were to add a 3rd file say tux.png  then we can do this and append the new checksum with</p>

<pre><code>md5sum tux.png &gt;&gt; md5sums
</code></pre>

<p>Then example our new md5sums file</p>

<pre><code>cat md5sums
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf
d52cd5e7164eccd6da50e10d5a9c3dbf  tux.png
</code></pre>

<p>So now that we have 3 files and a md5sums file,  we can check all the files listed</p>

<pre><code>md5sum -c md5sums
southwest1.png: OK
jcr.pdf: OK
tux.png: OK
</code></pre>

<p><strong>Chat</strong></p>

<p>I am on the <a href="https://www.dcglug.org.uk/" rel="nofollow">Devon and Cornwall Linux user group</a> mailing list and also their <a href="https://matrix.to/#/%23dcglug:matrix.org" rel="nofollow">matrix channel</a> as zleap, it is better to ask there, that way others can answer too.</p>

<p><strong>Tags</strong></p>

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:md5sums" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">md5sums</span></a>,<a href="/paulsutton/tag:md5sum" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">md5sum</span></a>,<a href="/paulsutton/tag:file" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">file</span></a>,
<a href="/paulsutton/tag:integrity" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">integrity</span></a>,<a href="/paulsutton/tag:check" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">check</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/file-integrity</guid>
      <pubDate>Thu, 15 May 2025 06:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>