Traces and trace header set Python library for side-channel analysis.
Project description
estraces - Traces and trace sets Python library for side-channel attacks
estraces is a Python library to manipulate side-channel trace sets. It aims at giving a clear and uniform API to handle traces samples and metadata for various persistency and file formats. It uses Numpy to handle data.
estraces was originally developped and maintain by eshard, and is heavily used in the open-source side-channel analysis framework scared.
Getting started
Requirements and installation
estraces requires and must work on Python 3.6, 3.7, 3.8, 3.9, 3.10 versions.
Python 3.7 is outdated now EOL date
You can install it by several ways:
- from source
- with
pip
- with
conda
At time of writing, we highly recommend to install from
conda
when usingestraces
with python 3.8.
Installing from source
To install estraces from source, you will need the following requirements:
pip
andsetuptools
with version greater than 40.0- For Python 3.8, you'll need to build and install
h5py
from source see H5PY installation instructions before installingestraces
From the source code folder, run:
pip install .
Installing with pip
First, you should update your pip
and setuptools
version:
pip install -U pip setuptools
If you use Python 3.8 or above, you must first build and install h5py
, see instructions.
pip install estraces
Installing with conda
To install from conda
, simply run:
conda install -c eshard estraces
Opens a trace set
If you have a trace set as binary files, you can get a trace header set by using the binary reader:
# First import the lib
import estraces
# We suppose the binary files are under traces/ and are named something.bin
my_traces = estraces.read_ths_from_bin_filenames_pattern(
'traces/*.bin', # First indicate the filename pattern for the bin file
dtype='uint8', # Indicate the numpy dtype of the data
metadatas_parsers={} # This dict allows to associate metadata
)
You can then read your samples:
# This will return the data for the first 100 traces
my_traces.samples[:100]
# This will return the frame 0 - 1000 of all the traces as a numpy array
my_traces.samples[:, :1000]
# You can iterate on traces
for trace in my_traces:
# do something
Documentation
To go further and learn all about estraces, 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.
Source Distribution
Built Distribution
File details
Details for the file estraces-1.9.6.tar.gz
.
File metadata
- Download URL: estraces-1.9.6.tar.gz
- Upload date:
- Size: 86.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b881f8c1b9baac11254232a069c25153d0758d730369cb249157d77651a231fa |
|
MD5 | 3bb99db129097f42c5249a98252f0b2a |
|
BLAKE2b-256 | cfbe538be836f90db4d554641243202f6a50174d1e130b50e4a5e9796cb814af |
File details
Details for the file estraces-1.9.6-py3-none-any.whl
.
File metadata
- Download URL: estraces-1.9.6-py3-none-any.whl
- Upload date:
- Size: 55.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06a1936194330b3ae14fad8e59f520caf3239a58bf85ca3592e71c666dc4e733 |
|
MD5 | ea06e0c6ded3269b43b1a0213d670e0e |
|
BLAKE2b-256 | 0a0be8dc95ab4f54d62cce21a777719289562c26251a358d31a9590254c9232a |