[论文解读] ChatGPT vs. Lightweight Security: First Work Implementing the NIST Cryptographic Standard ASCON
本工作首次尝试使用 GPT-4 实现 NIST 轻量级密码算法 ASCON,详细描述分阶段的方法、挑战,以及带测试的 Python 实现。
This study, to the best of our knowledge, is the first to explore the intersection between lightweight cryptography (LWC) and advanced artificial intelligence (AI) language models. LWC, in particular the ASCON algorithm which has been selected as the LWC standard by the National Institute of Standards and Technology (NIST) in Feb. 2023, has become increasingly significant for preserving data security given the quick expansion and resource limitations of Internet of Things (IoT) devices. On the other hand, OpenAI's large language model (LLM) ChatGPT has demonstrated significant potential in producing complex, human-like text. This paper offers a novel method for implementing the NIST LWC standard, ASCON, using the GPT-4 model. Moreover, this paper details the design and functionality of ASCON, the procedures and actual Python implementation of ASCON using ChatGPT, and a discussion of the outcomes. The results contribute valuable insights into the efficient application of advanced AI language models in cryptography, particularly in constrained environments. Source code can be found at: https://github.com/DrCintas/ASCON-with-ChatGPT.
研究动机与目标
- 激励研究将轻量级密码学与先进的 AI 语言模型结合,以提升物联网安全。
- 描述 ASCON 作为 NIST 选定的轻量级认证加密标准及其对资源受限设备的相关性。
- 提出并应用一种方法学,利用 ChatGPT 在 Python 中实现 ASCON-128 并评估结果。
- 提供关于使用大型语言模型实现密码算法的实际能力与局限性的见解。
提出的方法
- 概述使用 ChatGPT 实现密码算法的五阶段方法(算法识别、算法教育、算法实现、代码执行与测试、代码评审与调试)。
- 详细说明 ASCON 认证加密过程,包括初始化、关联数据处理、明文处理和最终化,其 320 位置换和 5 位 S-box 实现。
- 利用 GPT-4 生成并迭代改进 ASCON-128 的 Python 代码,包括辅助例程(to_bytes、from_bytes、pad、xor_bytes)以及置换/旋转操作。
- 对参考实现进行分阶段测试,诊断差异,并逐步加入关联数据处理。
- 记录并展示用于纠正关键组件(initialize、ASCON_permutation、process_data、finalize)的提示词及迭代。
实验结果
研究问题
- RQ1GPT-4 能否在 Python 中有效实现 NIST 轻量级密码原语(ASCON-128)?
- RQ2使用大型语言模型生成正确的密码代码的实际挑战和局限性有哪些?
- RQ3需要多少次迭代提示和调试步骤才能使 GPT-4 的输出与 ASCON 规范对齐?
- RQ4在与参考实现验证时,得到的实现是否与原始 ASCON 测试向量匹配?
主要发现
- 该研究表明使用 ChatGPT 实现 ASCON-128 是可行的,且能够与参考实现的测试向量匹配。
- 需要一种迭代的分阶段提示方法来纠正常量、旋转和置换逻辑。
- GPT-4 能生成模块化代码和辅助例程,但初始输出可能包含多处与规范不符之处,需要有针对性的提示。
- 作者建议参考开源项目或密码学专家,并承认从零开始实现密码原语的潜在风险。
- 该工作提供源代码和可重复的工作流(GitHub 链接),以复现实验中的 ASCON-with-ChatGPT 实现。
- 结果强调,虽然可行,但不建议在实际安全部署中仅依赖 AI 生成的密码代码。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。