As of August 2020 the site you are on (wiki.newae.com) is deprecated, and content is now at rtfm.newae.com.

Changes

Jump to: navigation, search

Tutorial B6 Breaking AES (Manual CPA Attack)

4 bytes added, 12:30, 19 May 2016
Performing the Check: Minor fixes
Next, let's again consider the three sums to be implemented:
<math>sumnum = {\sum\nolimits_{d = 1}^D {\left[ {\left( {{h_{d,i}} - \overline {{h_i}} } \right)\left( {{t_{d,j}} - \overline {{t_j}} } \right)} \right]} }</math> <math>sumdem1 = \sum\nolimits_{d = 1}^D {{{\left( {{h_{d,i}} - \overline {{h_i}} } \right)}^2}}</math> <math>sumdem2 = \sum\nolimits_{d = 1}^D {{{\left( {{t_{d,j}} - \overline {{t_j}} } \right)}^2}}</math>
Note there is some common terms in all three of these, along with a common summation index. We can thus implement them as follows:
<pre>cpaoutput[kguess] = sumnum / np.sqrt( sumden1 * sumden2 )</pre>
Tieing Tying it all together, we end up with the following:
<pre>import numpy as np
Best Key Guess:
2b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </pre>
 
== Calculating The PGE ==
Approved_users
510
edits

Navigation menu