Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

MD5SUM AmigaDOS
Purpose: Calculates and compare checksums of files.
Format: MD5SUM [{<dir | file | pattern | device>}] [ALL] [TO=<name>] [DEVICES] [SORT] [BUF | BUFFERSIZE=<size>] [CHECK | FROM=<name>] [STATUS] [WARN] [QUIET] [ALGORITHM={? | <name>}]
Template: FILES=NAMES/M, ALL/S, TO/K, DEVICES/S, SORT/S, BUF=BUFFERSIZE/K/N, CHECK=FROM/K, STATUS/S, WARN/S, QUIET/S, ALGORITHM/K
Path: C:MD5SUM
MD5SUM Calculates and compare checksums of files.

MD5SUM will read the contents of files or devices and calculate a checksum for each individual item. If you specify a <dir>, <pattern>, <filename> or <device> argument, MD5SUM will calculate checksums for the specified directory, all directories or files that match the pattern, or the specified file or device, respectively. MD5SUM can also determine whether a file or a checksum are consistent.

MD5SUM has options which will change the way the output is displayed and how input is processed. These options are explained below:

ALL calculates checksums for all files in directories and subdirectories.
DEVICES Indicates that rather than checking the contents of a device file by file, the checksums should be calculated over the raw storage blocks instead. Note that only file system devices can be used which store data in disk blocks. This includes "df0:", "df1:", etc, but not "ram:" or "prt:".
TO <name> specifies an output file or device for MD5SUM; by default, MD5SUM outputs to the current window.
SORT sorts the list before printing.
BUFFERSIZE <size> size of the read buffer being used; default is 4096 bytes. Larger values can increase performance.
CHECK <name>
FROM <name>
reads the contents of a list previously generated by MD5SUM and tries to open each file listed in it, calculate its checksum and compare it with the value given in the list. If no matching file can be opened or the checksums do not match, an error message will be printed. Use the STATUS option to omit all output.
STATUS when this option is in effect, no output will be generated if a mismatch is found while a list is being checked. Instead, MD5SUM will immediately abort with the WARN condition set; this can be tested in script files.
WARN prints a warning message for each line in the list to be checked which does not match the format MD5SUM expects.
QUIET does not print progress reports while individual files or devices are being read. The local shell variable _Verbosity with a negative value has the same effect. Progress reports are printed in about each second. No progress reports are printed if the SORT option is in effect.
ALGORITHM ?
ALGORITHM <name>
the default checksumming algorithm is "MD5", but there may be more and more modern algorithms are supported, too. At the time of writing the following algorithms are implemented:
? lists all the supported algorithms by name.
MD5 Message Digest #5, as defined in RFC 1321. NOTE: At the time of writing (2006-02-09) the MD5 algorithm can no longer be considered secure.
SHA-1 Secure Hash Algorithm #1, as defined in U.S. Federal Information Processing Standard (FIPS) 180-1. This algorithm produces 160 bits of checksum data. NOTE: At the time of writing (2006-02-09) the SHA-1 algorithm can no longer be considered secure.
SHA-256 Secure Hash Algorithm, as defined in U.S. Federal Information Processing Standard (FIPS) 180-2. This algorithm produces 256 bits of checksum data.
SHA-384 Secure Hash Algorithm, as defined in U.S. Federal Information Processing Standard (FIPS) 180-2. This algorithm produces 384 bits of checksum data.
SHA-512 Secure Hash Algorithm, as defined in U.S. Federal Information Processing Standard (FIPS) 180-2. This algorithm produces 512 bits of checksum data.
Whirlpool As defined in ISO/IEC 10118-3. This algorithm produces 512 bits of checksum data.
You can choose an algorithm by the name given. Note that the output produced by this MD5SUM program may not be compatible with other "md5sum" shell commands from the Unix world if you choose any checksumming algorithm other than "MD5" here.

Good reasons why you might want to use a different checksumming algorithm are in the security of the original "MD5" algorithm. At the time of writing (2006-02-09) it is believed that both the "MD5" and "SHA-1" algorithms can no longer be considered secure and it is recommended that you use a more secure algorithm such as "SHA-256" or "Whirlpool" instead.

The format of the data produced and used by the MD5SUM command is compatible with the Unix "md5sum" program. Support for the "MD5" algorithm is preserved in this command only because "MD5" file checksums are still very common on the Internet.

Example 1:

To calculate checksums for all files in the C: directory and sort the list by file name before printing it:

3.OS4:> MD5SUM C: SORT
1bd137145fbb3c409771b6bd889adb07 c:AddBuffers
7ab3d10a31518a011a63e5a099beb876 c:AddDataTypes
0ca24f1b23fb52642b895010edf79b89 c:Assign
98abb6f23ca1097898cdf98a84c6d69f c:Avail
891ec3cb98bd0744cbb5f7407e678c71 c:BindDrivers
.
.
Example 2:

To calculate the checksums for all files on the Work: partition, sort the list and store it in a file:

3.OS4:> MD5SUM Work: SORT TO Work.Checksums Example 3:

To calculate and compare the checksums for all files listed in the file 'Work.Checksums' and print the differences:

3.OS4:> MD5SUM CHECK Work.Checksums Example 4:

To calculate the checksums for the disks in the drives DF0 and DF1:

3.OS4:> MD5SUM DEVICES df0: df1:
b0af4fc275bf1cb26016bd6abccc2548 df0:
fc2b0af47b01ab5bf1cc6b48d6cc2526 df1:
Example 5:

To list all the supported checksumming algorithms:

3.OS4:> MD5SUM Algorithm ?
MD5SUM: Supported algorithms are MD5, SHA-1, SHA-256, SHA-384, SHA-512, Whirlpool.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.