A Python library for side-channel analysis
Project description
CrackNuts Squirrel
Installation
pip install cracknuts-squirrel
For Developers
In the virtual environment, run the following command to install the dependencies:
pip install -e .
pip install -r requirements-dev.txt
文件功能说明
lstm_aes_hd.py
该文件实现了基于LSTM的AES汉明距离(Hamming Distance)模型,用于侧信道分析攻击。主要功能包括:
- 定义了AESHDModel神经网络模型,结合了卷积层、双向LSTM层和注意力机制
- 实现了自定义数据集类(TraceDataset和InMemoryTraceDataset),用于加载和处理侧信道轨迹数据
- 包含模型训练逻辑,使用PyTorch框架进行训练
- 实现了Guessing Entropy(猜测熵)计算函数,用于评估攻击效果
- 提供了保存模型回调函数,在训练过程中定期保存模型并进行评估
test_lstm_model.py
该文件用于测试训练好的LSTM模型,执行AES密钥恢复攻击。主要功能包括:
- 加载训练好的模型文件(.pt格式)
- 从zarr文件中加载测试数据(轨迹和明文)
- 执行攻击过程,使用模型预测结果进行密钥猜测
- 计算并显示猜测熵,评估攻击效果
- 显示最可能的密钥候选值,并与实际密钥进行比较
这两个文件共同构成了一个完整的AES侧信道分析工具链,从模型训练到攻击测试。
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cracknuts_squirrel-0.1.0b0.tar.gz.
File metadata
- Download URL: cracknuts_squirrel-0.1.0b0.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22b4ef66ceda51489a164c5252b9b7fa209be3b88851afe0b4f276453b3d686f
|
|
| MD5 |
44d559e26c056e0c191525e0990b4495
|
|
| BLAKE2b-256 |
8b95ea7c906efbe35cba97d5206663ded9832eda096a52e6971f14a57eb9a11a
|
File details
Details for the file cracknuts_squirrel-0.1.0b0-py3-none-any.whl.
File metadata
- Download URL: cracknuts_squirrel-0.1.0b0-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bccd296f2e0d7d7af71357c1417087d6001864d11ef419be7cf87cf12d1d960
|
|
| MD5 |
4a4f3deca984ba57e6fca4fe3dc19f1d
|
|
| BLAKE2b-256 |
12284f2543ab76540c6bc3b72bd8864b98e4df2889a6d48a6a897b491a9aa10d
|