Created
September 4, 2022 10:03
-
-
Save avipars/b532452f033463f97f770c65805cf854 to your computer and use it in GitHub Desktop.
Time to crack AES 256 based on computer specs
This file contains hidden or 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
# time to crack aes 256 | |
#single 32 bytes encrypted block | |
def main() -> None: | |
bytes = 32 | |
cycles = 1000 | |
ghz = 3.6 | |
bits = bytes * 8 | |
ghz_to_hz = ghz * 1000000000 | |
print("combos:\t") | |
combos = pow(2,bits) | |
print(combos) | |
#convert ghz to cycles | |
cycle_per_sec = ghz_to_hz/ cycles | |
print("cycles per sec:\t") | |
print(cycle_per_sec) | |
print("trying all keys in seconds:\t") | |
sec_calc = combos / cycle_per_sec | |
print(sec_calc) | |
print("seconds in years:\t") | |
sec_in_years = 60* 60 * 24 * 365 #seconds * minutes * hours in day * days in year | |
print(sec_in_years ) | |
print("time to crack 1 key") | |
print(cycles / ghz_to_hz) | |
print("time in years to crack all keys") | |
print((combos / cycle_per_sec)/sec_in_years) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment