Always check and verify! ======================== Published : 24 March 2025 Reading : 2 min Tags : Security URL : https://ctrl-find.nl/posts/checksum/ Plain text : https://ctrl-find.nl/posts/checksum/index.txt ------------------------------------------------------------ ### What is a checksum A Checksum is a digital fingerprint of a file or code. Software creators and/or companies are creating these digital fingerprints for safety reasons. One of the most common usecases is checking if a downloaded file is changed by a third party. if the checksum is different from the one that the creators provided, it most likely has been corrupted or tampered with. We dont need external programs or a website (where we need to upload a file) to give us a checksum of a file. It is fairly easy and shown down below in two categories: Windows and Linux(MacOS). #### Windows By clicking on the windows icon on the server (given it is in graphic mode otherwise your already in a terminal) or desktop. Search for `Powershell` or `Command Prompt`, we do not need elevated priveleges (admin rights) on the machine. Then we run the following command; ```powershell certutil -hashfile [HashAlgorithm] ``` The following `HashAgoriths` can be used: `MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512` #### Linux When on desktop, find the launcher and search for `terminal` or use the keyboard shortcut: **ctrl-alt-t** On a server you are already on the systems terminal. ```bash [HashAlgorithm]sum ``` The following `HashAgoriths` can be used: `MD5 SHA1 SHA256 SHA384 SHA512` #### Example This example works the same on linux with different commands. i've created a test.txt file with some info text in it.LEts check the hash ```powershell certutil -hashfile test.txt sha256 ``` #### Output ```powershell SHA256 hash of test.txt: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 CertUtil: -hashfile command completed successfully. ``` When we change the text inside the test.txt file and run the command again, the hash changes: ```powershell SHA256 hash of test.txt: a5b40cf7147479b452c3b51feefc2f7cd0c926121033b2cfd09f1ae1c825ec30 CertUtil: -hashfile command completed successfully. ``` An overview of the changed sha256 checksums. ```powershell Initial: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 changed: a5b40cf7147479b452c3b51feefc2f7cd0c926121033b2cfd09f1ae1c825ec30 ``` ------------------------------------------------------------ NAVIGATION [index] https://ctrl-find.nl/posts/index.txt [<< prev] Testing Ansible code https://ctrl-find.nl/posts/ansible_testing/index.txt [next >>] Containers?! https://ctrl-find.nl/posts/containers/index.txt ------------------------------------------------------------ CTRL-Find — Debugging all systems https://ctrl-find.nl/