Educational ICT Virtualisation Specialist

Twitter LinkedIn E-mail
Precedence Technologies Ltd
Technology House, 36a Union Lane
Cambridge, CB4 1QB, United Kingdom
T: +44 (0)8456 446 800 / +44 (0)1223 359900
E: enquiries@precedence.co.uk
Checksums

Jump To: Support > KB > Windows > Checksums

Calculating checksums of files without needing any extra software

Checksums are useful to confirm that a file has not been altered or corrupted. This is particularly handy when large files are being moved around. Common checksum methods are MD5, SHA1, SHA256, SHA384 and SHA512. NetManager, Linux and pretty much every Unix-type OS include tools to calculate these. For example:

netmanager12# cksum -a SHA256 AtomIQx3*.vhd
SHA256 (AtomIQx3-10L.vhd) = 0e1f1b07bbf7cc1d9c0e05e77fe4c314824cacde84a5ea20708f0b2ee60ff80b
SHA256 (AtomIQx3-7.vhd) = 36d6f2c253c7cf86c5252a9f5578b3c0c8c57764f5ebb6b26fb86b8faf08f862

The Unix tools allow you to cksum multiple files at once and also, usefully, compare checksums against a given list. Windows has a built-in tool too; its output is not as easy to read and it only works on one file at once, but it does mean you don't need to find and install third-party software. The command is: certutil -hashfile <filename> <checksum-type>. For example, certutil -hashfile myfilename.vhd SHA256. Here's the output for the same files as above:

E:\Software>certutil -hashfile AtomIQx3-10L.vhd SHA256
SHA256 hash of file AtomIQx3-10L.vhd:
0e 1f 1b 07 bb f7 cc 1d 9c 0e 05 e7 7f e4 c3 14 82 4c ac de 84 a5 ea 20 70 8f 0b 2e e6 0f f8 0b
CertUtil: -hashfile command completed successfully.

E:\Software>certutil -hashfile AtomIQx3-7.vhd SHA256
SHA256 hash of file AtomIQx3-7.vhd:
36 d6 f2 c2 53 c7 cf 86 c5 25 2a 9f 55 78 b3 c0 c8 c5 77 64 f5 eb b6 b2 6f b8 6b 8f af 08 f8 62
CertUtil: -hashfile command completed successfully.

Alternatively, you can use PowerShell's Get-FileHash cmdlet which has better output (it also defaults to SHA256, so less typing), plus you can use pipelines to work on multiple files (requires PowerShell 4, so standard on Server 2012R2 and later):

PS E:\Software> Get-ChildItem  AtomIQx3*.vhd | Get-FileHash | Format-List

Algorithm : SHA256
Hash      : 0E1F1B07BBF7CC1D9C0E05E77FE4C314824CACDE84A5EA20708F0B2EE60FF80B
Path      : E:\Software\AtomIQx3-10L.vhd

Algorithm : SHA256
Hash      : 36D6F2C253C7CF86C5252A9F5578B3C0C8C57764F5EBB6B26FB86B8FAF08F862
Path      : E:\Software\AtomIQx3-7.vhd
© Copyright Precedence Technologies 1999-2024
Page last modified on June 14, 2019, at 10:32 AM by sborrill