Giter VIP home page Giter VIP logo

djtfoo / cpa_implementation Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 2.16 MB

Implementation of Correlation Power Analysis (CPA) in Python to retrieve the key of an AES-128 algorithm from collected power traces, and generate plots of "correlation of all possible key bytes" and "correlation of the correct key byte vs number of traces".

Jupyter Notebook 100.00%
cpa-algorithm jupyter-notebook

cpa_implementation's Introduction

CPA_Implementation

Implementation of Correlation Power Analysis (CPA) in Python to retrieve the key of an AES-128 algorithm from collected power traces, and generate plots of "correlation of all possible key bytes" and "correlation of the correct key byte vs number of traces".

Implementation

  • Written in Python 3
  • Environment: Jupyter Notebook (to conveniently sectionise codes and save graph plots)

The CPA algorithm implementation codes are under the "Correlation Power Analysis (CPA)" section, "CPA Algorithm" subheader, and the plots are under the "Experimental Results Plots" section.

Various helper functions are implemented to assist in computation and accessing data from the waveform CSV. These functions are described in the report.

How to Run

  1. Ensure the following libraries are installed for the selected Python environment: pandas, numpy, tqdm, matplotlib
  2. Install Jupyter Notebook
  3. Open CPA_Codes.ipynb in Jupyter Notebook
  4. Run through the sections of codes to open the waveform dataset, execute the definitions of helper functions, and run the algorithm

Issues with tqdm

The tqdm library is used to print the progress bar of the codes in the CPA algorithm implementation. It might have compatibility issues with some configurations in Python and Jupyter Notebook. If the codes fail to run, the following statements can be commented/uncommented to use a regular for loop:

  • comment out the line, "from tqdm import tqdm"
  • comment out the line, "for n in tqdm(range(plaintext_len), desc="Plaintext char"):"
  • uncomment the line, "for n in range(plaintext_len):"

cpa_implementation's People

Contributors

djtfoo avatar kaiqianng avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.