Assignment 2


Problem Statement

Perform Correlation Power Analysis (CPA) attack on AES implementation to recover the secret key.

Description

The goal is to analyze power traces collected from an AES hardware implementation and use statistical techniques to deduce the encryption key.

Download the trace assigned to your team from this link: power_traces

IMPORTANT: Kindly read the document at this link to create a private repository for the assignment. Do not push everything at the last moment. Maintain a proper commit history.

Deadline: 13th March 2025, 17:00 Hrs


Objective

  • Understand side-channel attacks, specifically CPA.
  • Work with real-world power traces which is given to each team. Note-Each team is assigned with different power traces.
  • Remove noise from the power traces. The original power trace has 5000 length and contains 250 points with random noise.
  • Implement statistical correlation techniques to retrieve encryption key i.e. Implement a CPA attack to derive the encryption key from power traces.

Provided Code

The provided IPython Notebook file (.ipynb) template sets up the environment for conducting a CPA attack. The template contains the following sections:

  • Reads a dataset containing

    • Power traces (trace_array)
    • Plaintext (textin_array)
    • Ciphertext (textout_array)
    • Key used for encryption (key_array)
  • Defines AES substitution box (sbox) for byte substitution operation

  • Prints trace_array shape, sample plaintext, actual key, and ciphertext for reference

Expected Outcome

Upon successful implementation, the program should output a key guess that matches the actual encryption key. You should compare the derived key with the original key and analyze the correlation results.


Evaluation Criteria

  • Correct implementation of statistical functions.
  • Accuracy of the key guess.
  • Understanding and explanation of the CPA technique.
  • Correlation plots to analyze the given trace with and without the random noise.
  • A README file explaining the techniques and results the team has achieved. The README should also contain plots and their respective inferences.

Additional Notes

  • The assignment requires basic knowledge of AES encryption and Python programming.
  • Ensure that all required dependencies (numpy, h5py) are installed.
  • Submit a well-commented code explaining each step of the process.

Submission

Create a directory named <team-name>_a2 which contains the following files:

  • assignment2.ipynb
  • README.md

Compress this directory into a tar.gz file using the command:

tar -czvf <team-name>_a2.tar.gz <team-name>_a2

Upload this <team-name>_a2.tar.gz on the Moodle at the respective link.

IMPORTANT: Apart from updating your team's private GitHub repository for this assignment, you also need to upload your submission on Moodle.



Best Wishes! 😊