Created
May 11, 2012 15:41
-
-
Save joequery/2660518 to your computer and use it in GitHub Desktop.
How long to brute force a key of length n?
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
# How long to brute force keys | |
ks = 1000000000 # A billion keys per second | |
clusters = 10 # How many computers in the cluster attacking our key? | |
numChars = 38 # We have 38 characters available to use in the key | |
n = 100 # Length of the key string | |
combinations = numChars ** n # This ignores variable length too | |
# How many years it would take a single computer to brute force. | |
secondsInYear = 31556926 | |
singleCrackTimeInYears = (1.0 * combinations) / ks / secondsInYear | |
totalCrackTime = singleCrackTimeInYears / clusters | |
puts "#{totalCrackTime} years" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment