Learn R Programming

sideChannelAttack (version 1.0-6)

gaussian: Template Attack

Description

The gaussian function applies a template attack (TA) to a set of traces in order to find the key used by the cryptographic device.

Usage

gaussian(x, y,...)

Arguments

x
A matrix where each row is a trace.
y
A vector where the $i_th$ element of the vector $y$ is the key for the $i_th$ trace in the matrix $x$.
...
Currently ignored.

Value

The gaussian function returns an object which can be used with the predict function to estimate the value of the key knowing a trace.The value of this function is an object of class gaussian, which is a list with the following components:
mean
a list of arithmetic means, one for each possible key.
cov
a list of covariance matrices, one for each possible key.
detCov
a list of determinants of each covariance matrice.

Details

The gaussian function is an example of TA. It estimates the conditional probability of the trace for each key and then returns the key which maximizes this probability. It extracts all possible informations available in each trace and is hence the strongest form of side channel attack possible in an information theoretic sense that relies on a parametric Gaussian estimation approach.

References

S. Chari & J. R. Rao & P. Rohatgi, (2002), "Template Attacks" , in CHES, volume 2523 of LNCS, pages 13-28. Springer.

Examples

Run this code

#data collection
data(powerC)
traces = powerC[,-301]
traces = traces[,1:100]
key = powerC[,301]+1

#feature selection
filter = filter.PCA(X=traces,nbreVarX_=2)
traces = predict(filter,traces)

#model creation
attack=gaussian(traces[-1,],factor(key[-1]))

#model prediction
predict(attack,traces[1,])

Run the code above in your browser using DataLab