# Computing guessing entropy (average rank of the correct key) in attack using deep learning

I am looking for help with some issues that I have about the guessing entropy (GE) in side-channel attacks context. I have read some papers where GE is used as a metric to measure the attack's performance. In this paper, they define it like:

The q parameter in the expression represents the number of queries

My interpretation: One experiment is taking a random k from the K set. Then, use the gamma function to associate that k to a specific class. Then, perform the key recovery, and as a result, one gets a vector whose elements are the probability of each class. Finally, the experiment returns the position (index) of the class in the probability vector. So the GE is the mean position of the correct key.

I still have doubts about how to use it in attacks with deep learning. To be more clear: When I have finished training my DL model that has 255 neurons in the output layer (one for each byte, i.e. class, in 255 from 00 to FF). Then, I use the "attack set" to make predictions, and I will get a 255-vector of probabilities, so that is the vector g.

Issue 1: I don't understand how to prepare my attack set, it has to contain random elements with classes from 00 to FF or it has to contain elements from just one class because it is the correct class? But, if the latter is the case how can I choose a random k from K set then?

Issue 2: If I perform 10 experiments with different values of q, this means that I take q=1 elements from my attack set, but it has to be for each class, i.e. q=1 for 00, q=1 for 01... q=1 for FF. Then, repeat for q=2?

Issue 3: When q>1 this means that I have to compute the average of the probability vectors to get one single vector, and then continue the algorithm?

If it's useful, I include this image which is the result of the guessing entropy after experiments with increasing values of q.