AICrypto: A Comprehensive Benchmark For Evaluating Cryptography Capabilities of Large Language Models

Yu Wang, Yijian Liu, Liheng Ji, Han Luo, Wenjie Li, Xiaofei Zhou, Chiyun Feng, Puji Wang, Yuhan Cao, Geyuan Zhang, Xiaojian Li, Rongwu Xu, Yilei Chen, Tianxing He · OpenReview

Abstract: Large language models (LLMs) have demonstrated remarkable capabilities across a variety of domains. However, their applications in cryptography, which serves as a foundational pillar of cybersecurity, remain largely unexplored. To address this gap, we propose AICrypto, the first comprehensive benchmark designed to evaluate the cryptographic capabilities of LLMs. The benchmark comprises 135 multiple-choice questions, 150 capture-the-flag (CTF) challenges, and 18 proof problems, covering a broad range of skills from factual memorization to vulnerability exploitation and formal reasoning. All tasks are carefully reviewed or constructed by cryptography experts to ensure correctness and rigor. To support automated evaluation of CTF challenges, we design an agent-based framework. To gain deeper insight into the current state of cryptographic proficiency in LLMs, we introduce human expert performance baselines for comparison across all task types. Our evaluation of 17 leading LLMs reveals that state-of-the-art models match or even surpass human experts in memorizing cryptographic concepts, exploiting common vulnerabilities, and routine proofs. However, they still lack a deep understanding of abstract mathematical concepts and struggle with tasks that require multi-step reasoning and dynamic analysis. We hope this work could provide insights for future research on LLMs in cryptographic applications.

Introduction

Cryptography is the backbone of digital security, sitting at the intersection of abstract mathematics and low-level software implementation. While LLMs have shown flashes of brilliance in general coding and mathematics, their ability to handle the specific, high-stakes demands of cryptography remained largely unmeasured. Existing cybersecurity benchmarks often treat cryptography as a footnote or focus on simple encryption tricks.

AICrypto addresses this "reasoning gap." Cryptography requires more than just formulaic knowledge; it demands an understanding of why a protocol works (for formal proofs) and how to exploit subtle implementation flaws (for practical attacks). Furthermore, modern cryptography involves massive numbers that often trip up the token-based processing of standard LLMs.

The AICrypto Benchmark

The researchers developed a rigorous benchmark comprising three distinct task types designed to test the full spectrum of cryptographic proficiency:

  1. Multiple-Choice Questions (MCQs): 135 questions testing factual knowledge and conceptual understanding. These were manually curated and rewritten to prevent "data contamination" from training sets.
  2. Proof Problems: 30 high-level mathematical problems (sourced from elite university exams) requiring formal logic and rigorous argumentation.
  3. Capture-the-Flag (CTF) Challenges: 150 practical hacking scenarios categorized into RSA, Lattice-based crypto, Elliptic Curves (DLP/ECC), and PRNG/Hashes. Over 90% of these are sourced from recent 2023–2025 competitions to ensure freshness.
Overview of the AICrypto benchmark components: Multiple-Choice Questions, Proof Problems, and Capture-the-Flag challenges.

To evaluate the CTF portion, the team built an Agentic Evaluation Framework. Instead of just generating static code, the LLM operates as an autonomous agent in a sandboxed Linux environment, executing commands, reading files, and writing exploit scripts in a multi-turn loop until it retrieves the "flag."

Performance Analysis

The study evaluated 17 leading models, including the OpenAI o3 and o4 series, Claude 3.7 Sonnet, Gemini 2.5 Pro, and DeepSeek-v3, comparing them against a human expert baseline.

Composite performance scores of 17 leading LLMs compared to a human expert baseline across three task categories.

Key Results

  • The Memorization Ceiling: Top models have essentially "solved" cryptographic theory. OpenAI’s o3 achieved 97.8% accuracy on MCQs, surpassing the human expert baseline of 94.1%.
  • The CTF Gap: This proved to be the most difficult category. While humans averaged an 81.2% success rate, the best-performing model (Gemini 2.5 Pro) managed only 56.0%. Many models fell below 35%.
  • Proof Reasoning: Models are approaching human levels in "routine" proofs but lag by approximately 10 percentage points behind experts in complex, multi-step formal reasoning.

Discussion and Insights

The evaluation revealed several critical weaknesses in current LLM architectures. Despite high scores in theory, models often suffer from an Arithmetic Achilles' Heel. Advanced reasoning models frequently identify complex RSA vulnerabilities correctly but fail the final step because they cannot accurately perform large-number modular arithmetic.

Furthermore, the models often exhibit Syntactic Mimicry rather than true semantic understanding. In proof tasks, LLMs produce text that looks like a formal proof (correct LaTeX, standard terminology) but contains logical hallucinations. In CTF tasks, models often default to "blind" attacks—trying every standard factorization method they know rather than analyzing the specific code provided to find a unique flaw.

Future Work

To close the performance gap, future research should focus on:

  • Numerical Precision: Integrating LLMs with external symbolic math engines to handle large-number arithmetic.
  • Advanced Agent Frameworks: Moving beyond simple loops to multi-agent collaboration or specialized "thinking" environments.
  • Dynamic Reasoning: As models saturate MCQ benchmarks, evaluation must shift toward novel, interactive reasoning tasks.

The code and dataset are available at: https://github.com/wangyu-ovo/aicrypto-agent

Summary updated

BibTeX
@misc{wang2025aicrypto,
  author = {Yu Wang and Yijian Liu and Liheng Ji and Han Luo and Wenjie Li and Xiaofei Zhou and Chiyun Feng and Puji Wang and Yuhan Cao and Geyuan Zhang and Xiaojian Li and Rongwu Xu and Yilei Chen and Tianxing He},
  title = {{AICrypto: A Comprehensive Benchmark For Evaluating Cryptography Capabilities of Large Language Models}},
  year = {2025},
  eprint = {2507.09580},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.09580},
}
Figure