~/ learn/ comp-400/ cards/ Cryptanalytic attack models and brute-force effort
1 of 8

Tabulate the AVERAGE brute-force time, in years, for 40-, 56-, 128- and 168-bit keys at 10^9 and 10^13 trials per second. Recompute every exponent — do not copy one.

Tabulate the AVERAGE brute-force time, in years, for 40-, 56-, 128- and 168-bit keys at 10^9 and 10^13 trials per second. Recompute every exponent — do not copy one.

Answer

def average_years(key_bits, rate): trials = 2 ** (key_bits - 1) return trials / rate / (365.25 * 24 * 3600) print('bits 1e9 keys/s 1e13 keys/s') for bits in (40, 56, 128, 168): slow = average_years(bits, 10 ** 9) fast = average_years(bits, 10 ** 13) print(f'{bits:>4} {slow:>12.3e} {fast:>12.3e}')

SB5e ch2 §2.1; ch20 §20.1

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/e85961d2-5801-45ea-987c-ce3e7820d857/flashcard utf-8 LF