How long brute force AES-128 at 24 bits of key I have 1 block of encrypted data with AES-128, but I know 104 bits of 128 bits the key.
How long it will take to brute force 24 bits of a key at Intel I 7 CPU? How can I calculate that?
I have an Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz. Intel I7 has around 10 generations to speak of. The result cannot be accurate without providing the actual referenced Intel I7.
Here is the method;
Run openssl speed -evp aes-128-cbc command. That will give you the metric.
My CPUs output:
aes-128-cbc for 3s on 16 size blocks: 144516288 aes-128-cbc's in 3.00s,
that is $144516288 = 2^{27.1066568628459}$. Therefore 1 seconds is more than enough.
\begin{array}{|c|r|r|} \hline
2^i &amp; \text{seconds} &amp; \text{years} \\ \hline
2^{30} &amp; 22.29 &amp; 0.0000007\\ \hline
2^{40} &amp; 22824.65 &amp; 0.0007\\ \hline
2^{50} &amp; 23372450.03 &amp; 0.74\\ \hline
2^{60} &amp; 23933388835.87 &amp; 758.92\\ \hline
\vdots &amp; \vdots &amp; \vdots \\ \hline
2^{128} &amp; 7.06388957874987e30 &amp; 2.23994469138441e23\\ \hline
\end{array}
The below code ( tested in SageMath )
SecondsInADay = 86400
SecondsInAYear = 31536000
TotalCBCin3Sec = 144516288 #your CPU time from openssl speed -evp aes-128-cbc
power = (30,40,50,60,128)

for i in power:
    print('seconds for 2^{%d} =' % (i),end=&quot;&quot;)
    print(((2^i *3.0)/TotalCBCin3Sec).str(no_sci=2))
for i in power:
    print('years for 2^{%d}   =' % (i),end=&quot;&quot;)
    print(((2^i *3.0)/TotalCBCin3Sec/SecondsInAYear).str(no_sci=2))