payalkhatri2004-create/RSA-SideChannel-Timing-Attack

GitHub: payalkhatri2004-create/RSA-SideChannel-Timing-Attack

RSA旁路时序攻击模拟与防御研究工具

Stars: 0 | Forks: 0

# RSA 的旁路时序攻击:实现与对策 本存储库包含在 **Muhammad Talha 教师指导下**,针对密码学课程中 **Track D:旁路漏洞的密码分析** 的基于实际研究的实现。 ## 项目概述 虽然 RSA 在数学上对传统的暴力攻击是安全的,但物理软件实现可能会通过执行时间的变化泄露关键的加密参数。本项目模拟了一个针对非恒时平方乘法模幂运算例程的本地时序对手,并验证了一种强大的 **加密遮蔽** 对策来中和攻击向量。 ### 包含的核心组件 1. **易受攻击的实现:** 具有不同条件执行延迟的平方乘法模幂运算算法,模拟分支时序泄露。 2. **动态防御布局:** 通过注入随机动态噪声向量来分离时序轨迹和密钥身份的加密遮蔽对策。 3. **统计配置文件引擎:** 使用系统性能计数器 (`time.perf_counter()`) 进行高保真模拟,以捕获运行时延迟分布。 ## 技术规范与参数 - **RSA 目标密钥:** $n = 3233, e = 17, d = 2753$ - **模拟迭代次数:** 50 次随机的密文执行 - **语言栈:** Python 3.13 - **捕获的关键指标:** 执行方差分析,攻击精度映射,内存指标在 34 MB 脚印下。 ## 执行与部署指南 ### 1. 先决条件与环境设置 确保您的环境中已安装 Python 3。要可视化统计评估图表,请使用 pip 安装所需的绘图依赖项: ``` pip install matplotlib 2. Running the Core Pipeline To execute the cryptographic simulation engine and save the benchmark profile charts, run the main file via the terminal: python main.py 3. Expected Outputs Upon successful execution, the script will: Output performance runtime statistics directly to your terminal. Display a dynamic execution latency map showcasing vulnerable spikes versus blinded noise filters. Save a high-fidelity visual layout named side_channel_analysis.png inside your workspace directory. ```
标签:Python, RSA, 侧信道攻击, 加密分析, 加密盲化, 加密课程项目, 图表可视化, 安全漏洞, 密码学, 平方乘法, 性能分析, 手动系统调用, 无后门, 时间攻击, 模幂运算, 系统性能计数器, 统计分析, 防御策略