Open main menu

Changes

1,568 bytes added ,  09:50, 23 June 2009
migrated
==Verify File Integrity==

Sometimes we need to verify that a file created on one system has not been corrupted by any subsequent process of editing, copying, transmission across a network, or email transport. One file claiming to be identical to the source from which is was copied, having the same filename and byte count ''MAY'' be bitwise identical, or it may not be...

Downloading files from the Internet, you routinely see the authors provide a cryptographic signature that can and '''should''' be used to verify the integrity and authenticity of the file which is downloaded.

== How ==
Comparing two files on a single system can be done using the (UNIX) <code>diff</code> command, but for comparing files on two different systems, use of a checksum utility is more reliable.

=== MD5 ===
[http://en.wikipedia.org/wiki/MD5 MD5] ('''Message-Digest algorithm 5''') is one method "commonly used to check the integrity of files... The 128-bit (16-byte) MD5 hashes (also termed message digests) are typically represented as a sequence of 32 hexadecimal digits..."

On Linux systems, try <source lang="bash">md5sum <filename></source> at the command line; on the Solaris systems, try <source lang="bash">md5</source>. The checksum value for a file (or simple string) reported by an MD5 utility should be constant, independent of operating system.

=== SHA1 ===
The SHA family of algorithms are replacing md5 as a more secure cryptographic method.
[[wp:SHA_hash_functions|SHA_hash_functions]]

[[Category:Development]]
[[Category:Best Practices]]
[[Category:Tools]]
4,558

edits