CN117150531B - Industrial computer software data encryption protection method - Google Patents

Industrial computer software data encryption protection method Download PDF

Info

Publication number
CN117150531B
CN117150531B CN202311414019.6A CN202311414019A CN117150531B CN 117150531 B CN117150531 B CN 117150531B CN 202311414019 A CN202311414019 A CN 202311414019A CN 117150531 B CN117150531 B CN 117150531B
Authority
CN
China
Prior art keywords
character
characters
frequency
coding
encoded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311414019.6A
Other languages
Chinese (zh)
Other versions
CN117150531A (en
Inventor
梁钊伟
林世丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yanchuang Technology Co ltd
Original Assignee
Shenzhen Yanchuang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yanchuang Technology Co ltd filed Critical Shenzhen Yanchuang Technology Co ltd
Priority to CN202311414019.6A priority Critical patent/CN117150531B/en
Publication of CN117150531A publication Critical patent/CN117150531A/en
Application granted granted Critical
Publication of CN117150531B publication Critical patent/CN117150531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention relates to the technical field of data encryption, in particular to an industrial computer software data encryption protection method. According to the form rule and the position distribution of the characters, the invention obtains a merging character set of the software data to be encrypted; in the arithmetic coding process, when the character to be coded does not belong to the combined character set, updating the coding interval according to the character frequency, when the character to be coded belongs to the combined character set, taking the combined character set as the character set to be coded, selecting the coding interval according to the frequency of the characters in the character set to be coded, and obtaining the adjustment frequency of the characters according to the frequency of the characters in the unencoded characters to update the coding interval; the coding result is obtained through arithmetic coding and is used as an encrypted ciphertext, and a character initial frequency table, a coding sequence dictionary and a character group coding sequence in the coding process are used as keys. The invention improves the confidentiality of the process of updating the coding section in the arithmetic coding process through analyzing the character combination, so that the final data encryption effect is better.

Description

Industrial computer software data encryption protection method
Technical Field
The invention relates to the technical field of data encryption, in particular to an industrial computer software data encryption protection method.
Background
With the continuous development of industrial automation, industrial computers are increasingly used for controlling and monitoring various automation devices in the industrial field, and the automation control and monitoring generally needs to transmit monitored data to control computer software and then perform corresponding analysis. Industrial computer software data, such as monitoring data in a production process or running state data of equipment indexes, is particularly important to protect enterprise interests and ensure stability of the production process, so that encryption protection of the data in the industrial computer software is required.
Because the data stored in industrial computer software is often data monitored by production, the format of the data is relatively fixed, and a large number of repeated characters are contained in the data, an arithmetic coding algorithm is often used for coding and encrypting the data in the data compression and encryption process, but when the data is coded and encrypted in the prior art, a large amount of fixed data with regular change is not considered in the collected parameter data of the software data, so that regular coding interval update exists in the arithmetic coding of some character combinations, the risk of cracking the coding interval is larger, and the data encryption effect is poor.
Disclosure of Invention
In order to solve the technical problems of larger risk of cracking the coding section and poorer data encryption effect in the prior art, the invention aims to provide an industrial computer software data encryption protection method, which adopts the following specific technical scheme:
the invention provides an industrial computer software data encryption protection method, which comprises the following steps:
acquiring software data to be encrypted in industrial computer software; obtaining a merging character set in the software data to be encrypted according to the form rule of characters in the software data to be encrypted and the position distribution of the characters;
in the process of carrying out arithmetic coding on software data to be encrypted, taking characters of a coding interval to be selected as characters to be coded; if the character to be encoded is not the character in the combined character set, updating the encoding interval according to the frequency of the character to be encoded; if the character to be encoded is a character in the combined character set, taking the combined character set corresponding to the character to be encoded as the character set to be encoded; selecting an encoding interval of the character set to be encoded according to the frequency of each character in the character set to be encoded; according to the frequency of each character in the character group to be encoded in the unencoded character, obtaining the adjustment frequency of each character in the character group to be encoded; updating the selected coding interval according to the adjustment frequency of each character in the character group to be coded;
after updating the coding interval each time, determining new characters to be coded, stopping coding until no unencoded characters exist, and obtaining a coding result of the software data to be encrypted; obtaining a coding sequence dictionary of the software data to be encrypted according to the sequence condition that each character to be coded is a merging character group; obtaining character group coding sequences according to the coding sequence and the adjustment frequency of all character groups to be coded;
taking the coding result as an encryption ciphertext of the software data to be encrypted; and taking the character initial frequency table, the coding sequence dictionary and the character group coding sequence corresponding to the software data to be encrypted as keys of the software data to be encrypted.
Further, the method for acquiring the merging character set comprises the following steps:
according to the form rule of characters in the software data to be encrypted, a fixed character group is obtained through data mining; the fixed character group comprises at least two characters;
for any fixed character group, taking the first character and the last character in the fixed character group as characteristic characters; taking other characters except the characteristic characters in the fixed character group as allocation characters; taking the characters outside the fixed character group as standard characters;
when each feature character has adjacent standard characters, combining each feature character with adjacent preset adjacent number of standard characters according to a preset combination rule to obtain a feature character group; if the number of the standard characters corresponding to the adjacent characteristic characters is smaller than the preset adjacent number, combining the characteristic characters with all the standard characters corresponding to the adjacent characteristic characters according to a preset combining rule to obtain a characteristic character group; the preset adjacent number is greater than 0;
when the number of the allocation characters in the fixed character group is larger than 1, dividing all the allocation characters into at least one allocation character group according to the arrangement sequence of the allocation characters in the software data to be encrypted;
and taking all the characteristic character groups and all the distribution character groups as merging character groups in the software data to be encrypted.
Further, the selecting the coding section of the character set to be coded according to the frequency of each character in the character set to be coded includes:
taking the occurrence frequency of each type of character in the character group to be encoded in the software data to be encrypted as character frequency, and taking the character corresponding to the maximum character frequency in the character group to be encoded as a selection character;
and taking the coding interval corresponding to the selected character as the coding interval selected by the character group to be coded.
Further, the obtaining the adjustment frequency of each character in the character set to be encoded according to the frequency of each character in the character set to be encoded in the unencoded character comprises:
taking the accumulated value of the character frequency of each type of character in the character group to be encoded as the character frequency and value;
counting the frequency of each type of character in the character group to be coded in all unencoded characters, and taking the frequency as the residual frequency; taking the accumulated value of the residual frequency of each type of character in the character group to be encoded as the residual frequency sum value;
taking the ratio of the residual frequency to the sum of the residual frequency and the value of each type of characters in the character group to be encoded as the adjustment weight of each type of characters in the character group to be encoded;
and taking the product of the adjustment weight of each type of character in the character group to be encoded and the character frequency and the value as the adjustment frequency of each type of character in the character group to be encoded.
Further, the updating the selected coding section according to the adjustment frequency of each character in the character group to be coded includes:
and dividing the coding interval selected by the character group to be coded according to the adjustment frequency of each character in the character group to be coded and the character frequency of other characters outside the character group to be coded, and obtaining the updated coding interval of each character.
Further, the method for acquiring the coding sequence dictionary comprises the following steps:
when the character to be encoded is not the character in the combined character set, recording a preset first encoding value in a preset initial dictionary; when the character to be coded is a character in the combined character set, recording a preset second coding value in a preset initial dictionary; and obtaining the coding sequence dictionary until the coding is stopped.
Further, the method for acquiring the character set code sequence comprises the following steps:
in the process of arithmetic coding, a character set of each merging character set is obtained; the character set of each merging character set comprises a corresponding merging character set and an adjusting frequency of each character in the merging character set;
and sequencing the character group set of each combined character group according to the coding sequence to obtain a character group coding sequence.
Further, the method for acquiring the character initial frequency table comprises the following steps:
and forming a table by each type of characters in the software data to be encrypted and the occurrence frequency corresponding to the characters, and obtaining a character initial frequency table.
Further, the updating the coding section according to the frequency of the character to be coded includes:
selecting an encoding interval corresponding to the character to be encoded as an encoding interval to be updated, and taking the character to be encoded as an encoded character;
dividing the coding interval to be updated of the coded characters at the moment according to the occurrence frequency of all characters in the software data to be encrypted, and obtaining updated coding intervals corresponding to each type of characters.
Further, the preset merging rule is to splice the characteristic characters and the standard characters into character strings according to the arrangement sequence in the software data to be encrypted.
The invention has the following beneficial effects:
according to the method, more regular character groups exist in the software data to be encrypted, the character groups are split and recombined according to the form rule and the position distribution of the characters, the combined character groups of the software data to be encrypted are obtained, in the process of arithmetic coding of the software data to be encrypted, the selection and updating steps of the coding section are optimized according to whether the characters to be coded are characters in the combined character groups or not, the coding section is updated according to the frequency only for the characters to be coded which do not belong to the combined character groups, the corresponding combined character groups are used as the character groups to be coded, the whole character groups to be coded are coded, the coding section is selected according to the frequency of the characters in the character groups to be coded, hidden coding is carried out on the combined character groups, so that the data encryption effect is stronger, the adjusting frequency of each character is obtained according to the frequency of the characters in the character groups to be coded in the code character characters not to be coded, the regularity of the updating coding section is further disturbed by adjusting the frequency updating coding section, and the confidentiality of the updating coding section in the arithmetic coding process is stronger. The coding result is obtained through arithmetic coding, and the coding sequence dictionary and the character group coding sequence are obtained in the coding process, so that decoding can be carried out according to the coding result, the final coding result is used as an encrypted ciphertext, the character initial frequency table, the coding sequence dictionary and the character group coding sequence are used as keys, and the confidentiality of the process of updating the coding interval in the arithmetic coding process is improved through analysis of character combination, so that the final data encryption effect is better.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an industrial computer software data encryption protection method according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following detailed description refers to the specific implementation, structure, characteristics and effects of an industrial computer software data encryption protection method according to the invention with reference to the attached drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the industrial computer software data encryption protection method provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of an industrial computer software data encryption protection method according to an embodiment of the invention is shown, and the method includes the following steps:
s1: acquiring software data to be encrypted in industrial computer software; and obtaining the merging character group in the software data to be encrypted according to the form rule of the characters in the software data to be encrypted and the position distribution of the characters.
In the encryption process of industrial computer software data, the arithmetic coding can realize the encryption of the data by hiding the character coding section corresponding to the original data, and meanwhile, the coding compression of the data can be completed, so that the data can be safely stored in an industrial computer.
Firstly, the data of the software to be encrypted needs to be acquired, in the embodiment of the invention, the data of the operation or production process in the industrial monitoring system of the industrial computer mainly comes from the operation or production parameters of equipment, and the general industrial control often has a programmable logic controller (Programmable Logic Controller, PLC), so the PLC can be directly connected for reading the operation or production parameters, the read data is stored in the industrial computer software, and the data which is required to be encrypted and stored in the industrial computer software is used as the data of the software to be encrypted, namely the industrial monitoring data is the data of the software to be encrypted. The form of the software data to be encrypted is composed of a parameter name and an actual parameter, for example, the software data to be encrypted is: time: 17:30, temperature: 30 ℃, humidity: 35% rh, light: 50lux, rotation speed: 20r/min, time: 16:30, temperature: 31 ℃, humidity: 32% rh, light: 60lux, rotation speed: 20r/min, wherein the parameter name is: time, temperature, humidity, illumination, rotation speed, actual parameters are: 17:30 30 ℃,35%rh,50lux,20r/min, etc.
In the software data to be encrypted, there are relatively fixed character sets, such as temperature, pH value, time and the like, and the fixed character sets will expose updating of the coding interval corresponding to the arithmetic coding, so the embodiment of the invention needs to redistribute the fixed character sets, and the fixed character sets are obtained through data mining according to the form rule of the characters in the software data to be encrypted. In the embodiment of the invention, the regular expression matching algorithm is adopted to perform data mining, the input is software data to be encrypted and a fixed data format, the output is a fixed character group conforming to character combination, and it is to be noted that the regular expression matching algorithm is a well-known technical means known to those skilled in the art, and details are not repeated here. In other embodiments of the present invention, a natural language processing manner, for example, a word bag model, an n-gram model, etc. may be selected to analyze the rules of characters, so that the fixed character set is screened out, and therefore, the screening of the fixed character set is not limited, and it should be noted that the natural language processing manner, for example, the word bag model, the n-gram model, etc. is a technical means well known to those skilled in the art, and will not be described herein.
In order to ensure the integrity and accuracy of data in industrial production, the parameter name of a single character is not used for representing the parameter, so that the characters in the fixed character group at least comprise two characters, namely, the parameter names are more than two characters. Because the fixed character sets bring about more regular updating of the coding region, the fixed character sets are split and recombined to obtain the combined character sets, and arithmetic coding is carried out through the combined character sets so as to destroy the updating rule of the coding region.
Preferably, for any one fixed character group, the first character and the last character in the fixed character group are taken as characteristic characters, other characters except the characteristic characters in the fixed character group are taken as allocation characters, the characters except the fixed character group are taken as standard characters, the fixed character group is split according to the positions of the characters, for example, for a string of characters shabs, wherein abs is the fixed character group, a and s are characteristic characters in the fixed character group, b is the allocation characters, and sh and ds on two sides of the abs fixed character group are standard characters.
If each feature character has adjacent standard characters, combining each feature character with adjacent preset adjacent number of standard characters according to a preset combination rule to obtain a feature character set, wherein the preset adjacent number is greater than 0, in the embodiment of the invention, the preset combination rule is to splice characters into character strings according to the arrangement sequence in the software data to be encrypted, the preset adjacent number is 1, an implementer can adjust according to specific implementation conditions, and by recombining the fixed character set with the adjacent characters at the position of the fixed character set, the regularity of the fixed character set is disturbed, for example, for the above example, shabs, wherein abs is the fixed character set, each of feature characters a and s has adjacent standard characters h and d, therefore, the feature character set is ha and sd, for some fixed character sets without adjacent standard characters, such as character strings abcd, wherein ab is the fixed character set, at the moment, feature character a does not have adjacent standard characters, a does not participate in combination, is analyzed separately as other uncombined characters, and feature character b has adjacent standard character c as a feature set.
Specifically, in other embodiments of the present invention, if the preset number of neighbors is selected to be larger, so that the number of standard characters corresponding to the neighboring feature characters is smaller than the preset number of neighbors, at this time, the feature characters and all standard characters corresponding to the neighboring feature characters are combined according to a preset combining rule to obtain a feature character set, for example, for the character string shabsdsc, abs is a fixed character set, at this time, feature characters a and s both have neighboring standard characters, when the preset number of neighbors is 3, feature character a corresponds to the neighboring standard characters only to sh and is smaller than the preset number of neighbors, so that sha is only used as one feature character set, and for the feature character s, the formed feature character set is sps.
Further, the allocation characters in the fixed character group are regrouped, preferably, when the number of the allocation characters in the fixed character group is larger than 1, all the allocation characters are divided into at least one allocation character group according to the arrangement sequence of the characters in the software data to be encrypted, and the number of the characters in each allocation character group is larger than 1. Since the encryption is performed on a per-character basis when the number of the allocated characters is not present or 1, analysis is not considered for merging packets, and only when a plurality of allocated characters are present, the allocated characters are divided to obtain more than one allocated character group, and the allocated character group cannot be divided into a single character as one allocated character group.
For example, for the string shapsdscfgm, when abdscfg is a fixed set of characters, the allocation character is bsdscfg, and bsd and scf are the allocation set of characters according to the partitioning. For the string abcdefgh, when bcdefg is a fixed character set, the assignment character is cdef, and cde is an assignment character set. For the string abcfndach, when bcfndac is a fixed character set, the assignment characters cfnda, cfn and da are assignment character sets.
And taking all the characteristic character groups and all the distribution character groups as merging character groups of the software data to be encrypted. All the allocated character groups of all the characteristic character combinations are in the form of splitting fixed character groups, and the character groups obtained again according to the positions of the characters can be further subjected to arithmetic coding, so that the updating reliability of the coding interval is improved.
S2: in the process of carrying out arithmetic coding on software data to be encrypted, taking characters of a coding interval to be selected as characters to be coded; if the character to be encoded is not the character in the combined character set, updating the encoding interval according to the frequency of the character to be encoded; if the character to be encoded is a character in the combined character set, taking the combined character set corresponding to the character to be encoded as the character set to be encoded; selecting an encoding interval of the character set to be encoded according to the frequency of each character in the character set to be encoded; according to the frequency of each character in the character group to be encoded in the unencoded character, obtaining the adjustment frequency of each character in the character group to be encoded; and updating the selected coding interval according to the adjustment frequency of each character in the character group to be coded.
In the arithmetic coding process, according to the combination condition of the merging character groups, carrying out hidden coding on the merging character groups, and disturbing the updating of a coding interval according to the updating frequency of the merging character groups, firstly determining the position for adjusting and optimizing in the arithmetic coding process, wherein the main process of the arithmetic coding comprises the following steps: initializing a coding section, circularly inputting characters, mapping character frequencies, selecting the coding section, updating the coding section and finally outputting a coding result. The position to be optimized is the position of the coding interval to be selected in the arithmetic coding process, so that each character to be selected in the coding interval is taken as the character to be coded. It should be noted that, the encoding process of arithmetic encoding is a technical means well known to those skilled in the art, only the selected encoding interval and the updated encoding interval are optimized, and other encoding processes are not repeated.
Firstly, if the character to be encoded is not a character in the merging character set, that is, the character to be encoded is a single character, the encoding section can be selected and updated according to the frequency of the character to be encoded, the process of selecting and updating the encoding section is a normal process of encoding by using arithmetic encoding. And taking the occurrence frequency of each type of character in the software data to be encrypted as character frequency, and dividing the coding interval to be updated of the coded characters at the moment according to the character frequency of all the characters in the software data to be encrypted to obtain updated coding intervals corresponding to each type of characters. It should be noted that, the process of dividing the coding section to be updated according to the character frequency to obtain the updated coding section is a process in arithmetic coding, which is a technical means well known to those skilled in the art, and will not be described herein.
For example, for the character string aababcababab, the character frequency of a is 0.5, the character frequency of b is 0.4, the character frequency of c is 0.1, the initial coding interval is a: [0,0.5 ], b: [0.5,0.9 ], c: [0.9,1), each coding interval is a coding interval of corresponding characters obtained by corresponding character frequency, and a: [0, 0.5) is represented as a corresponding character of interval [0, 0.5). Taking a character in the character string as a character to be encoded in turn, taking a first character a in a selected encoding interval as an example, taking a as the character to be encoded, wherein the encoding interval corresponding to the character a to be encoded is a: [0,0.5 ], the encoding interval to be updated is [0,0.5 ], the first character a is an encoded character, and dividing the encoding interval to be updated according to the character frequencies of a, b and c to obtain an updated encoding interval corresponding to each character as a: [0,0.25 ], b: [0.25,0.45) and c: [0.45,0.5).
After each updating coding interval, the next uncoded data is required to be continuously coded, the next character of the coded character is used as a new character to be coded to be selected and coded, the new character to be coded is also the character needing to be selected for the coding interval, if the character to be coded is the character in the combined character set, the selection and updating process of the combined character set is optimized, the combined character set corresponding to the character to be coded is firstly used as the character set to be coded, and the character set to be coded is analyzed.
Firstly, according to the frequency of each character in the character group to be encoded, selecting an encoding interval of the character group to be encoded, preferably, taking the occurrence frequency of each type of character in the character group to be encoded in the software data to be encrypted as the character frequency, taking the character corresponding to the maximum character frequency in the character group to be encoded as the selection character, and taking the encoding interval corresponding to the selection character as the encoding interval selected by the character group to be encoded, namely the encoding interval to be updated. Partial codes are hidden by encoding the merging character sets together, so that the concealment of the encoding process is improved, and meanwhile, a high-frequency encoding section is selected, so that the compression efficiency of the encoding is ensured.
For example, for the character string aababcababab, the character frequency of a is 0.5, the character frequency of b is 0.4, the character frequency of c is 0.1, the initial coding interval is a: [0,0.5 ], b: [0.5,0.9 ], c: [0.9,1 ], the character of the coding interval is selected to be the first character a, when a belongs to the character in the merging character set aab, the merging character set aab is the character set to be coded, wherein the character with the largest character frequency is a, a is the selected character of the character set to be coded, and the coding interval to be updated corresponding to the selected character is a: [0, 0.5).
Further, after the character set to be encoded selects the encoding section, the character set to be encoded can be regarded as a character set which completes encoding, and some merging character sets may still have a certain regularity in the process of splitting and recombining. In order to further destroy the regularity of the updated coding region and improve the hiding of the character group, the character frequency is adjusted to divide the coding region to be updated when the coding region selected by the character group to be encoded, namely the coding region to be updated, is updated.
When the coding section is updated, the arithmetic coding is divided according to the frequency of each type of character, so that the adjustment frequency of each character in the character group to be coded is obtained according to the frequency of each type of character in the character group to be coded in the non-coded character, and the character frequency is adjusted to obtain the division of different coding sections. The unencoded characters are characters which do not select an encoding section, namely characters to be encoded or all characters after a character group to be encoded.
Preferably, the occurrence frequency of each type of character in the character set to be encoded in the software data to be encrypted is used as a character frequency, the accumulated value of the character frequencies of all characters in the character set to be encoded is used as a character frequency and a value, the character frequency and the value are obtained according to the initial character frequency of each type of character in the character set to be encoded, and the character frequency of each type of character can be reassigned through the character frequency and the value.
And counting the frequency of each type of character in the character group to be encoded in all the unencoded characters, taking the frequency as the residual frequency, and taking the accumulated value of the residual frequency of all the characters in the character group to be encoded as the sum value of the residual frequency. According to the occurrence times of each type of characters in the residual non-coding data, the character frequency is adjusted, the ratio of the residual frequency to the sum value of the residual frequency of each type of characters in the character group to be coded is used as the adjustment weight of each type of characters in the character group to be coded, and the important duty ratio degree of each type of characters in the subsequent coding is reflected through the adjustment weight.
And taking the product of the adjustment weight of each type of character in the character group to be encoded and the character frequency and the value as the adjustment frequency of each type of character in the character group to be encoded. In the embodiment of the invention, the specific expression of the adjusting frequency is:
in the method, in the process of the invention,expressed as +.f in the character set to be encoded>Frequency of adjustment of class character,/>Character frequency and value expressed as character set to be encoded, < +.>Expressed as +.f in the character set to be encoded>Residual frequency of class character, < >>Expressed as the total number of character categories in the character set to be encoded.
Wherein,the remaining frequency and value expressed as the character set to be encoded, < >>Expressed as +.f in the character set to be encoded>The more frequently a character is in an unencoded character, the more frequently the character is reassigned, as the weight of the class character is adjusted.
After the adjustment frequency of the characters is obtained, updating the selected coding interval according to the adjustment frequency of each type of characters in the character group to be coded, and in the embodiment of the invention, dividing the coding interval selected by the character group to be coded according to the adjustment frequency of each type of characters in the character group to be coded and the character frequencies of other characters outside the character group to be coded, thereby obtaining the updated coding interval. For example, for the above character string aababcababab, the character set to be encoded is aab, the selected encoding interval is a: [0, 0.5), the character types in the character set to be encoded are a and b, because the subsequent adjustment weights of the two characters are 0.5, the adjustment frequencies of the characters a and b are 0.45 and 0.45, so that the corresponding frequencies of all the characters a are 0.45, b is 0.45, and c is 0.1, and after the encoding interval a: [0, 0.5) is divided, the updated encoding interval of each type of characters is: a: [0,0.225), b: [0.225,0.45), c: [0.45,0.5).
So far, the process of updating the coding interval is optimized in the process of completing arithmetic coding.
S3: after updating the coding interval each time, determining new characters to be coded, stopping coding until no unencoded characters exist, and obtaining a coding result of the software data to be encrypted; obtaining a coding sequence dictionary of the software data to be encrypted according to the sequence condition that each character to be coded is a merging character group; and obtaining character group coding sequences according to the coding sequence and the adjustment frequency of all character groups to be coded.
In the process of carrying out arithmetic coding on software data to be encrypted, after each time of updating a coding section, a character to be coded or the next character of a character group to be coded is used as a new coding character, the coding section is continuously updated until coding is completed, a final coding section is obtained, one coding value in the coding section is randomly selected in the arithmetic coding as a coding result, and the specific coding result is obtained as a step in the arithmetic coding process, which is a technical means well known to a person skilled in the art and is not described herein.
Since the process of selecting and updating the coding section in arithmetic coding is optimized, the decoding process cannot be completed only according to the initial frequency table of all characters, and in order to ensure the decoding to be smooth, a coding sequence dictionary and a character group coding sequence are also required. The coding sequence dictionary reflects whether characters are coded as individual characters or as character groups at the time of coding, the character group coding sequence reflects the sequence of character group coding, and the adjustment frequency of performing optimal division.
According to the sequence condition that each character to be encoded is a merging character group, an encoding sequence dictionary of software data to be encrypted is obtained, in the embodiment of the invention, when the character to be encoded is not a character in the merging character group, a preset first encoding value is recorded in a preset initial dictionary, when the character to be encoded is a character in the merging character group, a preset second encoding value is recorded in the preset initial dictionary until encoding is stopped, the encoding sequence dictionary is obtained, the preset initial dictionary is a blank dictionary and is used for recording encoding values, the preset first encoding value is 0, the preset second encoding value is 1, the sequence of single character encoding and character group encoding is mainly recorded, and a specific numerical value implementation can be adjusted automatically.
According to the coding sequence and the adjustment frequency of all the character groups to be coded, a character group coding sequence is obtained, and in the arithmetic coding process of the embodiment of the invention, a character group set of each merging character group is obtained, wherein the character group set of each merging character group comprises a corresponding merging character group and the adjustment frequency of each character in the merging character group. For example, according to the above example, the character set corresponding to the merging character set aab is { aab, a,0.45, b,0.45}. And sequencing the character group set of each combined character group according to the coding sequence to obtain a character group coding sequence.
S4: taking the coding result as an encryption ciphertext of the software data to be encrypted; and taking the character initial frequency table, the coding sequence dictionary and the character group coding sequence corresponding to the software data to be encrypted as keys of the software data to be encrypted.
And finally, taking the coding result obtained in the step S3 as an encrypted ciphertext, and after coding the combined character set in arithmetic coding, enabling the original fixed character set to be disordered and hidden, thereby improving the safety of the ciphertext. In order to ensure that the encrypted ciphertext can be decrypted, a character initial frequency table, a coding sequence dictionary and a character group coding sequence corresponding to the software data to be encrypted are used as keys of the software data to be encrypted, so that the encryption protection of the industrial computer software data is completed. In the embodiment of the invention, the character initial frequency table is a table formed by each type of characters in the software data to be encrypted and the occurrence frequency corresponding to the characters.
In the embodiment of the invention, the encrypted ciphertext can be stored in a data analysis system of industrial computer software, and the secret key can be directly stored in an external memory, wherein the external memory comprises a U disk, a hard disk, a floppy disk and the like, and the method is not limited.
In summary, the invention considers that more fixed character groups with rules exist in the software data to be encrypted, splits and reorganizes the fixed character groups according to the form rules and the position distribution of characters to obtain the merged character groups of the software data to be encrypted, optimizes the selecting and updating steps of the coding interval according to whether the characters to be coded are characters in the merged character groups or not in the process of carrying out arithmetic coding on the software data to be encrypted, only updates the coding interval according to the frequency on the characters to be coded which do not belong to the merged character groups, takes the corresponding merged character groups as the character groups to be coded, selects the coding interval according to the frequency of the characters in the character groups to be coded, carries out hidden coding on the merged character groups, obtains the adjusting frequency of each character according to the frequency of the characters in the character groups to be coded in the non-coded characters, and further breaks up the regularity of updating the coding interval through adjusting the frequency, so that the confidentiality of the arithmetic coding process is higher. The coding result is obtained through arithmetic coding, the coding sequence dictionary and the character group coding sequence are obtained together, decoding can be carried out according to the coding result, the final coding result is used as a ciphertext, the character initial frequency table, the coding sequence dictionary and the character group coding sequence are used as keys, and confidentiality of a coding interval updating process is improved through analysis of character combinations, so that the final data encryption effect is better.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.

Claims (10)

1. An industrial computer software data encryption protection method, which is characterized by comprising the following steps:
acquiring software data to be encrypted in industrial computer software; obtaining a merging character set in the software data to be encrypted according to the form rule of characters in the software data to be encrypted and the position distribution of the characters;
in the process of carrying out arithmetic coding on software data to be encrypted, taking characters of a coding interval to be selected as characters to be coded; if the character to be encoded is not the character in the combined character set, updating the encoding interval according to the frequency of the character to be encoded; if the character to be encoded is a character in the combined character set, taking the combined character set corresponding to the character to be encoded as the character set to be encoded; selecting an encoding interval of the character set to be encoded according to the frequency of each character in the character set to be encoded; according to the frequency of each character in the character group to be encoded in the unencoded character, obtaining the adjustment frequency of each character in the character group to be encoded; updating the selected coding interval according to the adjustment frequency of each character in the character group to be coded;
after updating the coding interval each time, determining new characters to be coded, stopping coding until no unencoded characters exist, and obtaining a coding result of the software data to be encrypted; obtaining a coding sequence dictionary of the software data to be encrypted according to the sequence condition that each character to be coded is a merging character group; obtaining character group coding sequences according to the coding sequence and the adjustment frequency of all character groups to be coded;
taking the coding result as an encryption ciphertext of the software data to be encrypted; and taking the character initial frequency table, the coding sequence dictionary and the character group coding sequence corresponding to the software data to be encrypted as keys of the software data to be encrypted.
2. The method for encrypting and protecting industrial computer software data according to claim 1, wherein the method for acquiring the merging character set comprises the following steps:
according to the form rule of characters in the software data to be encrypted, a fixed character group is obtained through data mining; the fixed character group comprises at least two characters;
for any fixed character group, taking the first character and the last character in the fixed character group as characteristic characters; taking other characters except the characteristic characters in the fixed character group as allocation characters; taking the characters outside the fixed character group as standard characters;
when each feature character has adjacent standard characters, combining each feature character with adjacent preset adjacent number of standard characters according to a preset combination rule to obtain a feature character group; if the number of the standard characters corresponding to the adjacent characteristic characters is smaller than the preset adjacent number, combining the characteristic characters with all the standard characters corresponding to the adjacent characteristic characters according to a preset combining rule to obtain a characteristic character group; the preset adjacent number is greater than 0;
when the number of the allocation characters in the fixed character group is larger than 1, dividing all the allocation characters into at least one allocation character group according to the arrangement sequence of the allocation characters in the software data to be encrypted;
and taking all the characteristic character groups and all the distribution character groups as merging character groups in the software data to be encrypted.
3. The method for encrypting and protecting industrial computer software data according to claim 1, wherein the selecting the coding section of the character set to be coded according to the frequency of each character in the character set to be coded comprises:
taking the occurrence frequency of each type of character in the character group to be encoded in the software data to be encrypted as character frequency, and taking the character corresponding to the maximum character frequency in the character group to be encoded as a selection character;
and taking the coding interval corresponding to the selected character as the coding interval selected by the character group to be coded.
4. The method for encrypting and protecting industrial computer software data according to claim 3, wherein said obtaining the adjustment frequency of each character in the character set to be encoded according to the frequency of each character in the character set to be encoded in the unencoded character comprises:
taking the accumulated value of the character frequency of each type of character in the character group to be encoded as the character frequency and value;
counting the frequency of each type of character in the character group to be coded in all unencoded characters, and taking the frequency as the residual frequency; taking the accumulated value of the residual frequency of each type of character in the character group to be encoded as the residual frequency sum value;
taking the ratio of the residual frequency to the sum of the residual frequency and the value of each type of characters in the character group to be encoded as the adjustment weight of each type of characters in the character group to be encoded;
and taking the product of the adjustment weight of each type of character in the character group to be encoded and the character frequency and the value as the adjustment frequency of each type of character in the character group to be encoded.
5. The method for encrypting and protecting industrial computer software data according to claim 3, wherein updating the selected coding interval according to the adjustment frequency of each character in the character set to be coded comprises:
and dividing the coding interval selected by the character group to be coded according to the adjustment frequency of each type of character in the character group to be coded and the character frequency of other characters outside the character group to be coded, and obtaining the updated coding interval of each type of character.
6. The method for encrypting and protecting industrial computer software data according to claim 1, wherein the method for acquiring the coding sequence dictionary comprises the following steps:
when the character to be encoded is not the character in the combined character set, recording a preset first encoding value in a preset initial dictionary; when the character to be coded is a character in the combined character set, recording a preset second coding value in a preset initial dictionary; and obtaining the coding sequence dictionary until the coding is stopped.
7. The method for encrypting and protecting industrial computer software data according to claim 1, wherein the method for acquiring the character set code sequence comprises the following steps:
in the process of arithmetic coding, a character set of each merging character set is obtained; the character set of each merging character set comprises a corresponding merging character set and an adjusting frequency of each character in the merging character set;
and sequencing the character group set of each combined character group according to the coding sequence to obtain a character group coding sequence.
8. The method for encrypting and protecting industrial computer software data according to claim 1, wherein the method for acquiring the character initial frequency table comprises the following steps:
and forming a table by each type of characters in the software data to be encrypted and the occurrence frequency corresponding to the characters, and obtaining a character initial frequency table.
9. The method for encrypting and protecting industrial computer software data according to claim 1, wherein updating the coding section according to the frequency of the character to be coded comprises:
selecting an encoding interval corresponding to the character to be encoded as an encoding interval to be updated, and taking the character to be encoded as an encoded character;
dividing the coding interval to be updated of the coded characters at the moment according to the occurrence frequency of all characters in the software data to be encrypted, and obtaining updated coding intervals corresponding to each type of characters.
10. The method for encrypting and protecting industrial computer software data according to claim 2, wherein the preset merging rule is to splice characteristic characters and standard characters into character strings according to the arrangement sequence in the software data to be encrypted.
CN202311414019.6A 2023-10-30 2023-10-30 Industrial computer software data encryption protection method Active CN117150531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311414019.6A CN117150531B (en) 2023-10-30 2023-10-30 Industrial computer software data encryption protection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311414019.6A CN117150531B (en) 2023-10-30 2023-10-30 Industrial computer software data encryption protection method

Publications (2)

Publication Number Publication Date
CN117150531A CN117150531A (en) 2023-12-01
CN117150531B true CN117150531B (en) 2023-12-26

Family

ID=88899098

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311414019.6A Active CN117150531B (en) 2023-10-30 2023-10-30 Industrial computer software data encryption protection method

Country Status (1)

Country Link
CN (1) CN117150531B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617814A (en) * 2022-11-11 2023-01-17 浙江斯奈普科技有限公司 Intelligent management method for ballistic calculation data
CN116663069A (en) * 2023-08-01 2023-08-29 国家基础地理信息中心 Database security encryption method and system based on data coding
CN116827351A (en) * 2023-08-31 2023-09-29 浙江中骏石墨烯科技有限公司 Intelligent monitoring system for temperature of graphene heating wall surface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617814A (en) * 2022-11-11 2023-01-17 浙江斯奈普科技有限公司 Intelligent management method for ballistic calculation data
CN116663069A (en) * 2023-08-01 2023-08-29 国家基础地理信息中心 Database security encryption method and system based on data coding
CN116827351A (en) * 2023-08-31 2023-09-29 浙江中骏石墨烯科技有限公司 Intelligent monitoring system for temperature of graphene heating wall surface

Also Published As

Publication number Publication date
CN117150531A (en) 2023-12-01

Similar Documents

Publication Publication Date Title
JP3989745B2 (en) Encoding method and apparatus using prefix prediction
US7346160B2 (en) Randomization-based encryption apparatus and method
CN110771161A (en) Digital perspective method
CN116595568B (en) Private data encryption method based on blockchain
CN100488056C (en) Method for lossless data compression using greedy sequential context-dependent grammar transform
CN104756156A (en) Compressing data representing computer animated hair
CN117150531B (en) Industrial computer software data encryption protection method
WO2017056073A1 (en) Method and system for compressing and/or encrypting data files
KR100537523B1 (en) Apparatus for encoding DNA sequence and method of the same
US6748520B1 (en) System and method for compressing and decompressing a binary code image
JPH0651943A (en) Decoding circuit for variable length code
CN113035278B (en) TPBWT-based sliding window compression method based on self-indexing structure
JP2017216644A (en) Data compression program, data compression method, data compression device, data restoration program, data restoration method, and data restoration device
CN110957003B (en) Efficient gene comparison method for protecting user privacy
CN115292739B (en) Data management method of metal mold design system
CN113946610B (en) Blockchain data supervision system and method
KR20160106229A (en) IMPROVED HUFFMAN CODING METHOD AND APPARATUS THEREOF BY CREATING CONTEXT-BASED INNER-BLOCK AND GROUP BASED ON VARIANCE IN GROUP&#39;s SYMBOL FREQUENCY DATA
CN113407558A (en) Transaction data updating method, storage medium and system based on block chain world state
Li et al. Database watermarking algorithm based on decision tree shift correction
Nandi et al. Comparative study and analysis of adaptive region based Huffman compression techniques
CN103973311B (en) A kind of quick braiding decoding algorithm that son is described to elongated binaryzation
CN109698704B (en) Comparative gene sequencing data decompression method, system and computer readable medium
CN112511171B (en) Compressed data decoding method, device and equipment and readable storage medium
CN115374462B (en) Storage management system based on financial service data
CN115879137B (en) Data encryption-based supervision project information management system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant