Ming Yang , Yu-an Tan , Ning Shi , Yajie Wang , Ziqi Wang , Qi Liang
{"title":"A privacy-preserving standardized model for large-scale source code fingerprint extraction and clone detection","authors":"Ming Yang , Yu-an Tan , Ning Shi , Yajie Wang , Ziqi Wang , Qi Liang","doi":"10.1016/j.csi.2025.103998","DOIUrl":null,"url":null,"abstract":"<div><div>With the rapid advancement of software technology, developers often replicate or modify existing code to achieve code cloning, thereby improving development efficiency. However, the widespread use of open-source code may lead to intellectual property disputes and infringement risks. Additionally, the repeated use of cloned code can exacerbate vulnerabilities, increasing system fragility and maintenance costs, especially when synchronized modifications are required for cloned fragments during software evolution. To address these challenges, this paper proposes a privacy-preserving large-scale code fingerprint extraction model—Ringer. The model decouples feature extraction from clone detection, enabling efficient clone detection without direct access to the source code. Ringer employs syntax trees for lexical and syntactic analysis to comprehensively extract code features, and generates irreversible code fingerprints through token replacement and the Metro-128 hash algorithm, ensuring the privacy of the source code while effectively detecting clones. Experimental results show that Ringer performs excellently on datasets from multiple programming languages (e.g., Java, C++, Python, etc.), maintaining consistently high accuracy based on the characteristics of each language. On the Python dataset, Ringer achieves detection accuracies of 94%, 94%, and 97% for Type-1, Type-2, and Type-3 clones, respectively, further validating its efficiency and reliability in practical applications. Compared to mainstream detection tools (e.g., Moss and NiCad), Ringer outperforms in cross-language detection, demonstrating its robust adaptability and superior accuracy. This strongly supports the broad applicability of Ringer for privacy-preserving clone detection in large-scale, multi-language codebases.</div></div>","PeriodicalId":50635,"journal":{"name":"Computer Standards & Interfaces","volume":"94 ","pages":"Article 103998"},"PeriodicalIF":4.1000,"publicationDate":"2025-03-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Standards & Interfaces","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0920548925000273","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, HARDWARE & ARCHITECTURE","Score":null,"Total":0}
引用次数: 0
Abstract
With the rapid advancement of software technology, developers often replicate or modify existing code to achieve code cloning, thereby improving development efficiency. However, the widespread use of open-source code may lead to intellectual property disputes and infringement risks. Additionally, the repeated use of cloned code can exacerbate vulnerabilities, increasing system fragility and maintenance costs, especially when synchronized modifications are required for cloned fragments during software evolution. To address these challenges, this paper proposes a privacy-preserving large-scale code fingerprint extraction model—Ringer. The model decouples feature extraction from clone detection, enabling efficient clone detection without direct access to the source code. Ringer employs syntax trees for lexical and syntactic analysis to comprehensively extract code features, and generates irreversible code fingerprints through token replacement and the Metro-128 hash algorithm, ensuring the privacy of the source code while effectively detecting clones. Experimental results show that Ringer performs excellently on datasets from multiple programming languages (e.g., Java, C++, Python, etc.), maintaining consistently high accuracy based on the characteristics of each language. On the Python dataset, Ringer achieves detection accuracies of 94%, 94%, and 97% for Type-1, Type-2, and Type-3 clones, respectively, further validating its efficiency and reliability in practical applications. Compared to mainstream detection tools (e.g., Moss and NiCad), Ringer outperforms in cross-language detection, demonstrating its robust adaptability and superior accuracy. This strongly supports the broad applicability of Ringer for privacy-preserving clone detection in large-scale, multi-language codebases.
期刊介绍:
The quality of software, well-defined interfaces (hardware and software), the process of digitalisation, and accepted standards in these fields are essential for building and exploiting complex computing, communication, multimedia and measuring systems. Standards can simplify the design and construction of individual hardware and software components and help to ensure satisfactory interworking.
Computer Standards & Interfaces is an international journal dealing specifically with these topics.
The journal
• Provides information about activities and progress on the definition of computer standards, software quality, interfaces and methods, at national, European and international levels
• Publishes critical comments on standards and standards activities
• Disseminates user''s experiences and case studies in the application and exploitation of established or emerging standards, interfaces and methods
• Offers a forum for discussion on actual projects, standards, interfaces and methods by recognised experts
• Stimulates relevant research by providing a specialised refereed medium.