{"id":37175062,"url":"https://github.com/anonymouse64/crypto_test_golang","last_synced_at":"2026-01-14T20:26:59.238Z","repository":{"id":57661117,"uuid":"122404712","full_name":"anonymouse64/crypto_test_golang","owner":"anonymouse64","description":"Crypto testing utility for Golang implementations","archived":false,"fork":false,"pushed_at":"2018-04-02T15:22:14.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T14:19:26.457Z","etag":null,"topics":["benchmark","cryptography","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anonymouse64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-21T23:00:33.000Z","updated_at":"2018-04-02T15:22:15.000Z","dependencies_parsed_at":"2022-09-06T23:22:30.408Z","dependency_job_id":null,"html_url":"https://github.com/anonymouse64/crypto_test_golang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anonymouse64/crypto_test_golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymouse64%2Fcrypto_test_golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymouse64%2Fcrypto_test_golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymouse64%2Fcrypto_test_golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymouse64%2Fcrypto_test_golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anonymouse64","download_url":"https://codeload.github.com/anonymouse64/crypto_test_golang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymouse64%2Fcrypto_test_golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["benchmark","cryptography","golang"],"created_at":"2026-01-14T20:26:58.441Z","updated_at":"2026-01-14T20:26:59.230Z","avatar_url":"https://github.com/anonymouse64.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Crypto Testing in Golang\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/anonymouse64/crypto_test_golang)](https://goreportcard.com/report/github.com/anonymouse64/crypto_test_golang)\n[![license](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE)\n\nThese simple tools test the efficiency of various different hashing algorithms implemented in golang.\n\nThe first tool `crypto-tester` works by running different algorithms against the same file and outputting the results.\nThe second tool `sha3sum` will only run a single algorithm once and output the time taken.\n\n### Building\n\nThe easiest way to get this is using `go get` and `go install`:\n\n```\ngo get -u github.com/anonymouse64/crypto_test_golang/...\ngo install github.com/anonymouse64/crypto_test_golang/...\n```\n\nThis will install both of the included utilities into your `$GOPATH/bin`.\n\nThe tool can also be built locally using `go build`. The dependencies must be resolved and can be done using `go get`:\n\n```\ngit clone https://github.com/anonymouse64/crypto_test_golang.git\ncd crypto_test_golang\ngo get -d -t ./...\ngo build ./cmd/sha3sum/\ngo build ./cmd/crypto-tester/\n```\n\n\n### Usage\n\n#### crypto-tester\n\n```\npi@raspberrypi:~ $ $GOPATH/bin/crypto-tester --help\nUsage of /home/pi/go/bin/crypto-tester:\n  -escape-quote\n    \twhether to escape quotes in the json output\n  -file string\n    \tfile to hash (random file is generated if this is omitted)\n  -format string\n    \tformat to output (json or yaml) (default \"json\")\n  -size int\n    \tsize of generated random file (default 10)\n  -unit string\n    \tunits to use (possible values : ns, us, ms, s) (default \"ns\")\n```\n\nThis utility is intended to benchmark multiple different crypto hashing algorithms built into golang. You can specify what file to run against with the `-file=file.txt` option. If this option is omitted, a random 10 MB file will be generated and used (it is generated from `crypto/rand`'s Read: https://golang.org/pkg/crypto/rand/#Read.\n\nThe output can be output in either JSON or YAML. There is also an option to escape quotes if necessary. The units default to nanoseconds, but can be changed with the `-unit` option.\n\nThere are currently 14 different algorithms tested on the file in 2 different ways.\nThe first way is by just running the `.Sum` method on a pre-read byte array from the file.\nThe second way is by using snapcore's `osutil.FileDigest` function. \n\nExample with a specified file:\n\n```\npi@raspberrypi:~ $ $GOPATH/bin/crypto-tester -file=file.txt- algorithm: md4\n  byteshash: 15417\n  filehash: 19789507\n- algorithm: md5\n  byteshash: 12344\n  filehash: 6573204\n- algorithm: sha1\n  byteshash: 11980\n  filehash: 15064057\n- algorithm: sha256\n  byteshash: 36198\n  filehash: 41202966\n- algorithm: sha256_224\n  byteshash: 15624\n  filehash: 20859607\n- algorithm: sha512\n  byteshash: 53437\n  filehash: 34371013\n- algorithm: sha512_224\n  byteshash: 18958\n  filehash: 36242777\n- algorithm: sha512_256\n  byteshash: 19687\n  filehash: 33092425\n- algorithm: sha384\n  byteshash: 18750\n  filehash: 32011127\n- algorithm: ripemd160\n  byteshash: 14011\n  filehash: 25559693\n- algorithm: sha3_224\n  byteshash: 41719\n  filehash: 23439701\n- algorithm: sha3_256\n  byteshash: 17083\n  filehash: 25225267\n- algorithm: sha3_384\n  byteshash: 19687\n  filehash: 31246859\n- algorithm: sha3_512\n  byteshash: 19062\n  filehash: 43810091\n\n```\n\n\n\n#### sha3sum\n\n```\npi@raspberrypi:~ $ $GOPATH/bin/sha3sum --help\nUsage of /home/pi/go/bin/sha3sum:\n  -alg string\n    \talgorithm to use, sha3_512, sha3_384, sha3_256, or sha3_224 (default \"sha3_512\")\n  -file string\n    \tfile to hash\n  -size int\n    \tsize of generated random file (default 10)\n  -unit string\n    \tunits to use (possible values : ns, us, ms, s) (default \"s\")\n```\n\nThis utility is intended to benchmark specifically sha3 (or various variants of it) against a file, either randomly generated or specified with the `-file` option. The output unit can be changed with the `unit` file, and the specific algorithm to use can be specified with the `-alg` option.\n\nUse a randomly generated file:\n\n```\npi@raspberrypi:~ $ $GOPATH/bin/sha3sum \n6b792386272d67d01424e7b1714815289b95bf749a24f1c68b21825ccee270c788fcef7f51266e791b2895e0999ac886e828cae70f4e54d0ca0c891d2c6e41c1 /tmp/sha3sum_example107825369\nCalculated in 1.550840 sec,  6.45 MBps\n```\n\nSpecify a file:\n\n```\npi@raspberrypi:~ $ $GOPATH/bin/sha3sum -file=file.txt\nbb8f2e943d20d37d0984c07038a34d71f4b6ad67db5124cb28097e89365de9aa163e5f3c18e0f4227a6d4c0ab03a97b44154d4fccf957264014fa9de4614d56a file.txt\nCalculated in 0.068106 sec,  3.96 MBps\n```\n\nSpecify the size of the randomly generated file in Megabytes:\n```\npi@raspberrypi:~ $ $GOPATH/bin/sha3sum -size=100\ne01db5396e44d47435c81d4b0647463f43ee5923ce24013b714563868abfde8434ab974857d5eb2ccab6ee9bf51e34a730f3c29bf8a9c0ef995e1ddbe49a8d21 /tmp/sha3sum_example556721470\nCalculated in 15.340368 sec,  6.52 MBps\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonymouse64%2Fcrypto_test_golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanonymouse64%2Fcrypto_test_golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonymouse64%2Fcrypto_test_golang/lists"}