scared is a side-channel analysis framework.
Project description
SCAred
scared is a side-channel analysis framework.
Getting started
Prerequisites
You will need Python 3.6+ to use and install scared. You can use pip (or any pip based tool like pipenv) or conda to install it.
Installation
To install scared, you can use pip (or pipenv, or any other pip based-tool) or conda:
$ pip install scared
# or with Conda
$ conda install -c eshard scared
Make a first cool thing
Start using scared by doing a cool thing:
# First import the lib
import scared
# Define a selection function
@scared.attack_selection_function
def first_sub_bytes(plaintext, guesses):
res = np.empty((plaintext.shape[0], len(guesses), plaintext.shape[1]), dtype='uint8')
for guess in guesses:
key = np.array([guess for i in range(16)], dtype='uint8')
res[:, guess, :] = aes.encrypt(plaintext=plaintext, key=key, at_round=1, after_step=aes.Steps.SUB_BYTES)
return res
# Create an analysis CPA
a = scared.CPAAnalysis(
selection_function=first_sub_bytes,
model=scared.HammingWeight(),
discriminant=scared.maxabs)
# Load some traces, for example a dpa v2 subset
ths = scared.traces.read_ths_from_ets('dpa_v2.ets')
# Create a container for your ths
container = scared.Container(ths)
# Run!
a.run(container)
Documentation
To go further and learn all about scared, please go to the full documentation.
Contributing
All contributions, starting with feedbacks, are welcomed. Please read CONTRIBUTING.md if you wish to contribute to the project.
License
This library is licensed under LGPL V3 license. See the LICENSE file for details.
It is mainly intended for non-commercial use, by academics, students or professional willing to learn the basics of side-channel analysis.
If you wish to use this library in a commercial or industrial context, eshard provides commercial licenses under fees. Contact us!
Authors
See AUTHORS for the list of contributors to the project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.