Source code leakage monitoring and tracing system based on dynamic identification hash string
By using dynamic hash string technology in the source code leakage monitoring and traceability system, the embedded hash string is generated and buried, real-time monitoring and responsibility tracing of source code upload behavior is achieved, and the difficulty of untimely monitoring and responsibility tracing in traditional technologies is solved. The problem of this enhances the security and intelligence of enterprise source code management.
Patent Information
- Application Number
- CN202411547658.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional technology is difficult to realize real-time monitoring of source code upload behavior, and it is difficult to trace the responsibility for employee source code leakage, resulting in companies relying on employee awareness and security management regulations for protection.
The source code leakage monitoring and traceability system based on dynamic identification hash string is adopted. The source code monitoring module generates and buries the first embedded hash string when employees initialize the project source code, and generates the second embedded hash string during source code operation. When uploading the source code, the submission module embeds the second embedded hash string into the source code, and the leakage monitoring module queries and parses the original information in the hash string for responsibility traceability.
Realize real-time monitoring of the source code uploaded in the source code disclosure community, obtain original information through hash string parsing, trace the responsibility of source code leakage, improve enterprise protection measures for source code, and avoid the defects of relying on employee awareness and security management regulations. , improves the security and intelligence of the management project source code.
Smart Images

Figure CN119475285A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a source code leakage monitoring and tracing system based on a dynamic identification hash string. Background Art
[0002] In the process of software development and information technology research, source code is an important asset of an enterprise, which contains the enterprise's trade secrets, technological advantages and innovation capabilities. However, with the popularity of code hosting platforms and open source communities, source code leaks often occur. Source code leaks often cause serious economic losses and reputation damage to enterprises, so it is urgent to take corresponding protection measures for source code.
[0003] In traditional technology, the protection measures for source code mainly include: access control, which limits employees' access rights to source code and only allows authorized personnel to access; encrypted storage, which encrypts and stores source code; code auditing, which regularly audits the code to check for potential security risks. However, the above technical solutions are difficult to achieve real-time monitoring of source code upload behavior, and also make it difficult to trace source code leaks to the relevant responsible persons, making the company's protection of source code completely dependent on the self-consciousness of employees and security management regulations.
[0004] Therefore, a source code leakage monitoring and tracing system based on dynamic identification hash string is proposed. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, which is used to solve the problems in traditional technologies of untimely source code leakage monitoring and difficulty in tracing employees' source code leakage responsibilities.
[0006] An embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, including:
[0007] A source code monitoring module is used to generate a first pre-embedded hash string based on the employee's personal information when the employee initializes the project source code based on the code generation platform, and embed the first pre-embedded hash string into the project source code to generate a pre-processed source code; and is also used to obtain the employee's personal information and project operation information when the employee operates the project source code to generate a second pre-embedded hash string;
[0008] A source code submission module, for monitoring when an employee uploads the pre-processed source code to a source code disclosure community, embeds the second pre-embedded hash string into the pre-processed source code through a network submission script program, generates an uploaded project source code, and uploads the uploaded project source code to the source code disclosure community;
[0009] The leakage monitoring module is used to query the uploaded project source code in real time in the source code disclosure community through an application program interface. When it is found that the uploaded project source code contains a specific code identifier, the hash string in the uploaded project source code is extracted, the integrity of the hash string is verified, and the original information in the hash string is parsed and submitted to the backend supervisor.
[0010] Preferably, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the source code monitoring module comprises:
[0011] A hash string generating unit is used to obtain the employee work number information segment, the project group identification information segment and the project identification information segment in the employee personal information, format the employee work number information segment, the project group identification information segment and the project identification information segment, obtain a standard employee work number information segment, a standard project group identification information segment and a standard project identification information segment, combine them in a predetermined order, and obtain an employee identification string; perform base conversion on the employee identification string to obtain a base identification string; add a specific code identifier before the base identification string to generate a pre-embedded string; calculate the hash value of the pre-embedded string and combine it with a random character sequence to generate a first pre-embedded hash string;
[0012] A hash string embedding unit is used to embed the first pre-embedded hash string into one or more of the comment segment, useless logic segment and specific code segment of the project source code.
[0013] Preferably, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the hash string generation unit comprises:
[0014] The format processing subunit is used to set the standard information segment length and detect the information segment length of the employee ID information segment, the project group identification information segment, and the project identification information segment;
[0015] The information segment whose length is greater than the standard information segment length is used as the information segment to be compressed, the occurrence frequency of each character in the information segment to be compressed is obtained, each character is constructed as a leaf node, and the occurrence frequency of the character is used as the weight of the leaf node, a coding tree is constructed, and the leaf nodes in the coding tree are compressed and coded to generate a coded information segment, so that the information segment length of the coded information segment is equal to the standard information segment length;
[0016] The information segment whose length is less than the standard information segment length is used as the information segment to be filled, and invalid codes are filled into the information segment to be filled, so that the information segment length of the information segment to be filled is equal to the standard information segment length;
[0017] Get the standard employee ID information segment, the standard project group identification information segment, and the standard project identification information segment.
[0018] Preferably, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the hash string generation unit further includes:
[0019] A character string generating subunit, used for combining the standard employee work number information segment, the standard project group identification information segment, and the standard project identification information segment in a predetermined order to obtain an employee identification character string;
[0020] The base conversion unit subunit is used to construct a base-62 character table, convert the decimal characters in the employee identification string into base-62 characters, and obtain a base-62 identification string;
[0021] The 62-decimal character table includes characters 0-9, AZ and az.
[0022] Preferably, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the hash string generation unit further includes:
[0023] The encoding subunit is used to obtain the enterprise name and encode it through a built-in encoder to generate a specific code identification;
[0024] A character string generation subunit, used for adding the specific code identifier to the head end of the hexadecimal identifier character string for combination to generate a preprocessed character string;
[0025] The spacing mark subunit is used to obtain the end character of the specific code identifier, match the corresponding spacing identifier, add it to the pre-processed string, and generate a pre-embedded string.
[0026] Preferably, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the hash string generation unit further includes:
[0027] A hash encoding subunit is used to group the embedded character string according to the preset information length, obtain a number of character blocks, and fill in when the information length of the character block is less than the preset information length; compress each character block through a compression function, calculate the hash value of each character block, splice according to the character block order, and generate the hash value of the embedded character string;
[0028] H i =H i-1 +F Ci (H i-1 )
[0029] Among them, H i For the i-th character block C iThe hash value obtained by hash calculation, H i-1 For the i-1th character block C i-1 The hash value obtained by hash calculation, F Ci (H i-1 ) is the compression function for the hash value H i-1 and character block C i The function value to be processed, + is the hash value H i and the function value F Ci (H i-1 ) Perform mod 2 8 Remainder operation: For the calculation of the hash value of the first character block C1, the hash value H0 is initialized for calculation.
[0030] Preferably, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the source code submission module comprises:
[0031] A source code monitoring unit, used to trigger a hash string embedding program when detecting that an employee submits the pre-processed source code to a source code disclosure community;
[0032] The source code processing unit is used to embed the second pre-embedded hash string into the comment segment, useless logic segment and specific code segment of the pre-processed source code according to the hash string embedding program, generate the upload project source code, and upload the upload project source code to the source code public community.
[0033] Preferably, the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the leakage monitoring module comprises:
[0034] A leakage monitoring unit, configured to query the uploaded project source code in real time in the source code disclosure community through an application program interface, and extract a hash string from the uploaded project source code when it is found that the uploaded project source code contains a specific code identifier;
[0035] A hash string parsing unit, used to remove the specific code identifier in the hash string, obtain a pre-processed hash string, and perform inverse hash processing on the pre-processed hash string to obtain a parsed hash string;
[0036] The hash string detection unit is used to detect the completeness of the parsed hash string, and perform base conversion on the parsed hash string to obtain the original information contained in the parsed hash string.
[0037] Compared with the traditional technology, the beneficial effects of the present invention are: the system realizes real-time monitoring of the source code of the uploaded project in the source code public community through the leakage monitoring module, and according to the source code monitoring module and the source code submission module, the first pre-embedded hash string and the second pre-embedded hash string are buried, so that the system can parse the uploaded project source code containing a specific code identifier in the source code public community, obtain the original information in the hash string, and trace the responsibility; the source code leakage monitoring and tracing system based on the dynamic identification hash string realizes real-time monitoring of the source code uploading behavior, and at the same time, traces the source code leakage responsibility according to the original information obtained by parsing in the hash string, effectively improves the enterprise's protection measures for the source code, avoids the defects of relying entirely on the consciousness of employees and safety management regulations, and thus improves the security and intelligence of the enterprise management project source code.
[0038] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0039] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of the structure of a source code leakage monitoring and tracing system based on a dynamic identification hash string provided by the present invention. DETAILED DESCRIPTION
[0041] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0042] Embodiment 1:
[0043] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, referring to Figure 1 ,include:
[0044] The source code monitoring module is used to generate a first pre-embedded hash string based on the employee's personal information when the employee initializes the project source code based on the code generation platform, and embed the first pre-embedded hash string into the project source code to generate a pre-processed source code; it is also used to obtain the employee's personal information and project operation information when the employee operates the project source code, and generate a second pre-embedded hash string;
[0045] The source code submission module is used to monitor that when an employee uploads the pre-processed source code to the source code public community, the second pre-embedded hash string is embedded in the pre-processed source code through a network submission script program, and the uploaded project source code is generated and uploaded to the source code public community;
[0046] The leakage monitoring module is used to query the uploaded project source code in real time in the source code disclosure community through the application program interface. When it is found that the uploaded project source code contains specific code identifiers, the hash string in the uploaded project source code is extracted, the integrity of the hash string is verified, and the original information in the hash string is parsed and submitted to the background supervisor.
[0047] In the above embodiments, when an employee initializes the project source code based on the code generation platform, the source code monitoring module generates a first pre-embedded hash string based on the employee's personal information, and embeds the first pre-embedded hash string into the project source code to generate a pre-processed source code; when the source code submission module monitors that the employee uploads the pre-processed source code to the source code public community, the source code submission module embeds the second pre-embedded hash string into the pre-processed source code through the network submission script program, generates the uploaded project source code, and uploads the uploaded project source code to the source code public community.
[0048] In the above embodiment, the second pre-embedded hash string is generated by obtaining employee personal information and project operation information when the employee operates the project source code.
[0049] In the above embodiment, the leakage monitoring module queries the uploaded project source code in real time in the source code disclosure community through the application program interface. When it is found that the uploaded project source code contains a specific code identifier, the hash string in the uploaded project source code is extracted, the integrity of the hash string is verified, and the original information in the hash string is parsed and submitted to the background supervisor.
[0050] The beneficial effects of the above technology are: real-time monitoring of the source code of the uploaded project in the source code public community is realized through the leakage monitoring module, and the first pre-embedded hash string and the second pre-embedded hash string are buried according to the source code monitoring module and the source code submission module, so that the system can parse the uploaded project source code containing specific code identifiers in the source code public community, obtain the original information in the hash string, and trace the responsibility; compared with traditional technology, the above system realizes real-time monitoring of source code uploading behavior, and at the same time, traces the responsibility of source code leakage according to the original information obtained by parsing in the hash string, effectively improving the company's protection measures for source code, avoiding the defects of relying entirely on the self-consciousness of employees and safety management regulations, thereby improving the security and intelligence of enterprise management project source code.
[0051] In one embodiment, the code generation platform may be implemented as a code generation scaffold.
[0052] In one embodiment, the source code public community includes a GitHub community, and the source code submission module can be implemented using webhook technology.
[0053] In one embodiment, the above system structure is simple and easy to integrate into the existing software development and deployment process.
[0054] Embodiment 2:
[0055] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, and a source code monitoring module, including:
[0056] A hash string generation unit is used to obtain the employee work number information segment, the project group identification information segment and the project identification information segment in the employee personal information, format the employee work number information segment, the project group identification information segment and the project identification information segment, obtain the standard employee work number information segment, the standard project group identification information segment and the standard project identification information segment, combine them in a predetermined order, and obtain the employee identification string; perform base conversion on the employee identification string to obtain a base identification string; add a specific code identifier before the base identification string to generate a pre-embedded string; calculate the hash value of the pre-embedded string and combine it with a random character sequence to generate a first pre-embedded hash string;
[0057] The hash string embedding unit is used to embed the first pre-embedded hash string into one or more places in the comment section, useless logic section and specific code section of the project source code.
[0058] In the above embodiments, the hash string generation unit formats the employee work number information segment, the project group identification information segment, and the project identification information segment to obtain the standard employee work number information segment, the standard project group identification information segment, and the standard project identification information segment, and combines them in a predetermined order to obtain the employee identification character string; performs base conversion on the employee identification character string to obtain a base identification character string; adds a specific code identifier in front of the base identification character string to generate a pre-embedded character string; calculates the hash value of the pre-embedded character string and combines it with a random character sequence to generate a first pre-embedded hash string; and embeds the first pre-embedded hash string into one or more of the comment segment, useless logic segment, and specific code segment of the project source code through the hash string embedding unit.
[0059] In the above embodiment, the first pre-embedded hash string includes an employee ID information segment, a project team identification information segment, and a project identification information segment, thereby improving the feasibility of accountability for source code leakage.
[0060] The beneficial effects of the above technology are: through the hash string generation unit, the first pre-embedded hash string is generated according to the employee work number information segment, the project group identification information segment, and the project identification information segment, and the first pre-embedded hash string is embedded through the hash string embedding unit, and the first pre-embedded hash string is embedded in any one or more places in the comment segment, useless logic segment and specific code segment of the project source code. Even if other users modify and partially delete the source code, the system can track the hash string in the source code and trace the source code leakage responsibility of the relevant employees.
[0061] Embodiment 3:
[0062] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, and the hash string generation unit includes:
[0063] The format processing subunit is used to set the standard information segment length and detect the information segment length of the employee ID information segment, the project group identification information segment, and the project identification information segment;
[0064] An information segment whose information segment length is greater than the standard information segment length is used as the information segment to be compressed, the occurrence frequency of each character in the information segment to be compressed is obtained, each character is constructed as a leaf node, and the occurrence frequency of the character is used as the weight of the leaf node, a coding tree is constructed, and the leaf nodes in the coding tree are compressed and coded to generate a coded information segment, so that the information segment length of the coded information segment is equal to the standard information segment length;
[0065] An information segment whose information segment length is less than the standard information segment length is used as an information segment to be filled, and an invalid code is filled in the information segment to be filled, so that the information segment length of the information segment to be filled is equal to the standard information segment length;
[0066] Get the standard employee ID information segment, the standard project group identification information segment, and the standard project identification information segment.
[0067] In the above embodiments, the information segment lengths of the employee work number information segment, the project group identification information segment, and the project identification information segment are detected by the format processing subunit, and the information segment whose information segment length is greater than the standard information segment length is compressed as the information segment to be compressed, and the information segment whose information segment length is less than the standard information segment length is filled with invalid codes as the information segment to be filled, thereby generating the standard employee work number information segment, the standard project group identification information segment, and the standard project identification information segment.
[0068] In the above embodiments, the information segment to be compressed is compressed and the information segment to be padded is padded so that the length of the information segment is equal to the length of the standard information segment.
[0069] In the above embodiments, the information segment to be compressed is compressed by constructing a coding tree, taking characters as leaf nodes and the occurrence frequency of characters as the weight of the leaf nodes, and performing compression coding processing to generate a coded information segment.
[0070] The beneficial effect of the above technology is that: through the format processing sub-unit, the employee work number information segment, project group identification information segment, and project identification information segment are converted into standard employee work number information segment, standard project group identification information segment, and standard project identification information segment, so that the acquired information segment length is the standard information segment length, which is convenient for subsequent units to perform corresponding base conversion and hash calculation processing.
[0071] Embodiment 4:
[0072] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the hash string generating unit further includes:
[0073] The character string generation subunit is used to combine the standard employee ID information segment, the standard project group identification information segment, and the standard project identification information segment in a predetermined order to obtain an employee identification character string;
[0074] The base conversion unit subunit is used to construct a base 62 character table, convert the decimal characters in the employee identification string into base 62 characters, and obtain the base identification string;
[0075] The 62-bit character table includes characters 0-9, AZ, and az.
[0076] In the above embodiment, the string generation subunit combines the standard employee ID information segment, the standard project group identification information segment, and the standard project identification information segment in a predetermined order to obtain an employee identification string, and converts it into a 62-base identification string through the base conversion subunit.
[0077] In one embodiment, the string generation subunit combines the standard employee ID information segment 00031646, the standard project group identification information segment 00002473, and the standard project identification information segment 00005160 in a predetermined order to obtain the employee identification string 00031646 00002473 00005160; and converts it into the base identification string 8EQ dt 1LE through the base conversion subunit.
[0078] Embodiment 5:
[0079] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the hash string generating unit further includes:
[0080] The encoding subunit is used to obtain the enterprise name and encode it through a built-in encoder to generate a specific code identification;
[0081] The character string generation subunit is used to add a specific code identifier to the beginning of the binary identifier character string for combination to generate a preprocessed character string;
[0082] The interval marking subunit is used to obtain the ending character of a specific code identifier, match the corresponding interval identifier, add it to the preprocessing string, and generate a pre-embedded string.
[0083] In the above embodiments, the encoding sub-unit encodes the company name through a built-in encoder to generate a specific code identifier, and adds the specific code identifier to the beginning of the base identifier string through the string generation sub-unit to combine and generate a pre-processed string. The interval marking sub-unit matches the corresponding interval identifier according to the ending character of the specific code identifier, adds it to the pre-processed string, and obtains the embedded string.
[0084] In the above embodiments, the correspondence between characters and interval marks is as follows: 1!, 2@, 3#, 4$, 5%, 6^, 7&, 8*, 9(, 0).
[0085] In one embodiment, the preprocessed character string is aHzf5DZ7 8EQ dt 1LE, and the pre-embedded character string aHzf5DZ7&8EQ&dt&1LE is generated according to the interval identifier & corresponding to the end character 7 of the specific code identifier aHzf5DZ7.
[0086] The beneficial effects of the above technology are: through the encoding sub-unit, the encoding processing of the enterprise name is realized, and a specific code identifier is generated; and through the string generation sub-unit and the interval marking sub-unit, the specific code identifier is marked at the beginning of the hexadecimal identifier string, and the interval identifier is added to realize the generation of the embedded string.
[0087] Embodiment 6:
[0088] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, wherein the hash string generating unit further includes:
[0089] The hash coding subunit is used to group the pre-embedded character string according to the preset information length, obtain a number of character blocks, and fill in the character blocks when the information length is less than the preset information length; compress each character block through the compression function, calculate the hash value of each character block, and splice the character blocks according to the order to generate the hash value of the pre-embedded character string;
[0090] H i =H i-1 +F Ci (H i-1 )
[0091] Among them, Hi For the i-th character block C i The hash value obtained by hash calculation, H i-1 For the i-1th character block C i-1 The hash value obtained by hash calculation, F Ci (H i-1 ) is the compression function for the hash value H i-1 and character block C i The function value to be processed, + is the hash value H i and the function value F Ci (H i-1 ) Perform mod 2 8 Remainder operation: For the calculation of the hash value of the first character block C1, the hash value H0 is initialized for calculation.
[0092] In the above embodiments, the hash encoding subunit groups the embedded character strings according to the preset information length, obtains several character blocks, compresses each character block through a compression function, calculates the hash value of each character block, and splices them according to the order of the character blocks to generate a first embedded hash string.
[0093] In the above embodiments, when the information length of a character block is less than a preset information length, padding is performed, and the padding code may be implemented as a "1" and several "0s".
[0094] The beneficial effect of the above technology is that the hash value calculation of each character block in the pre-embedded character string is realized through the hash coding subunit, and the character blocks are spliced according to the order, thereby realizing the calculation of the hash value of the pre-embedded character string.
[0095] Embodiment 7:
[0096] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, a source code submission module, including:
[0097] The source code monitoring unit is used to trigger the hash string embedding program when it detects that an employee submits the pre-processed source code to the source code disclosure community;
[0098] The source code processing unit is used to embed the second pre-embedded hash string into the comment segment, useless logic segment and specific code segment of the pre-processed source code according to the hash string embedding program, generate the upload project source code, and upload the upload project source code to the source code public community.
[0099] In the above embodiment, when the source code monitoring unit detects that the employee submits the preprocessed source code to the source code public community, the hash string embedding program is triggered, and the second pre-embedded hash string is embedded in the comment segment, useless logic segment and specific code segment of the preprocessed source code through the source code processing unit to generate the uploaded project source code, and upload the uploaded project source code to the source code public community.
[0100] The beneficial effects of the above technology are: through the source code monitoring unit, it is possible to monitor when employees submit pre-processed source code to the source code public community, and through the source code processing unit, it is possible to embed the second pre-embedded hash string when the pre-processed source code is submitted, so that the generated uploaded project source code contains the second pre-embedded hash string, which is convenient for the system to trace source code leaks.
[0101] Embodiment 8:
[0102] The embodiment of the present invention provides a source code leakage monitoring and tracing system based on a dynamic identification hash string, and a leakage monitoring module, including:
[0103] A leakage monitoring unit is used to query the source code of the uploaded project in real time in the source code disclosure community through an application program interface, and when the uploaded project source code contains a specific code identifier, extract the hash string in the uploaded project source code;
[0104] A hash string parsing unit, used to remove specific code identifiers in the hash string, obtain a pre-processed hash string, and perform inverse hash processing on the pre-processed hash string to obtain a parsed hash string;
[0105] The hash string detection unit is used to detect the completeness of the parsed hash string and perform base conversion on the parsed hash string to obtain the original information contained in the parsed hash string.
[0106] In the above embodiments, the leakage monitoring unit queries the uploaded project source code in real time in the source code disclosure community through the application program interface. When it is found that the uploaded project source code contains a specific code identifier, the hash string in the uploaded project source code is extracted, and the specific code identifier in the hash string is removed by the hash string parsing unit. The pre-processed hash string is reverse hashed to obtain the parsed hash string. The hash string detection unit detects the completeness of the parsed hash string, and performs base conversion on the parsed hash string to obtain the original information contained in the parsed hash string.
[0107] The beneficial effect of the above technology is that: through the leakage monitoring unit, real-time query of the source code of the uploaded project in the source code disclosure community is realized, and when the uploaded project source code is found to contain a specific code identifier, the original information in the hash string is extracted through the hash string parsing unit and the hash string detection unit, thereby realizing the system's monitoring of the uploaded project source code containing the specific code identifier, and obtaining the corresponding original information through parsing processing, which is convenient for back-end supervisors to trace the responsibilities of relevant employees.
[0108] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A source code leakage monitoring and tracing system based on dynamic identification hash string, characterized in that: include: A source code monitoring module is used to generate a first pre-embedded hash string according to the employee's personal information when the employee initializes the project source code based on the code generation platform, and embed the first pre-embedded hash string into the project source code to generate a pre-processed source code; It is also used to obtain employee personal information and project operation information when the employee operates the project source code, and generate a second pre-buried hash string; A source code submission module, for monitoring when an employee uploads the pre-processed source code to a source code disclosure community, embeds the second pre-embedded hash string into the pre-processed source code through a network submission script program, generates an uploaded project source code, and uploads the uploaded project source code to the source code disclosure community; The leakage monitoring module is used to query the uploaded project source code in real time in the source code disclosure community through an application program interface. When it is found that the uploaded project source code contains a specific code identifier, the hash string in the uploaded project source code is extracted, the integrity of the hash string is verified, and the original information in the hash string is parsed and submitted to the backend supervisor.
2. According to claim 1, a source code leakage monitoring and tracing system based on dynamic identification hash string is characterized in that: The source code monitoring module includes: A hash string generating unit is used to obtain the employee work number information segment, the project group identification information segment and the project identification information segment in the employee personal information, format the employee work number information segment, the project group identification information segment and the project identification information segment, obtain a standard employee work number information segment, a standard project group identification information segment and a standard project identification information segment, combine them in a predetermined order, and obtain an employee identification string; perform base conversion on the employee identification string to obtain a base identification string; add a specific code identifier before the base identification string to generate a pre-embedded string; calculate the hash value of the pre-embedded string and combine it with a random character sequence to generate a first pre-embedded hash string; The hash string embedding unit is used to embed the first pre-embedded hash string into one or more of the comment segment, useless logic segment and specific code segment of the project source code.
3. According to claim 2, a source code leakage monitoring and tracing system based on dynamic identification hash string is characterized in that: The hash string generating unit comprises: The format processing subunit is used to set the standard information segment length and detect the information segment length of the employee ID information segment, the project group identification information segment, and the project identification information segment; The information segment whose length is greater than the standard information segment length is used as the information segment to be compressed, the occurrence frequency of each character in the information segment to be compressed is obtained, each character is constructed as a leaf node, and the occurrence frequency of the character is used as the weight of the leaf node, a coding tree is constructed, and the leaf nodes in the coding tree are compressed and coded to generate a coded information segment, so that the information segment length of the coded information segment is equal to the standard information segment length; The information segment whose length is less than the standard information segment length is used as the information segment to be filled, and invalid codes are filled into the information segment to be filled, so that the information segment length of the information segment to be filled is equal to the standard information segment length; Get the standard employee ID information segment, the standard project group identification information segment, and the standard project identification information segment.
4. According to claim 2, a source code leakage monitoring and tracing system based on dynamic identification hash string is characterized in that: The hash string generating unit further includes: A character string generating subunit, used for combining the standard employee work number information segment, the standard project group identification information segment, and the standard project identification information segment in a predetermined order to obtain an employee identification character string; The base conversion unit subunit is used to construct a base-62 character table, convert the decimal characters in the employee identification string into base-62 characters, and obtain a base-62 identification string; The 62-decimal character table includes characters 0-9, AZ and az.
5. According to claim 2, a source code leakage monitoring and tracing system based on dynamic identification hash string is characterized in that: The hash string generating unit further includes: The encoding subunit is used to obtain the enterprise name and encode it through a built-in encoder to generate a specific code identification; A character string generation subunit, used for adding the specific code identifier to the head end of the hexadecimal identifier character string for combination to generate a preprocessed character string; The spacing mark subunit is used to obtain the end character of the specific code identifier, match the corresponding spacing identifier, add it to the pre-processed string, and generate a pre-embedded string.
6. A source code leakage monitoring and tracing system based on dynamic identification hash string according to claim 2, characterized in that: The hash string generating unit further includes: A hash encoding subunit is used to group the embedded character string according to the preset information length, obtain a number of character blocks, and fill in when the information length of the character block is less than the preset information length; compress each character block through a compression function, calculate the hash value of each character block, splice according to the character block order, and generate the hash value of the embedded character string; H i =H i-1 +F Ci (H i-1 ) Among them, H i For the i-th character block C i The hash value obtained by hash calculation, H i-1 For the i-1th character block C i-1 The hash value obtained by hash calculation, F Ci (H i-1 ) is the compression function for the hash value H i-1 and character block C i The function value to be processed, + is the hash value H i and the function value F Ci (H i-1 ) Perform mod 2 8 Remainder operation: For the calculation of the hash value of the first character block C1, the hash value H0 is initialized for calculation.
7. A source code leakage monitoring and tracing system based on dynamic identification hash string according to claim 1, characterized in that: The source code submission module includes: A source code monitoring unit, used to trigger a hash string embedding program when detecting that an employee submits the pre-processed source code to a source code disclosure community; The source code processing unit is used to embed the second pre-embedded hash string into the comment segment, useless logic segment and specific code segment of the pre-processed source code according to the hash string embedding program, generate the upload project source code, and upload the upload project source code to the source code public community.
8. The source code leakage monitoring and tracing system based on dynamic identification hash string according to claim 1 is characterized in that: The leakage monitoring module comprises: A leakage monitoring unit, configured to query the uploaded project source code in real time in the source code disclosure community through an application program interface, and extract a hash string from the uploaded project source code when it is found that the uploaded project source code contains a specific code identifier; A hash string parsing unit, used to remove the specific code identifier in the hash string, obtain a pre-processed hash string, and perform inverse hash processing on the pre-processed hash string to obtain a parsed hash string; The hash string detection unit is used to detect the completeness of the parsed hash string, and perform base conversion on the parsed hash string to obtain the original information contained in the parsed hash string.