scared is a side-channel analysis framework.
Project description
SCAred
scared is a side-channel analysis framework.
Getting started
Requirements
Scared need python 3.6, 3.7 or 3.8.
You can install scared
, depending on your setup:
- from source
- with
pip
- with
conda
At time of writing, we highly recommend to install
scared
withconda
if you want to use it with python 3.8
Install with conda
Conda builds are available for linux-x64
and osx-64
platforms.
If your system isn't yet supported, build contributions are welcome!).
You just have to run:
conda install -c eshard scared
Install with pip
Binary builds are available from Pypi for most Linux platforms and OS X. If your environment has a binary build available, just run:
pip install scared
If no wheel is available for your setup, you'll also need:
- setuptools 0.40 or greater (just run
pip install -U pip setuptools
) - a C compiler to compile C extension
- for Python 3.8 only, a
llvmlite
working installation (see install from source documentation)
and then run pip install scared
.
Install from source
To install from source, you will need:
- setuptools 0.40 or greater (just run
pip install -U pip setuptools
) - a C compiler to compile C extension
- for Python 3.8 only, a
llvmlite
working installation (see install from source documentation, or install it withconda
)
You need to run:
pip install .
from the source folder.
If you are planning to contribute, see CONTRIBUTING.md to install the library in development mode and run the test suite.
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
- 3.8 from
conda
, or buy building from sources.
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.
Source Distribution
Built Distributions
Hashes for scared-0.8.7-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42e16f02de7ca55ea706ba0984690382d7a5bd4ec19d6fc9a34a9e14b321b537 |
|
MD5 | 50afaecdad8685ff8d2b5a249bb00382 |
|
BLAKE2b-256 | e8e0f4482fb9e4f47d6d128be885c698d99d9e24b2767f1d8c91313fa227c08e |
Hashes for scared-0.8.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe76d3e4c5211fe3c3f5375aab92715fa403004071b0ba2980cbba2bc6208cae |
|
MD5 | 7222ed783443114cc0440c286aef9ae5 |
|
BLAKE2b-256 | 48602b9f6e5e201f90902fe284db88a377356afe16899b8d7a4772509f3e937e |
Hashes for scared-0.8.7-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cee1721b8518131aaa23b4aff66b0291c24bab731cc776211e66b20220608bb |
|
MD5 | 6ffd6dbb1310532c7bc5b6390254c38a |
|
BLAKE2b-256 | 05cc4fbfdde9cbbc6ae1056f017db63dd98f35a7ea84e9116e68be3a65570dc0 |
Hashes for scared-0.8.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54e1f8ed9fed86d1bec6da80057b31ffeab6a34dd86234ff6f114daa3ac71221 |
|
MD5 | 966c9feb94319918ebdfb134d0d171a6 |
|
BLAKE2b-256 | c5394c310e39b267398e85a59aa4c360e5b123ddaf40eb13cb54983762734916 |
Hashes for scared-0.8.7-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4962432da57f977930e05444effb0d494ea8c92cade0bc079b28cbe884e3ed56 |
|
MD5 | ffff4b29c34d640dbdccea158ac8ac0f |
|
BLAKE2b-256 | 82d4e3f1e1fc71a15f20cb8a3a1cd784e39cffee475d6aad2b0da4098e421924 |
Hashes for scared-0.8.7-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2966d4d26f13b937bb7809e537145ba1889c5b78a61dd2c0e82708765232eba1 |
|
MD5 | 1e3ed067751ba7be11b7199afacec424 |
|
BLAKE2b-256 | 459f94b07294f453c00ba71b51b741ba2a1648cf09e31b3dbb77e5b06ac7dd40 |