Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cracknuts_squirrel-0.0.1b0.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cracknuts_squirrel-0.0.1b0-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file cracknuts_squirrel-0.0.1b0.tar.gz.

File metadata

  • Download URL: cracknuts_squirrel-0.0.1b0.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

Hashes for cracknuts_squirrel-0.0.1b0.tar.gz
Algorithm Hash digest
SHA256 eb238054afc192606a828b757ede65c56ef96e77f17ecd8d3a9cf178cdcf6b88
MD5 4b4cd9ccaede771e86374bb0e04ed7eb
BLAKE2b-256 06e191621baa27a1382a88b1469e9017552b3ae8ce69297b10554eebdb8f717d

See more details on using hashes here.

File details

Details for the file cracknuts_squirrel-0.0.1b0-py3-none-any.whl.

File metadata

File hashes

Hashes for cracknuts_squirrel-0.0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e2b41507d9832857a8169d645593bbf79e51f932b45f12dbb7016863d8433de
MD5 1b0869c991d68385109289660e3c3cf1
BLAKE2b-256 b9eaccc4b1e8b22c3f220a7f6858d5b90a1f14f8d50bc3fed95b03ab0b86ec7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page