eshard/scared

GitHub: eshard/scared

由eShard团队维护的侧信道分析框架,帮助用户在公开数据集上快速入门和执行侧信道攻击实验。

Stars: 107 | Forks: 22

# SCAred [![pipeline status](https://gitlab.com/eshard/scared/badges/master/pipeline.svg)](https://gitlab.com/eshard/scared/commits/master) [![PyPI version](https://badge.fury.io/py/scared.svg)](https://pypi.org/project/scared/) [![Conda installer](https://anaconda.org/eshard/scared/badges/installer/conda.svg)](https://anaconda.org/eshard/scared) [![Latest Conda release](https://anaconda.org/eshard/scared/badges/latest_release_date.svg)](https://anaconda.org/eshard/scared) scared 是由 [eShard](http://www.eshard.com) 团队维护的侧信道分析框架。 ## 入门指南 ### 环境要求 Scared 需要 python **3.11**、**3.12** 或 **3.13** 以及 **Numpy>=2** 您可以根据自己的配置通过以下方式安装 `scared`: - 从源码安装 - 使用 `pip` 安装 - 使用 `conda` 安装 #### 使用 `conda` 安装 只需运行: ``` conda install -c eshard scared ``` #### 使用 `pip` 安装 Pypi 上提供了 Python wheels,只需运行: ``` pip install scared ``` #### 从源码安装 要从源码安装,您需要在源文件夹中运行: ``` pip install . ``` 如果您计划做出贡献,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 以在开发模式下安装库并运行测试套件。 ### 做一件很酷的事 通过做一件很酷的事开始使用 scared: ``` # 首先导入 lib import scared import numpy as np # 定义 selection 函数 @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 # 创建 analysis CPA a = scared.CPAAttack( selection_function=first_add_key, model=scared.HammingWeight(), discriminant=scared.maxabs) # 加载 traces,例如 dpa v2 subset ths = scared.traces.read_ths_from_ets_file('dpa_v2.ets') # 为 ths 创建 container container = scared.Container(ths) # 运行! a.run(container) ``` ## 文档 要进一步了解并学习有关 scared 的所有内容,请访问 [完整文档](https://eshard.gitlab.io/scared)。 您也可以通过启动这些 [Binder notebooks](https://mybinder.org/v2/gl/eshard%2Fscared-notebooks/master) 来获得关于 scared 的交互式介绍。 ## 许可证 该库根据 LGPL V3 许可证授权。有关详细信息,请参阅 [LICENSE](LICENSE) 文件。 主要面向非商业用途,供学术界、学生或希望学习侧信道分析基础知识的专业人士使用。 如果您希望在商业或工业环境中使用此库,[eShard](https://www.eshard.com) 提供收费的商业许可证。[联系我们](mailto:scared@eshard.com)! ## 可用的二进制构建 以下平台和 Python 版本提供二进制构建(pypi 上的 wheels 和 conda 构建)。 平台: - Linux x86 64 - Macosx x86 64 Python 版本: - 3.11 - 3.12 - 3.13
标签:CPA攻击, DPA, esHard, meg, 二进制发布, 侧信道分析, 信息安全, 安全测试, 密码学, 嵌入式安全, 开源工具, 手动系统调用, 攻击性安全, 攻击框架, 数据集分析, 硬件安全, 能量分析, 逆向工具