Skip to content

mroth/gitmetal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

git π–’π–Šπ–™π–†π–‘ πŸ‘Ή

Wickedly fast brute forcing of vanity git commit SHAs on Apple Silicon using Metal shaders.

Demo

Install

Download the latest binary from GitHub Releases. Requires macOS 26 or newer on Apple Silicon.

Rough speed comparisons

Apple M4 Pro
bradfitz/gitbrute              3.9 MH/s  ▏
mroth/gitbrute                62.1 MH/s  β–‰
gitmetal (committer)           1.7 GH/s  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ
gitmetal (whitespace)          3.2 GH/s  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

On a MacBook M4 Pro, 8 character prefixes can typically be found in under one second.

How it works

Vanity commit tools work by tweaking some part of the commit object and re-hashing until the SHA-1 prefix matches the target. They differ in what they mutate and where the variant lands in the SHA-1 input, which affects both hashing speed and ecosystem compatibility.

gitmetal supports two mutation strategies, selected via --strategy:

  • committer (default): Inserts a 16-character hex suffix into the committer name field (e.g. Jane Doe A1B2C3D4E5F6G7H8). Hidden in normal git log output since it shows the author, not the committer. The variant lands in the middle of the commit object, so the GPU hashes ~2 SHA-1 blocks per candidate.

  • whitespace: Appends space/tab encoded padding to the end of the commit message, aligned so the GPU only hashes a single SHA-1 block per candidate β€” roughly 2x faster. The padding is invisible in git log but can be stripped by editors, hooks, or --cleanup.

lucky-commit uses a similar whitespace approach with OpenCL GPU acceleration.

bradfitz/gitbrute and my faster fork vary the author and committer timestamps by whole seconds in an expanding search. The changes are subtle β€” a short prefix is usually found within a few seconds of the true time β€” but the timestamps are visibly altered in the commit metadata.

Some tools (e.g. gitc0ffee) add custom headers to the commit object. Git ignores unknown headers, but its own maintainers discourage them β€” tools like git commit --amend and git-gui silently strip them, and third-party parsers may not handle unknown fields.

Method Compatibility Speed Used by
Timestamp Excellent β€” core metadata Slowest (full object) gitbrute
Committer name Good β€” freeform field, hidden by default Medium (~2 blocks) gitmetal
Message whitespace Fragile β€” easily stripped by tooling Fastest (~1 block) gitmetal, lucky-commit
Custom header Poor β€” discouraged, silently dropped Varies gitc0ffee

Warning

This project was largely generated with AI assistance. I'm not a Swift or GPU programming expert so I am unable to verify the code as thoroughly as my other projects. Feedback is welcome.

About

πŸ‘Ή Wickedly fast brute forcing of vanity git commits via Apple Metal

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors