{"id":31750148,"url":"https://github.com/guilt/gsum","last_synced_at":"2025-10-09T15:26:47.024Z","repository":{"id":296935398,"uuid":"994552533","full_name":"guilt/gsum","owner":"guilt","description":"gsum is a versatile command-line hashing tool written in Go, supporting a wide range of cryptographic and non-cryptographic hash algorithms. It offers advanced features like incremental hashing, GPG signing/verification, progress bars, and compatibility with existing Unix and Windows environments.","archived":false,"fork":false,"pushed_at":"2025-09-08T21:37:45.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T12:41:02.471Z","etag":null,"topics":["chatgpt","checksum","cryptography","defense-methods","golang","grok","gsum","hashing","incremental","range","utility","verification"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guilt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-02T05:46:55.000Z","updated_at":"2025-09-08T21:37:48.000Z","dependencies_parsed_at":"2025-06-03T12:51:47.186Z","dependency_job_id":null,"html_url":"https://github.com/guilt/gsum","commit_stats":null,"previous_names":["guilt/gsum"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/guilt/gsum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fgsum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fgsum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fgsum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fgsum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guilt","download_url":"https://codeload.github.com/guilt/gsum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fgsum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001655,"owners_count":26083147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","checksum","cryptography","defense-methods","golang","grok","gsum","hashing","incremental","range","utility","verification"],"created_at":"2025-10-09T15:26:44.640Z","updated_at":"2025-10-09T15:26:47.019Z","avatar_url":"https://github.com/guilt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gsum\n\n`gsum` is a versatile command-line hashing tool written in Go, supporting a wide range of cryptographic and non-cryptographic hash algorithms. It offers advanced features like incremental hashing, GPG signing/verification, progress bars, and compatibility with existing Unix and Windows environments, making it ideal for developers, security enthusiasts, and system administrators.\n\n## Features\n\n- **Supported Algorithms**: 40+ Algorithms including CRC32, BSD-CKSUM, MD5, SHA1, SHA256, SHA512,\nSHA3, BLAKE2B, HMAC, ChaCha20-Poly1305, XXHash, Kangaroo12, Keccak256, Streebog, SM3, Ssdeep.\n- **Incremental Hashing**: Compute hashes for specific file ranges (e.g., 13%-40%) or in\nincremental chunks (5%).\n- **GPG Support**: Sign and verify hash files with GPG for integrity and authenticity.\n- **Progress Bars**: Visual feedback for long-running operations with customizable progress bars.\n- **Keyed Hashing**: Support for algorithms requiring keys (e.g., HMAC, SipHash, BCrypt-SHA512, ChaCha20-Poly1305).\n- **Cross-Platform**: Compatible with modern OSes.\n- **Modular Design**: Extensible architecture for adding new hash algorithms.\n- **Simple**: Consistent syntax, easy to use.\n\n## Installation\n\n**Go Installation**:\n\n```shell\ngo install github.com/guilt/gsum/cmd/gsum@latest\n```\n\n## Usage\n\nRun `gsum` with various flags to compute or verify hashes. Below are some examples:\n\n### Compute a Hash and Verify\n\nHash a file (default is SHA256):\n```shell\ngsum example.txt\n```\n\nVerify a file:\n```shell\ngsum -verify example.txt\n```\n\n### Advanced Usages\n\nHash a file and show a progress bar:\n```shell\ngsum -progress example.txt\n```\n\nHash a file using Kangaroo12:\n```shell\ngsum -algo=kangaroo12 example.txt\n```\n\nVerify a file using Kangaroo12:\n```shell\ngsum -algo=kangaroo12 -verify example.txt\n```\n\nUse SipHash with a 16-byte key:\n```shell\ngsum -algo=siphash -key=1234567890123456 example.txt\n```\n\nHash a specific range (10%-20%) of a file:\n```shell\ngsum example.txt#10%-20%\n```\n\nVerify a specific range (10%-20%) of a file:\n```shell\ngsum -verify example.txt#10%-20%\n```\n\nCompute SHA1 hashes for 10% increments of a file:\n```shell\ngsum -algo=sha1 -increment=10% -progress example.txt\n```\n\nVerify a hash against a provided value as argument:\n```shell\ngsum -verify 80a3721188e40218b08b26776bc53bdae81e4784fff71d71450a197319cba113 example.txt\n```\n\nHash multiple files to a single checksum file:\n```shell\ngsum -output=SHA256SUM example.txt example2.txt example3.txt\n```\n\nVerify checksums from a file:\n```shell\ngsum -verify=SHA256SUM example.txt\n```\n\nGenerate SHA256SUM file with increments of 10% of a file:\n```shell\ngsum -increment=10% -output=SHA256SUM example.txt example2.txt\n```\n\nVerify SHA256SUM file with the generated hashes of the increment of 10% of a file:\n```shell\ngsum -verify=SHA256SUM example.txt\n```\n\n### GPG Signing and Verification\n\nSign a hash file with GPG:\n```shell\ngsum -output=SHA256SUM -gpg=SHA256SUM.asc example.txt\n```\n\nVerify a GPG-signed hash file:\n```shell\ngsum -verify=SHA256SUM -gpg=SHA256SUM.asc example.txt\n```\n\n### Full Help\n\nList all supported algorithms and flags:\n```shell\ngsum -help\n```\n\n### Supported Algorithms\n\n- **Adler-32**: Lightweight non-cryptographic checksum for data integrity.\n- **ARGON2-SHA512**: Memory-hard password hash with SHA-512 salt, 2015 competition winner.\n- **BCRYPT-SHA512**: Adaptive password hash with SHA-512 for secure storage.\n- **BLAKE2B**: High-speed cryptographic hash for security and performance.\n- **BLAKE2S**: Compact BLAKE2 variant for embedded systems.\n- **BLAKE3**: Ultra-fast cryptographic hash for modern applications.\n- **BSD-CKSUM**: Castagnoli polynomial-based checksum for data integrity.\n- **ChaCha20-Poly1305**: Authenticated encryption with 32-byte key.\n- **CityHash**: Non-cryptographic hash optimized for strings.\n- **CRC32**: Fast, non-cryptographic checksum for error detection.\n- **HMAC-BLAKE2B**: Keyed HMAC using BLAKE2B for high-speed authentication.\n- **HMAC-MD5**: Keyed HMAC using MD5 for legacy authentication.\n- **HMAC-RIPEMD160**: Keyed HMAC using RIPEMD160 for OpenPGP authentication.\n- **HMAC-SHA1**: Keyed HMAC using SHA1 for authentication.\n- **HMAC-SHA256**: Keyed HMAC using SHA256 for secure authentication.\n- **HMAC-SHA512**: Keyed HMAC using SHA512 for high-security authentication.\n- **Kangaroo12**: High-performance Keccak-based hash.\n- **Keccak256**: Pre-SHA3 256-bit hash for Ethereum blockchain.\n- **MD4**: Legacy cryptographic hash, less secure.\n- **MD5**: Legacy cryptographic hash, widely used but vulnerable.\n- **PBKDF2-SHA512**: Key derivation with SHA-512 salt and hash for password hashing and key stretching.\n- **RIPEMD-160**: 160-bit cryptographic hash for OpenPGP and certificates.\n- **SHA1**: Legacy Secure Hash Algorithm, used in older systems.\n- **SHA224**: NIST-standard 224-bit SHA-2 hash for signatures and certificates.\n- **SHA256**: Secure 256-bit SHA-2 hash for modern cryptography.\n- **SHA3-224**: 224-bit SHA-3 hash, post-quantum secure for signatures.\n- **SHA3-256**: Keccak-based 256-bit cryptographic hash.\n- **SHA3-384**: 384-bit SHA-3 hash for high-security applications.\n- **SHA3-512**: 512-bit SHA-3 hash for maximum security.\n- **SHA384**: NIST-standard 384-bit SHA-2 hash for high-security applications.\n- **SHA512**: Secure 512-bit SHA-2 hash for cryptography.\n- **SHA512-224**: Truncated 224-bit SHA-2 hash for compact signatures.\n- **SHA512-256**: Truncated 256-bit SHA-2 hash for efficiency and security.\n- **SHAKE128**: Extendable-output function for flexible hashing.\n- **SHAKE256**: Extendable-output function for secure hashing.\n- **Scrypt-SHA512**: Memory-hard key derivation with SHA-512 salt for password hashing.\n- **SipHash**: Keyed hash for hash tables with 16-byte key.\n- **SM3**: Chinese 256-bit cryptographic hash for blockchain and standards.\n- **Ssdeep**: Fuzzy hash for similarity detection.\n- **Streebog**: Russian cryptographic hash for signatures and certificates.\n- **TTH**: Tiger-based tree hash for BitTorrent and Gnutella file verification.\n- **Whirlpool**: AES-based 512-bit cryptographic hash for secure storage.\n- **XXHash**: Non-cryptographic, high-speed hash for checksums.\n\n## Development\n\nTo contribute or extend `gsum`:\n\n1. **Add a New Algorithm**:\n   - Create a new package under `pkg/hashers/` (e.g., `pkg/hashers/newalgo`).\n   - Implement a `ComputeHash` function with the signature:\n     ```go\n     func ComputeHash(reader io.Reader, key string, rs gfile.FileAndRangeSpec) (string, error)\n     ```\n   - Register the algorithm in `pkg/hashers/hashers.go`.\n\n2. **Build for a specific OS and architecture, such as Linux amd64**:\n   ```shell\n   GOOS=linux GOARCH=amd64 go build -o gsum-linux-amd64 ./cmd/gsum\n   ```\n3. **Run Tests**: \n   ```shell\n   ./gsum-test.sh\n   ```\n\n\n## Dependencies\n\n- `golang.org/x/crypto`: Most Crypto Algorithms\n- `github.com/dchest/siphash`: SipHash\n- `github.com/mimoo/GoKangarooTwelve`: KangarooTwelve\n- `github.com/cespare/xxhash`: XXHash\n- `github.com/zentures/cityhash`: CityHash\n- `github.com/zeebo/blake3`: BLAKE3\n- `github.com/schollz/progressbar/v3`: Progress bars\n- `github.com/charmbracelet/log v0.4.2`: Color Logging\n- `github.com/cxmcc/tiger`: Tiger Tree Hash\n- `github.com/emersion/go-bcrypt`: BCrypt Hash fork of `golang.org/x/crypto` with explicit Salt\n- `github.com/emmansun/gmsm`: SM3 Hash\n- `github.com/glaslos/ssdeep`: Ssdeep Fuzzy Hash\n- `github.com/jzelinskie/whirlpool`: Whirlpool Hash\n\n## License\n\nMIT License. See [License](LICENSE.md) for details.\n\n## Feedback\n\nBuilt by [Vibe coding](https://en.wikipedia.org/wiki/Vibe_coding).\n\nPull requests, issues, and feature requests are welcome!\nVibe code it, Vibe debug it, Vibe test it, Vibe PR it, Vibe everything it.\n\n* Authors: [Grok 3.0](https://www.grok.com), [ChatGPT 4.1](https://openai.com/) and Debugger: [Karthik Kumar Viswanathan](https://karthikkumar.org)\n* Web   : http://karthikkumar.org\n* Email : me@karthikkumar.org\n\nHappy hashing!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilt%2Fgsum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguilt%2Fgsum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilt%2Fgsum/lists"}