Skip to main content

scared is a side-channel analysis framework.

Project description

SCAred

pipeline status PyPI version Conda installer Latest Conda release

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_add_key(plaintext, guesses):
    res = np.empty((plaintext.shape[0], len(guesses), plaintext.shape[1]), dtype='uint8')
    for i, guess in enumerate(guesses):
        res[:, i, :] = np.bitwise_xor(plaintext, guess)
    return res

# Create an analysis CPA
a = scared.CPAAttack(
        selection_function=first_add_key,
        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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scared-0.7.3.tar.gz (53.1 kB view hashes)

Uploaded Source

Built Distribution

scared-0.7.3-py3-none-any.whl (84.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page