{"id":27919357,"url":"https://github.com/thyeem/longshot","last_synced_at":"2025-05-06T19:16:59.920Z","repository":{"id":56846307,"uuid":"299245284","full_name":"thyeem/longshot","owner":"thyeem","description":"Fast Brute-force search using parallelism ","archived":false,"fork":false,"pushed_at":"2023-09-10T21:03:14.000Z","size":544,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T10:03:23.954Z","etag":null,"topics":["brute-force-attacks","cryptography","haskell","parallelism"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/thyeem.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2020-09-28T08:43:29.000Z","updated_at":"2024-12-26T07:50:37.000Z","dependencies_parsed_at":"2022-09-09T00:52:40.636Z","dependency_job_id":null,"html_url":"https://github.com/thyeem/longshot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thyeem%2Flongshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thyeem%2Flongshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thyeem%2Flongshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thyeem%2Flongshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thyeem","download_url":"https://codeload.github.com/thyeem/longshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252495279,"owners_count":21757229,"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","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":["brute-force-attacks","cryptography","haskell","parallelism"],"created_at":"2025-05-06T19:16:59.239Z","updated_at":"2025-05-06T19:16:59.867Z","avatar_url":"https://github.com/thyeem.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/thyeem/longshot/master/longshot.png\" height=\"200\"/\u003e \u003c/p\u003e\n\n\u003e Is it really a __long shot__ to hope that the COVID-19 pandemic will end?\n\n\n\n[![Build Status](https://api.travis-ci.com/thyeem/longshot.svg?branch=master)](https://app.travis-ci.com/thyeem/longshot) [![Hackage](https://img.shields.io/hackage/v/longshot)](https://hackage.haskell.org/package/longshot)\n\n# longshot\n\n__Search for preimage__ from a given hash value using _Brute-force_ method based on _parallelism_\n\n* Support various __search lengths__, __character sets__ and __hashers__.\n* Strict mode: searches only for a given _exact length_\n* Deep mode: **Incrementally searches** when you *do not know the exact length of search*\n* Use `CPUs` as _much_ as possible. __Get the most out of them!__\n* Use, however, `memory` as _little_ as possible.\n\n\nEnjoy `longshot`. Good luck!\n\n\n\n```plain\nlongshot - Fast Brute-force search using parallelism\n\nUsage:\n  longshot run        [--deep | -n SIZE] [-c CHARS] [-a HASHER] HEX\n  longshot image      [-a HASHER] KEY\n\nCommands:\n  run                 Brute-force search with given hexstring and options\n  image               Generate image from given key string and hash algorithm\n\nArguments:\n  HEX                 Specify target hexstring to search\n  KEY                 Specify key string as a preimage\n\nOptions:\n  -h --help           Show this\n  --deep              Deep search by increasing length of search\n                      Use when you do not know the exact length of preimage\n  -n SIZE             Specify search length  [default: 8]\n  -c CHARS            Specify characters available in preimage  [default: 0123456789]\n  -a HASHER           Specify hash algorithm  [default: sha256]\n                      HASHER available below:\n                      md5           sha1          ripemd160     whirlpool\n                      sha256        sha3_256      sha3_384      sha3_512\n                      blake2s_256   blake2b_256   blake2b_384   blake2b_512\n                      blake3_256    blake3_384    blake3_512\n                      keccak_256    keccak_384    keccak_512\n                      skein_256     skein_384     skein_512\n```\n\n## How to build\n```shell\n## Install 'stack' if not any\n$ brew install stack\n\n$ git clone https://github.com/thyeem/longshot.git\n\n$ make build\n\n## Optional: test if installed properly using quickcheck\n$ make test\n\n## You can see an executable 'longshot' here\n$ cd app\n```\n\n## Quick start\n```shell\n## Refer to the following usage:\n## Note that the order of arguments and options matter.\n$ ./longshot -h\n\n## Generate test hash values\n$ ./longshot image 12345\n5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5\n\n$ ./longshot image 12345678\nef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f\n\n## Brute-force search with default options:\n## The same as: ./longshot -n 8 -c 0123456789 -a sha256 ef797c..98a64f\n$ ./longshot run ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f\nFound  12345678\n\n## Search below fails because default search length is 8.\n## In default mode, it searches by the exact length of key.\n$ ./longshot run 5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5\nNot found\n\n## If you don't know the exact key length, use deep search. (--deep)\n## In most cases, it is difficult to know the length of the preimage.\n## It will try to search by increasing length of search\n$ ./longshot run --deep 5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5\nFound  12345\n```\nThese are all about how to use `longshot`.\nSee below for more interesting detailed examples.\n\n## More examples\n```shell\n## Generate a example image using Blake2b hash algorithm\n## Blake2b-hashed sofia (my first daughter!)\n$ ./longshot image -a blake2b sofia\nbb40f637bb211532318965627f15bb165f701230fd83e0adf8cd673a6ee02830\n\n## Need different character set. Don't forget --deep\n$ ./longshot run --deep -c 'abcdefghijklmnopqrstuvwxyz' -a blake2b bb40f6..e02830\nFound  sofia\n\n## You should consider the following if there might be more characters in preimage.\n## More characters, much longer time to find!\n$ ./longshot run --deep -c 'abcdefghijklmnopqrstuvwxyz0123456789' -a blake2b bb40f6..e02830\n\n## Roughly, time spending is proportional to (Number of char available) ^ (char length).\n## Exponent 'char length' is surely more dominant! Use long-long password as always!\n\n## Longshot is very efficient and get the most of CPU's power in parallel.\n## But this kind of work would need a lot of time even for longshot\n## due to exponentially increased search space.\n$ ./longshot run -deep -c 'abcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^\u0026*()-=_+[]{}\\|' \\\n                 -a blake2b bb40f6..e02830 +RTS -s\n\n## '+RTS -s' the end of line is optional, and that is for a summary of CPU time and memory.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthyeem%2Flongshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthyeem%2Flongshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthyeem%2Flongshot/lists"}