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

Pre-requisites

To use scared, you will need the the following Python 3.6 or 3.7.

If your configuration has a binary build available (see list here), you can just run:

pip install scared
conda install -c eshard scared

If your system isn't yet supported (build contributions are welcome!), or you want to build from source or develop, you'll also need:

  • setuptools 0.40 or greater (just run pip install -U pip setuptools)
  • a C compiler to compile C extension

To install from source, you just need to run:

pip install .

from the source folder.

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. You can also have an interactive introduction to scared by launching these notebooks with Binder.

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.

Binary builds available

Binary builds (wheels on pypi and conda builds) are available for the following platforms and Python version.

Platforms:

  • Linux x86 64
  • Macosx x86 64

Python version:

  • 3.6
  • 3.7

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.8.6.tar.gz (117.7 kB view hashes)

Uploaded Source

Built Distributions

scared-0.8.6-cp37-cp37m-manylinux2010_x86_64.whl (245.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

scared-0.8.6-cp37-cp37m-manylinux1_x86_64.whl (245.0 kB view hashes)

Uploaded CPython 3.7m

scared-0.8.6-cp37-cp37m-macosx_10_9_x86_64.whl (175.6 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

scared-0.8.6-cp36-cp36m-manylinux2010_x86_64.whl (243.8 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

scared-0.8.6-cp36-cp36m-manylinux1_x86_64.whl (243.8 kB view hashes)

Uploaded CPython 3.6m

scared-0.8.6-cp36-cp36m-macosx_10_6_intel.whl (195.7 kB view hashes)

Uploaded CPython 3.6m macOS 10.6+ intel

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