Code Watermarking via Whitespace Encoding for Attribution Persistence
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for watermarking code to identify its origin or author are ineffective as they can be easily removed or altered, and do not maintain attribution during copying or compilation processes.
Innovation Solution
A method that encodes identification data into whitespace characters within code, replacing or inserting them based on the number of existing whitespace characters, allowing for embedded attribution without altering the code's visual appearance or functionality.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If copyright statements are placed within comments to watermark code, then identification data is embedded in the code, but the identification data can be easily removed by users when copying the code
Solution Approach 1:
The patent merges the identification data with the functional code by encoding it into whitespace characters that are integral to the code structure. Unlike separate comments, the whitespace-encoded identification is embedded within the code flow itself, making it inseparable from the functional portions that users need to copy.
Solution Approach 2:
The patent creates multiple copies of the identification data distributed throughout the code at different locations. When users copy functional portions of the code, they inadvertently copy multiple instances of the embedded identification data, ensuring persistence even if some instances are missed.
2Loss of information
If identification data is embedded in visible form in code, then attribution is clear, but the visual appearance and readability of the code are altered
Solution Approach 1:
The patent uses whitespace characters (spaces, tabs, newlines) as the encoding medium, which are invisible or imperceptible to human readers. This is analogous to changing the 'color' or visual properties of the embedded data to be imperceptible, thereby maintaining code readability while embedding identification information.
3Reliability
If traditional watermarking methods are used, then identification data can be added to code, but the watermarking can be easily removed or altered during copying or compilation
Solution Approach 1:
The identification data is merged with the functional code structure through whitespace encoding. Since whitespace characters are essential to code formatting and structure, removing or altering them would corrupt the code's functionality, thereby protecting the embedded identification data from removal or alteration.
Solution Approach 2:
Multiple copies of the identification data are embedded at different locations within the code. This redundancy ensures that even if some instances are removed or altered, other copies remain intact to maintain attribution integrity.
Data Source
AI summary
Systems and method for watermarking portions of code for the purposes of identification are described. A computer-implemented method of watermarking a portion of code with identification data includes: determining, by a computing device, a number of existing whitespace characters in the portion of code; encoding, by the computing device, the identification data using a set of reference whitespace characters; and embedding, by the computing device, the encoded identification data into the portion of code, wherein the embedding the encoded identification data includes, based on the determined number of existing whitespace characters, either replacing existing whitespace characters in the portion of code with the encoded identification data or inserting the encoded identification data characters into the portion of code.


