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?
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.
Sign up to join this communityI 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 & \text{seconds} & \text{years} \\ \hline 2^{30} & 22.29 & 0.0000007\\ \hline 2^{40} & 22824.65 & 0.0007\\ \hline 2^{50} & 23372450.03 & 0.74\\ \hline 2^{60} & 23933388835.87 & 758.92\\ \hline \vdots & \vdots & \vdots \\ \hline 2^{128} & 7.06388957874987e30 & 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="")
print(((2^i *3.0)/TotalCBCin3Sec).str(no_sci=2))
for i in power:
print('years for 2^{%d} =' % (i),end="")
print(((2^i *3.0)/TotalCBCin3Sec/SecondsInAYear).str(no_sci=2))