Skip to content

Instantly share code, notes, and snippets.

@TheArchivistsDomain
Created August 29, 2022 10:40
Show Gist options
  • Save TheArchivistsDomain/abe34b03f93adf5cf11fb1f9b1b05231 to your computer and use it in GitHub Desktop.
Save TheArchivistsDomain/abe34b03f93adf5cf11fb1f9b1b05231 to your computer and use it in GitHub Desktop.
Tutorial on how to break into bitcoin accounts with poorly censored private keys.

image Imagine you find a screenshot of a private key for a bitcoin wallet with money in it, but some of the characters are censored. Here is how you crack it.

First, note down the public address and private key: 1KtcmtacFsN5SR2Lt5rn1gfHe9enEHaBoZ L43kTaWVaQGZNfsCrRtZv9n7JUsXimR3x7pqKn??...??1km

Remember, private keys (WIF's) usually have 52 characters in them and only occasionally 51. Use this to figure out how many characters you are missing in the private key.

L43kTaWVaQGZNfsCrRtZv9n7JUsXimR3x7pqKn???????????1km [52 characters]

Now, load up cyberchef: https://gchq.github.io/CyberChef/#recipe=From_Base58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',true)To_Hex('Space',0)

Paste in the private key with the '?'s we wrote down just eariler, but replace it with 1's and f's and copy both results to a text file. image image

80                      cbbcd179129f332049a6e42c1b3594a2d8209db3d653563a13feb0d77813e723  01                     50 7A 5B 8D
[main/testnet]		[private key - 32 Bytes (64 hex chars)]                           [compression byte]	[checksum]

Strip the first 2 and last 10 characters from the hexidecimal results we have written down so only the private key is remaining. This should total to 64 characters.

cbbcd179129f332049a6e42c1b3594a2d8209db3d653563a13feb0d77813e723 cbbcd179129f332049a6e42c1b3594a2d8209db3d653563a13feb387b5f1eadf

In these two hexidecimal strings above, what we must do it replace all letters where they do not match, with 0's and f's.

cbbcd179129f332049a6e42c1b3594a2d8209db3d653563a13feb00000000000 cbbcd179129f332049a6e42c1b3594a2d8209db3d653563a13febfffffffffff

These are the range of bitcoin private keys we must check to crack the wallet...

Install Bitcrack from github, https://github.com/brichard19/BitCrack. (Windows users just download the exe from the releases page)

In a terminal run the following: clBitCrack.exe 1KtcmtacFsN5SR2Lt5rn1gfHe9enEHaBoZ --keyspace cbbcd179129f332049a6e42c1b3594a2d8209db3d653563a13feb00000000000:cbbcd179129f332049a6e42c1b3594a2d8209db3d653563a13febfffffffffff

If all went smoothly, congrats. You now have the original private key. image

WARNING: THE OPENCL VERSION OF BITCRACK MAY HAVE SOME ISSUES WITH SKIPPING OVER SOME ADDRESSES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment