{"id":2080,"date":"2021-06-10T15:59:10","date_gmt":"2021-06-10T12:59:10","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=2080"},"modified":"2023-03-02T10:04:45","modified_gmt":"2023-03-02T08:04:45","slug":"how-to-work-with-file-checksums","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/how-to-work-with-file-checksums\/","title":{"rendered":"How to Work With File Checksums"},"content":{"rendered":"\n<p><b>Checksums are alphanumeric character <\/b><span style=\"font-weight: 400;\">sequences produced by running files through an <\/span><b>algorithm<\/b><span style=\"font-weight: 400;\">. They are especially helpful in verifying file integrity since small changes in files can result in significant checksum differences.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">One example of a way checksums are helpful can be to ensure your backup files are not corrupted. By doing so,<\/span><b> you will gain an additional layer of security<\/b><span style=\"font-weight: 400;\">&#8211; if anything goes wrong with your site, you can restore it from files that are known to be undamaged.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-weight: 400;\">Generating a Checksum<\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">You can generate a checksum for any file by accessing the command line on your server. Use SSH to connect to your account (<\/span><i><span style=\"font-weight: 400;\">See \u201c<\/span><\/i><a href=\"https:\/\/www.scalahosting.com\/kb\/access-server-ssh\/\"><b><i>Connect to My Server With SSH<\/i><\/b><\/a><i><span style=\"font-weight: 400;\">\u201d)<\/span><\/i><span style=\"font-weight: 400;\">, then generate the checksum as follows:<\/span><\/p>\n\n\n\n<p><b>md5sum file &gt; checksum.txt<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The above command will generate a checksum file called<\/span><b> \u201cchecksum.txt\u201d using the MD5 algorithm<\/b><span style=\"font-weight: 400;\">. Another commonly used checksum algorithm is SHA, a general term for a group of similar algorithms such as<\/span><b> SHA-256 and SHA-512.&nbsp;<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">SHA algorithms are denoted separately due to the varying length of the hash value\u2019s bit length. For example, <\/span><b>SHA-256 will be SHA with a 256-bit length.<\/b><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-weight: 400;\">How to Verify Checksums<\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Generating the checksum is only half of the job done. Once the file moves for any reason, it should be verified. To verify your file checksum, <\/span><b>connect to your server again via SSH and type the following instruction;<\/b><\/p>\n\n\n\n<p><b>md5sum -c checksum.txt<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The result of this check will either be an <\/span><b>\u201cOK\u201d or \u201cFAILED.\u201d<\/b><span style=\"font-weight: 400;\"> Failed checksums mean there is a problem with the file integrity. While the difference may be minor, it can also be challenging to tell the exact problem.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">If your file fails a checksum verification, you should discard the file and transfer a fresh copy. Then, you must rerun the <\/span><b>checksum verification<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Checksums are alphanumeric character sequences produced by running files through an algorithm. They are especially helpful in verifying file integrity since small changes in files can result in significant checksum differences. One example of a way checksums are helpful can be to ensure your backup files are not corrupted. By doing so, you will gain [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_analysis_target_kw":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-2080","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=2080"}],"version-history":[{"count":2,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2080\/revisions"}],"predecessor-version":[{"id":5426,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2080\/revisions\/5426"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=2080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=2080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=2080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}