Leakage Models
This module contains pre-defined leakage models that can be used during side-channel analysis experiments. For example, these leakage models are useful when generating the predicted leakage for Pearson’s correlation coefficient.
- leakage_model_hamming_weight(num_traces, plaintexts, subkey_guess, target_byte)
Generates hypothetical leakage based on the hamming weight of the AES sbox.
- Parameters:
num_traces (int) – The number of traces collected when measuring the observed leakage
plaintexts (list | np.ndarray) – The array of plaintexts used to collect the observed leakage
subkey_guess (any) – the subkey guess
target_byte (int) – the target byte of the key
- Returns:
numpy array of the hypothetical leakage
- Return type:
np.ndarray
- Authors:
Samuel Karkache (swkarkche@wpi.edu)
- leakage_model_hamming_distance(num_traces, plaintexts, subkey_guess, target_byte)
Generates hypothetical leakage using the damming distance leakage model. In this implementation the reference state is the output of the sbox at index 0.
- Parameters:
num_traces (int) – The number of traces collected when measuring the observed leakage
plaintexts (list | np.ndarray) – The array of plaintexts used to collect the observed leakage
subkey_guess (any) – the subkey guess
target_byte (int) – the target byte of the key
- Returns:
numpy array of the hypothetical leakage
- Return type:
np.ndarray
- Authors:
Samuel Karkache (swkarkache@wpi.edu)