{"id":22938791,"url":"https://github.com/bzz/codecipher","last_synced_at":"2025-04-01T19:44:43.490Z","repository":{"id":266749836,"uuid":"899169312","full_name":"bzz/CodeCipher","owner":"bzz","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-05T22:33:53.000Z","size":16575,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T02:56:15.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T18:43:54.000Z","updated_at":"2024-12-05T22:33:56.000Z","dependencies_parsed_at":"2024-12-05T23:34:09.436Z","dependency_job_id":null,"html_url":"https://github.com/bzz/CodeCipher","commit_stats":null,"previous_names":["bzz/codecipher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzz%2FCodeCipher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzz%2FCodeCipher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzz%2FCodeCipher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzz%2FCodeCipher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bzz","download_url":"https://codeload.github.com/bzz/CodeCipher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246704448,"owners_count":20820588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T12:28:19.163Z","updated_at":"2025-04-01T19:44:43.474Z","avatar_url":"https://github.com/bzz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\nCode for \"CODECIPHER: LEARNING TO OBFUSCATE SOURCE CODE AGAINST LLMS\". CodeCipher is a novel method that protects code privacy while preserving the original responses from large language models (LLMs). It achieves this by transforming the LLM's embedding matrix, such that each row corresponds to a different word in the original matrix. This transformation creates a token-to-token confusion mapping, effectively obfuscating the source code. The new embedding matrix is optimized by minimizing a task-specific loss function.\n\n## Repository Structure\n```\n├── data # training data\n├── data_loader_gen.py # data loader for code generation\n├── data_loader.py # data loader for code summarization\n├── data_loader_translate.py # data loader for code translation\n├── human-eval\n├── modeling_llama.py # model for LLM\n├── README.md\n├── requirements.txt\n├── train_matrix_iter_gen.py # code for running code completion task\n├── train_matrix_iter_summary.py # code for running code summarization task\n├── train_matrix_iter_translate.py # code for running code translation task\n└── utils # utility functions\n```\n\n## Dataset\nThe trainning data for code summary can be downloaded from [here](https://github.com/microsoft/CodeXGLUE/tree/main/Code-Text/code-to-text). Others is in the data folder.\n\n## Environment\n```\npip install requirements.txt\npip install -e human-eval\n```\n## Run\nTo run the code, you can execute the following commands. A detailed list of hyperparameters can be found in Appendix C of the paper.\n\n```\npython train_matrix_iter_gen.py # code for code completion\npython train_matrix_iter_summary.py # code for summarization\npython train_matrix_iter_translate.py # code for translation\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzz%2Fcodecipher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbzz%2Fcodecipher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzz%2Fcodecipher/lists"}