Dear gdeon
Thank you very much for your answer.
I found many articles that are describing AES attack based on machine learning. So, I really found your tutorial is very interesting. But, I still have some questions.
1/ I don’t understand how you are building the training dataset? and how you are making the classifier?
I don’t understand those lines in the code:
output[i, tempHW[i]] = 1
# I don’t understand this line
What are meaning by this line
[inputRange]*len(POIs)
?
[code] # 3: Build training dataset
output = np.zeros([len(tempTraces), 9]) # One-hot signals
for i in range(numTraces):
output[i, tempHW[i]] = 1
4: Try to make classifier
inputRange = [-1, 1]
POIs = [1397, 1345, 1364, 1353, 2113]
net = Net([inputRange]*len(POIs), 20, 9)[/code]
2/ How do you understand that Hamming weight of the byte is 4 and how do you know that the most likely HW for this same byte is 3?
Hamming weight of the byte (here, HW = 4), and
Neural network output probabilities for each Hamming weight (so the network thinks HW = 3 is most likely)
Do take this interval [ 0. 0. 0. 0. 1. 0. 0. 0. 0.] , so that the indice of 1 is 4 ?? so based on this, you mean that you talking about the HW 4 ? then when you said that the most likely HW is it because that the HW have the best percentage in the output interval which looks like this:
[[ 0.00185322]
[ 0.04963187]
[ 0.13283786]
[ 0.23381804]
[ 0.22884202]
[ 0.18269986]
[ 0.13702157]
[ 0.03021828]
[ 0.00238221]]
3/ My third question, I have 499998 traces , Must I put all traces as an epoachs likw this:
net.train_many(tempTraces[0:numTraining, POIs], output[0:numTraining], 0.01, 499998, 0.001*numTraining, True)
Or I must split them in groups?
I would be very grateful if you could help me please.