TruthByte is a powerful command-line tool for verifying file integrity by comparing computed hashes against expected values. It supports multiple hash algorithms and can process both individual files and entire directories, making it ideal for verifying downloads, backups, or any scenario requiring file integrity validation.
- Multiple Hash Algorithms: Support for SHA256, SHA512, SHA1, and MD5
- Single File Verification: Compare a file's hash against an expected value
- Directory Verification:
- Process entire directories of files against a hash file
- Recursive mode for checking subdirectories
- Flexible Hash File Format: Supports standard formats from common hash tools
- Path Flexibility: Works with both absolute and relative paths
- Output Options: Save verification results to text files
- Friendly Interface: Color-coded output for clear status indication
- Convenient Access: Available as both
truthbyte
andtb
(alias)
- Linux-based system
- Bash 4.0 or higher
- Standard Unix utilities (find, awk, etc.)
-
Clone the repository:
git clone https://github.com/username/truthbyte.git cd truthbyte
-
Run the installation script with root privileges:
chmod +x install.sh sudo ./install.sh
This will:
- Install the
truthbyte
command to bin - Create a
tb
alias for easier access - Install the manual page
- Set appropriate permissions
- Install the
If you prefer to install from a pre-built package:
-
Download the latest .deb package from the Releases page
-
Install using dpkg:
sudo dpkg -i truthbyte_2.0-1.deb
-
Verify installation:
truthbyte --version
Verify a single file by providing its hash:
truthbyte -a sha256 /path/to/file.iso 61d034473102d1bee8c67fe7f917da99400f342c167d1b470e385e4c10339b27
Verify all files in a directory against a hash file:
truthbyte -a md5 -v hashes.md5 ~/Downloads/
Verify files in a directory and all its subdirectories:
truthbyte -a sha256 -r --verify-from signatures.sha256 ~/Projects/
Save verification results to a text file:
truthbyte -a sha256 -r -v hashes.sha256 ~/Documents/ -o verification_results.txt
Option | Long Form | Description |
---|---|---|
-a <algorithm> |
Hash algorithm (sha256, sha512, sha1, md5) | |
-r |
--recursive |
Recursively process directories |
-v <file> |
--verify-from <file> |
Read expected hashes from file |
-o <file> |
--output <file> |
Save results to a .txt file |
-h |
--help |
Show help message |
--version |
Display version information |
TruthByte supports standard hash file formats:
<hash> <filename>
Example (SHA256):
61d034473102d1bee8c67fe7f917da99400f342c167d1b470e385e4c10339b27 file.iso
8d8d1d4aad5f7448f037f386387a75b077f8abcb09abdff5d70f405d91cb429f document.pdf
Code | Meaning |
---|---|
0 | Success - All hashes matched |
1 | Error - Hash mismatch or other error |
2 | Warning - No files were checked |
View the full manual with:
man truthbyte
truthbyte -a sha256 ubuntu-22.04.3-desktop-amd64.iso 45f67b18afe97c47eec1af0b8051a8f1045c30107cd64e40a9ed2fcf3450b736
truthbyte -a sha256 -v checksums.txt -r ~/Downloads/
truthbyte -a md5 -v package-hashes.md5 ~/software/ -o verification_log.txt
Contributions are welcome! Feel free to submit issues or pull requests to improve TruthByte.
This project is open source and available under [LICENSE].
TruthByte uses standard Unix utilities like sha256sum
, md5sum
, etc. for hash calculation.