-.\" $OpenBSD: cksum.1,v 1.41 2023/08/18 14:10:33 kn Exp $
+.\" $OpenBSD: cksum.1,v 1.42 2023/10/31 20:42:14 millert Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" @(#)cksum.1 8.2 (Berkeley) 4/28/95
.\"
-.Dd $Mdocdate: August 18 2023 $
+.Dd $Mdocdate: October 31 2023 $
.Dt CKSUM 1
.Os
.Sh NAME
If no file name is specified, the standard input is used and no file name
is written.
.It all others
-The output line consists of four whitespace separated fields:
+Unless the
+.Fl r
+option is specified (see below),
+output lines consist of four whitespace separated fields:
the name of the algorithm used, the name of the file or string in
parentheses, an equals sign, and the cryptographic hash of the input.
If no file name is specified, the standard input is used and only
If this option is specified, the
.Ar file
options become checklists.
-Each checklist should contain hash results in the normal format,
-which will be verified against the specified paths.
+Each checklist should contain hash results, which will be verified
+against the specified paths.
+Both normal (BSD) and reverse (GNU) forms are supported in either
+hexadecimal or base64 format.
Output consists of the digest used, the file name,
and an OK, FAILED, or MISSING for the result of the comparison.
-This will validate any of the supported checksums.
+Entries in normal format can be validated using any of the supported checksums.
+Entries in reverse format are validated using the specified algorithm
+(or the default algorithm if none is specified).
If no file is given, stdin is used.
The
.Fl c
.Fl c
flag, only print the failed cases.
.It Fl r
-Reverse the format of the hash algorithm output, making
-it match the checksum output format.
+Reverse the format of the hash algorithm output, similar to
+the checksum output format (but without the number of octets).
+This is also the format used by the GNU
+.Nm cksum
+utility.
.It Fl s Ar string
Print a checksum of the given
.Ar string .
-.\" $OpenBSD: md5.1,v 1.49 2023/08/18 14:10:33 kn Exp $
+.\" $OpenBSD: md5.1,v 1.50 2023/10/31 20:42:14 millert Exp $
.\"
.\" Copyright (c) 2003, 2004, 2006 Todd C. Miller <millert@openbsd.org>
.\"
.\" Agency (DARPA) and Air Force Research Laboratory, Air Force
.\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
.\"
-.Dd $Mdocdate: August 18 2023 $
+.Dd $Mdocdate: October 31 2023 $
.Dt MD5 1
.Os
.Sh NAME
If this option is specified, the
.Ar file
options become checklists.
-Each checklist should contain hash results in the normal format,
-which will be verified against the specified paths.
+Each checklist should contain hash results, which will be verified
+against the specified paths.
+Both normal (BSD) and reverse (GNU) forms are supported in either
+hexadecimal or base64 format.
Output consists of the digest used, the file name,
and an OK, FAILED, or MISSING for the result of the comparison.
-This will validate any of the supported checksums (see
+Entries in normal format can be validated using any of the supported checksums
+(see
.Xr cksum 1 ) .
+Entries in reverse format are validated using the default algorithm.
If no file is given, stdin is used.
.It Fl h Ar hashfile
Place the checksum into
.Fl c
flag, only print the failed cases.
.It Fl r
-Reverse the format of the hash algorithm output, making
-it match the output format used by
-.Xr cksum 1 .
+Reverse the format of the hash algorithm output, similar to
+the output format used by
+.Xr cksum 1
+(but without the number of octets).
+This is also the format used by the GNU
+.Xr cksum 1
+utility.
.It Fl s Ar string
Print a checksum of the given
.Ar string .