LinuxCommandLibrary

b3sum

Calculate and verify BLAKE3 checksums

TLDR

Calculate the BLAKE3 checksum for one or more files

$ b3sum [path/to/file1 path/to/file2 ...]
copy

Calculate and save the list of BLAKE3 checksums to a file
$ b3sum [path/to/file1 path/to/file2 ...] > [path/to/file.b3]
copy

Calculate a BLAKE3 checksum from stdin
$ [command] | b3sum
copy

Read a file of BLAKE3 checksums and filenames and verify all files have matching checksums
$ b3sum [[-c|--check]] [path/to/file.b3]
copy

Only show a message for missing files or when verification fails
$ b3sum [[-c|--check]] --quiet [path/to/file.b3]
copy

Check a known BLAKE3 checksum of a file
$ echo [known_blake3_checksum_of_the_file] [path/to/file] | b3sum [[-c|--check]]
copy

SYNOPSIS

b3sum [OPTION]... [FILE]...

PARAMETERS

--check, -c
    Read BLAKE3 sums from the FILEs and check them against computed sums.

--ignore-missing
    When checking, don't report or exit with non-zero status for missing files.

--quiet
    When checking, don't print OK for each successfully verified file.

--status
    When checking, don't output anything, exit status shows success.

--strict
    When checking, exit non-zero for any improperly formatted checksum line.

--tag
    Create a BSD style checksum (e.g.,
BLAKE3 (file) = hash).

--text
    Treat input as text (handling line endings for cross-platform compatibility).

--binary
    Treat input as binary (often the default for exact byte-for-byte hashing).

-w, --warn
    When checking, warn about improperly formatted checksum lines.

--zero
    End each output line with NUL, not newline (for use with
xargs -0).

--help
    Display a help message and exit.

--version
    Display version information and exit.

DESCRIPTION

b3sum is a command-line utility used to compute and verify BLAKE3 (BLAKE3-256) cryptographic checksums or hashes of files. Like other "sum" utilities (e.g., md5sum, sha256sum), its primary purpose is to ensure data integrity. BLAKE3 is a modern, fast, and cryptographically secure hash function designed for high performance, especially on multi-core processors, making it suitable for hashing very large files or directories efficiently.

When invoked, b3sum reads input from the specified FILEs or from standard input if no files are given. For each input, it computes a unique BLAKE3 hash and prints it to standard output, typically followed by the filename. The generated hash can then be stored and later used to verify if the file has been altered or corrupted. The command also provides an option to check sums against a list of hashes provided in a file, confirming the integrity of multiple files at once.

CAVEATS

While BLAKE3 is highly optimized and secure, it is a relatively new hash function (developed in 2019). Therefore, its adoption and native support in all tools and systems might not be as widespread as older algorithms like SHA-256 or MD5. Users should ensure that the recipient or target system also has b3sum or BLAKE3 support if sharing checksums for verification.

COMMON USAGE

To compute the hash of a single file:
b3sum myfile.txt

To compute hashes of multiple files:
b3sum file1.txt file2.zip

To read from standard input:
echo "hello" | b3sum

To save a checksum to a file:
b3sum largefile.iso > largefile.iso.b3sum

VERIFYING CHECKSUMS

To verify a checksum file:
b3sum -c largefile.iso.b3sum

If all files match, b3sum will report "OK" for each. If a file does not match, it will report "FAILED". The exit status will be non-zero if any check fails.

HISTORY

BLAKE3 is a cryptographic hash function developed by a team of cryptographers and software engineers (Jack O'Connor, Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn, and others) in 2019. It was designed to be significantly faster than previous hash functions like SHA-2 and SHA-3, while maintaining strong security properties and supporting parallelism. The b3sum utility is an implementation of this algorithm, often provided as part of GNU Core Utilities or as a standalone package, allowing Linux users to leverage BLAKE3 for data integrity checks. Its development reflects the ongoing need for faster and more efficient cryptographic primitives in modern computing environments, especially with increasing data sizes and multi-core processor architectures.

SEE ALSO

md5sum(1), sha1sum(1), sha256sum(1), sha512sum(1), cksum(1)

Copied to clipboard