@@ -1,6 +1,6 @@ | |||
# Python-ELMO | |||
_Python-ELMO_ is a Python library which proposes an encapsulation of the project _ELMO_. | |||
_Python-ELMO_ is a Python library which proposes an encapsulation of the project _ELMO_, a statistical leakage simulator for the ARM M0 family. | |||
[MOW17] **Towards Practical Tools for Side | |||
Channel Aware Software Engineering : ’Grey Box’ Modelling for Instruction Leakages** | |||
@@ -9,8 +9,6 @@ https://www.usenix.org/conference/usenixsecurity17/technical-sessions/presentati | |||
**ELMO GitHub**: https://github.com/sca-research/ELMO | |||
**Python-ELMO Contributors**: Thibauld Feneuil | |||
## Requirements | |||
To use _Python-ELMO_, you need at least Python3.5 and ```numpy```. | |||
@@ -28,7 +26,7 @@ To use ELMO on a leaking binary program, you need to compile the C implementatio | |||
First, download _Python-ELMO_. | |||
```bash | |||
git clone https://git.aprilas.fr/tfeneuil/python-elmo | |||
git clone https://github.com/ThFeneuil/python-elmo | |||
``` | |||
And then, install ELMO thanks to the installation script. It will use Internet to download the [ELMO project](https://github.com/sca-research/ELMO). | |||
@@ -60,7 +58,7 @@ This function will create a repository ```dilithium``` with all the complete squ | |||
- The file ```project.c``` where you must put the leaking code; | |||
- The file ```projectclass.py``` where there is the class of the simulation which will enable you to generate traces of the project in Python scripts; | |||
- A ```Makefile``` ready to be used with a compiler _arm-none-eabi-gcc_. | |||
Usually a leaking code runs challenges, one challenge giving a power trace. A challenge is the execution of a code with a specific set of data. This set of data is given in the input of the leakage simulation. For example, one can imagine that the leaking code is a symmetric encryption and one wants to study its power leakage according to the message and the secret key. Then, a challenge is the simulation of the leakage for a specific message and for a specific secret key. | |||
So, the classical form of ```project.c``` is the following one: | |||
@@ -72,7 +70,7 @@ So, the classical form of ```project.c``` is the following one: | |||
- Stop the record of the power leakage (end a power trace) with ```endtrigger```. | |||
- Eventually output some data with ```printbyte```. | |||
- Indicate to ELMO tool that the simulation is finished with ```endprogram```. | |||
The file ```projectclass.py``` contains a subclass of ```SimulationProject```. It is the description of the ```project.c``` file for the ELMO tool, in order to correctly realise the simulation. It also provides methods to manage the simulation (see following sections). | |||
- The classmethod ```get_binary_path(cl)``` must return the relative path of the leakage binary (```project.c``` correctly compiled). | |||
- The method ```set_input_for_each_challenge(self, input, challenge)``` must write a ```challenge``` in ```input``` using the function ```write```. |
@@ -45,17 +45,17 @@ def install_elmo_tool(elmo_complete_path): | |||
elmodefines_h = ''.join(elmodefines_lines) | |||
with open(elmodefines_h_path, 'w') as _file: | |||
_file.write(elmodefines_h) | |||
# Compile the tool | |||
check_call("make clean".split(), cwd=elmo_complete_path) | |||
check_call("make".split(), cwd=elmo_complete_path) | |||
class PostBuildCommand(build_py): | |||
""" Build Command to add the ELMO installation """ | |||
def run(self): | |||
build_py.run(self) | |||
# ELMO Installation | |||
elmo_complete_path = os.path.join( | |||
self.build_lib, | |||
@@ -72,25 +72,35 @@ if __name__ == '__main__': | |||
setuptools.setup( | |||
name="python-elmo", | |||
version="0.0.1", | |||
version="0.1.0", | |||
author="Thibauld Feneuil", | |||
author_email="thibauld.feneuil@cryptoexperts.com", | |||
description="Emulator for power Leakage for the M0", | |||
description="A Python encapsulation of a statistical leakage simulator for the ARM M0 family", | |||
long_description=long_description, | |||
long_description_content_type="text/markdown", | |||
url=PELMO_SOURCE, | |||
project_urls={ | |||
'ELMO Source': ELMO_SOURCE, | |||
'pELMO Source': PELMO_SOURCE, | |||
"ELMO Source": ELMO_SOURCE, | |||
}, | |||
packages=setuptools.find_packages(), | |||
keywords="python3 crypto", | |||
classifiers=[ | |||
"Development Status :: 2 - Pre-Alpha", | |||
"Intended Audience :: Developers", | |||
"Intended Audience :: Science/Research", | |||
"License :: OSI Approved :: MIT License", | |||
"Programming Language :: Python", | |||
"Programming Language :: Python :: 3", | |||
"Operating System :: MacOS", | |||
"Operating System :: POSIX :: Linux", | |||
"Topic :: Scientific/Engineering", | |||
"Topic :: Security :: Cryptography", | |||
"Topic :: Software Development :: Libraries :: Python Modules", | |||
], | |||
python_requires='>=3.5', | |||
python_requires=">=3.5", | |||
cmdclass={ | |||
'build_py': PostBuildCommand, | |||
"build_py": PostBuildCommand, | |||
}, | |||
install_requires=['numpy'], | |||
install_requires=["numpy"], | |||
include_package_data=True, | |||
) |