Implementation of Ring Learning-with-Errors Encryption and Brakerski–Fan–Vercauteren Fully Homomorphic Encryption Using ChatGPT
This paper investigates whether ChatGPT, a large language model, can assist in the implementation of lattice-based cryptography and fully homomorphic encryption algorithms, specifically the Ring Learning-with-Errors encryption scheme and the Brakerski–Fan–Vercauteren FHE scheme. To the best of our knowledge, this study represents the first systematic exploration of ChatGPT’s ability to implement these cryptographic algorithms. Fully homomorphic encryption, despite its theoretical and practical significance, poses significant challenges due to its computational complexity and efficiency requirements. This study evaluates ChatGPT’s capability as a development tool from both algorithmic and implementation perspectives. At the algorithmic level, ChatGPT demonstrates a solid understanding of the Rring Learning-with-Errors lattice encryption scheme but faces limitations in comprehending the intricate structure of the Brakerski–Fan–Vercauteren FHE scheme. At the code level, ChatGPT can generate functional C++ implementations of both encryption schemes, significantly reducing manual coding effort. However, debugging and corrections remain necessary, particularly for the more complex Brakerski–Fan–Vercauteren scheme, where additional effort is required to ensure correctness. The findings highlight ChatGPT’s potential and limitations in supporting cryptographic algorithm development, offering insights into its application for advancing implementations of complex cryptographic systems.
Authors
- Liqun Chen (ORCID: https://orcid.org/0000-0003-2680-4907)
- Zhigang Chen (ORCID: https://orcid.org/0000-0001-5140-7319)
- Hai Liu
- Xinxia Song
Institutions
- Ningbo University (CN)
- Zhejiang Wanli University (CN)
- Guizhou University (CN)
- University of Surrey (GB)
Publication Details
- Journal
- Computers
- Published
- 2025-10-16
- DOI
- https://doi.org/10.3390/computers14100440
- Primary Topic
- Cryptography and Data Security
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China