CodeCipher: Learning to Obfuscate Source Code Against LLMs
While large code language models have made significant strides in AI-assisted coding tasks, there are growing concerns about privacy challenges. The user code is transparent to the cloud LLM service provider, inducing risks of unauthorized training, reading, and execution of the user code. In this paper, we propose CodeCipher, a novel method that perturbs privacy from code while preserving the original response from LLMs. CodeCipher transforms the LLM's embedding matrix so that each row corresponds to a different word in the original matrix, forming a token-to-token confusion mapping for obfuscating source code. The new embedding matrix is optimized by minimizing the task-specific loss function. To tackle the challenge of the discrete and sparse nature of word vector spaces, CodeCipher adopts a discrete optimization strategy that aligns the updated vector to the nearest valid token in the vocabulary before each gradient update. We demonstrate the effectiveness of our approach on three AI-assisted coding tasks including code completion, summarization, and translation. Results show that our model successfully confuses the privacy in source code while preserving the original LLM's performance.
Code (0)
등록된 구현이 없습니다.
Tasks
Code CompletionvalidMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation
Malware authors often employ code obfuscations to make their malware harder to detect. Existing tools for generating obfuscated code often require access to the original source code (e.g., C++ or Java), and adding new ob…
Obfuscated Malware Detection: Investigating Real-world Scenarios through Memory Analysis
In the era of the internet and smart devices, the detection of malware has become crucial for system security. Malware authors increasingly employ obfuscation techniques to evade advanced security solutions, making it ch…
Malware DetectionLeveraging LLM to Strengthen ML-Based Cross-Site Scripting Detection
According to the Open Web Application Security Project (OWASP), Cross-Site Scripting (XSS) is a critical security vulnerability. Despite decades of research, XSS remains among the top 10 security vulnerabilities. Researc…
Large Language ModelSupervisor Obfuscation Against Covert Actuator Attackers
This work investigates the problem of synthesizing obfuscated supervisors against covert actuator attackers. For a non-resilient supervisor S, for which there exist some covert actuator attackers that are capable of infl…
DRLDO: A novel DRL based De-ObfuscationSystem for Defense against Metamorphic Malware
In this paper, we propose a novel mechanism to normalize metamorphic and obfuscated malware down at the opcode level and hence create an advanced metamorphic malware de-obfuscation and defense system. We name this system…
Deep Reinforcement LearningIntrusion Detection