Bitcoin & Cryptology
A Bitcoin private key is 128 to 256 bits long. Meaning 128 to 256 zero’s or one’s. You can pick them at random from your head, but it probably won’t be truly random. Maybe it’ll be fine, but I wouldn’t advise trying it. These are the steps involved. The mentioned bitcoin seed generated by deterministic key generator is being created from so-called mnemonic phrase containing all mnemonic words randomly chosen from the list and salt combining mnemonic phrase with passphrase, which.
Let’s explore some more about the Seed and the pairing of Private Keys, Public Keys and Bitcoin Addresses. Our Electrum Wallet was generated using some random words called the Seed. But what exactly is this Seed, and what does it do? At the heart of Bitcoin is advanced Cryptology software that is used to encrypt and decrypt Bitcoin Wallets and Bitcoin Transactions. When you first create your Wallet, the Seed is picked up by the Wallet’s advanced Cryptology software to generate a number of unique items. The random words and letter placement in the seed is used by the encryption algorithms, to create encryption patterns and Keys that are unique to your Wallet.[
First, your Wallet’s main datafile, which stores details of your Bitcoin transactions is created and encrypted. As the Blockchain Public Ledger holds details of every single Bitcoin Transaction ever made, all transactions from your Wallet will also exist in the Blockchain Public Ledger. Next, matching pairs of Private Keys and Public Keys will be created, along with some unique Bitcoin Addresses that are matched to these keys. You need a supply of Bitcoin Addresses in order to send or receive Bitcoin into your Wallet. And every Wallet can create an unlimited number of unique Addresses.
Private Keys and Public Keys
Each Bitcoin Address is directly linked to a pair of matching keys, the Private Key, and the Public Key. The “Private Key”, must remain securely on your own Wallet, as it is used to encrypt and authorize transactions leaving your Wallet. Never, for any reason show anyone what your Private Keys are, as this makes your Wallet vulnerable to cyber-crime and potential theft. If anyone found out what your Private Keys were, they could potentially steal Bitcoins from your Wallet, in much the same way that they could if they stole your Seed. The other Key is the Public Key. This matches up with your Private Key, to form a matching pair, a bit like non-identical twins.
Next we have the Bitcoin Address itself. Every Bitcoin Transaction you make from your Wallet generally uses a completely new and unique Bitcoin Address, which helps retain your anonymity and protects your wallet. The Bitcoin address is a mathematically related shortened version of your Public Key, created using a technique called hashing. So in summary, a bitcoin address is a mathematically related and shortened version of your public key, which itself is mathematically related to your much larger and more complex Private key. Your Private Key creates your Public Keys, authorizes transactions leaving your Wallet, and proves ownership of your transactions. I did mention Bitcoin was complicated, didn’t I?
When Bitcoin transactions are decrypted by the Miners, for inclusion into the Blockchain Public Ledger, the included Public Key and Bitcoin Addresses identifies the transaction as either coming from your Wallet, or being sent to your Wallet. You can view your Private Keys inside your Wallet, but you don’t need to worry about them too much for day-to-day use. The pairing of public and private keys, when transacting in Bitcoin, is handled automatically by your Wallet. If you want to learn more about the Seed, Bitcoin Addresses, and Public or Private Keys, check the Webpage for this episode and follow the links to more reading.
Always keep your Seed (Recovery Phrase) and Private Keys Secure, Secret and Confidential!
The good news first. We are going to code a script that outputs random 64 character hexadecimal strings at supersonic speeds, and then we are going to use them to try to bruteforce some Bitcoin addresses.
Bitcoin private keys may be represented by 64 character hexadecimal strings (32 bytes or 256 bits of data; we’ve been over this a couple of times by now), e.g.
e7e0e8b007f2fa5e8de4afccfefc649703d67d4568eab5839b86b3d58163d472
Google this one, if you want. For a change, is’s NOT random data. Along with the usual disclaimer: do not use this one IRL.
Without further ado, fire up your favorite text editor, paste the following Python code and save the file as “randomhex”:
As usual, make the script executable by
chmod +x randomhex
and we are ready to try it! The script needs one argument, which much be a positive decimal integer, or the script will give you an error code and quit.
Let’s benchmark the script by having it output 10 million random strings to a text file named “hashes.txt”; also prepend it with the time command, so we can determine how fast it is, like so:
time ./randomhex 10000000 > hashes.txt
That was pretty quick, agreed? On an older notebook, it took us 4.2 seconds to create “hashes.txt”; you should check that the output is right by counting lines with
wc -l hashes.txt
and it should say 10000000. We now have a private key generator monster in our possession.
All good? Unfortunately not. The odds are not in our favor. Remember that a valid private key is any number from 1 to 115 792 089 237 316 195 423 570 985 008 687 907 852 837 564 279 074 904 382 605 163 141 518 161 494 336… that’s not a small keyspace.
Furthermore, leets look up some statistics from today (courtesy bitsapp.com)
Even though more than 630 million addresses have at some point held a positive balance, today only less than 200 thousand addresses hold 1 BTC or more. In other words, finding a needle in a haystack is a walk in the park compared to what we are about to attempt here, namely searching the whole keyspace blindly.
We will combine our beautiful script with the marvelous Brainflayer tool. Specifically, instead of messing around with intermediate hash files (you could use the above script to create billions of strings and the resulting files would be 100 GB or so in size), we will pipe the output straight into Brainflayer. This is not a Brainflayer tutorial, though, so unless you aren’t already fluent in it, you have some reading up to do (elsewhere).
Now, with everything set up, we want to scan 1 billion private keys, randomly created. That has to work, right? Or maybe not, we’ll see. Anyway, here is how to do it in one line (given that you have all prerequisites for Brainflayer in place; parsing the blockchain and setting everything up right takes quite a while):
./randomhex 1000000000 | ./brainflayer -v -b sortedfiles.blf -f sortedfiles.bin -t priv -x -w 12 -o foundkeys.txt
By doing this multithreaded solution (details not here – ask us if you’re interested), we are able to achieve around 450,000 checks per second. It means that the test will take a little more than half an hour to carry out. We’ll show ourselves out to the coffee machine while our poor laptop does the job.
Phrase Generator Bitcoin Private Key Generator
*Pause music*
Alright, done! The notepad is still hot, but the fans are much less noisy than a couple of minutes ago. The results then. Well, what did you expect? Zero, zilch, nada, not a single hit – of course!
We have for the first time had a taste of how insanely large the Bitcoin private keyspace is. As a matter of fact, if all humans on Earth ran this 24/7 for billions of years (which admittedly feels a little improbable) the expected outcome would be the same.
In conclusion, Bitcoin is safe from blind bruteforce attacks, now and forever. But there are other flaws and exploits. Many of them are due to the human factor. A few have been mentioned here before. More will be.
Phrase Generator Bitcoin Private Keys
Comments and questions?
One more thing!
Phrase Generator Bitcoin Private Key
Consider the donation address at the bottom of the page. We re-invest all contributions into new projects for btcleak.com. Help us create new content and remain ad-free forever. Thank you.
Comments are closed.