Last active
January 7, 2024 16:25
-
-
Save rvrsh3ll/c3ad6e200071be0e413a916db4f76c99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Calculate-BitcoinKeySpaceBrute() { | |
<# | |
.SYNOPSIS | |
Calculate the number of days to brute force a keyspace with BitCrack given an amount of keys per second "mkeys". | |
May be used to calculate time to crack bitcoin puzzle 32 https://privatekeys.pw/puzzles/bitcoin-puzzle-tx | |
Bitcrack: https://github.com/brichard19/BitCrack | |
Author: Steve Borosh (@rvrsh3ll) | |
License: BSD 3-Clause | |
Required Dependencies: None | |
Optional Dependencies: None | |
.DESCRIPTION | |
Calculate the number of days to brute force a keyspace with BitCrack given an amount of keys per second "mkeys". | |
.PARAMETER startingexponent | |
Starting keyspace | |
.PARAMETER endingexponent | |
Ending keyspace | |
.PARAMETER mkeys | |
Millions of keys per second | |
.PARAMETER shares | |
Number of shares keyspace is split into | |
.EXAMPLE | |
Calculate-KeySpaceBrute -startingexponent 17 -endingexponent 18 -mkeys 185 -shares 200 | |
#> | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory = $false)] | |
[int] | |
$startingexponent, | |
[Parameter(Mandatory = $false)] | |
[int] | |
$endingexponent, | |
[Parameter(Mandatory = $false)] | |
[int] | |
$mkeys, | |
[Parameter(Mandatory = $false)] | |
[int] | |
$shares | |
) | |
$mkeys = ($mkeys * 1000000) | |
$startingKeyspace = [Math]::Pow(2,$startingexponent) | |
Write-Host "Start Keyspace " $startingKeyspace | |
$endingKeyspace = [Math]::Pow(2,$endingexponent) | |
Write-Host "Ending Keyspace " $endingkeyspace | |
$total = ($endingKeyspace - $startingKeyspace) | |
Write-Host "Total Keyspace" $total | |
if ($shares) { | |
$totalSplit = ($total/$shares) | |
} | |
else { | |
$totalSplit = $total | |
} | |
$seconds = $totalSplit/$mkeys | |
Write-Host "Seconds to complete specified share " $seconds | |
$minutes = ($seconds/60) | |
Write-Host "Minutes to complete specified share " $minutes | |
$hours = ($minutes/60) | |
Write-Host "Hours to complete specified share " $hours | |
$days = ($hours/24) | |
Write-Host "Days to complete specified share " $days | |
} |
Thanks for response!
I'm on Ubuntu. Extract the file and chmod the file 'Calculate-BitcoinKeySpaceBrute'.
Try as you do but got the same error.
Your first command Import-Module... is return: command not found.
Normally that's because you are using windows.
Any ideas?
This is a PowerShell script. Either use it on Windows or install PowerShell for Linux. On your own now!
Got it! Thanks for help and share!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested but got errors:
./Calculate-BitcoinKeySpaceBrute -startingexponent 40000000000000000 -endingexponent 7ffffffffffffffff -mkeys 60 -shares 1
Errors:
./Calculate-BitcoinKeySpaceBrute: line 1: syntax error near unexpected token `('
./Calculate-BitcoinKeySpaceBrute: line 1: `Function Calculate-BitcoinKeySpaceBrute() {'