CN115001659A - Webpage data encryption method, device, equipment and storage medium - Google Patents
Webpage data encryption method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115001659A CN115001659A CN202210512532.8A CN202210512532A CN115001659A CN 115001659 A CN115001659 A CN 115001659A CN 202210512532 A CN202210512532 A CN 202210512532A CN 115001659 A CN115001659 A CN 115001659A
- Authority
- CN
- China
- Prior art keywords
- data
- encrypted
- character
- webpage
- conversion
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Power Engineering (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Storage Device Security (AREA)
Abstract
The invention relates to the field of network security, and discloses a method, a device, equipment and a storage medium for encrypting webpage data. The method comprises the following steps: acquiring data to be encrypted of a webpage, and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted; carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data; numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained; and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain encrypted data of the webpage. The method and the device improve the safety of the webpage related data.
Description
Technical Field
The present invention relates to the field of network security, and in particular, to a method, an apparatus, a device, and a storage medium for encrypting web page data.
Background
Most of the current web application and website development are based on web technology, and a client automatically downloads and runs a JavaScript script when using a browser. Since JavaScript is an transliteration scripting language, in the process of transmitting relevant data in a browser, data transmission is mainly carried out by plaintext, sensitive data are very unsafe, and the safe transmission and use of the data can be guaranteed only by relevant encryption processing aiming at the sensitive or important data; in addition, for various webpage systems which are deployed at present, data encryption and decryption functions are added to the webpage systems, and related codes need to be modified, even the systems need to be re-deployed, so that the encryption and decryption processing difficulty among different webpage systems is high.
At present, common encryption algorithms comprise DES, 3DES, AES, SHA-1, MD5 and the like, but in the field of javaScript languages, related algorithm applications are difficult to be commonly used on different webpage systems due to the influences of high language characteristics, high algorithm complexity and the like, so that a relatively common safe encryption algorithm with low complexity and high encryption speed is difficult to realize, namely the security of related data encryption of the existing web is low.
Disclosure of Invention
The invention mainly aims to solve the problem that the security of related data encryption of the existing web is low.
The invention provides a webpage data encryption method in a first aspect, which comprises the following steps: the webpage data encryption method comprises the following steps: acquiring data to be encrypted of a webpage, and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted; carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data; numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained; and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain encrypted data of the webpage.
Optionally, in a first implementation manner of the first aspect of the present invention, the marking the verification position of the data to be encrypted to obtain the marked data to be encrypted includes: determining position information corresponding to a webpage where the data to be encrypted is located, and determining head data and tail data of the data to be encrypted according to the position information; and respectively splicing corresponding preset verification information to the head data and the tail data to obtain marked data to be encrypted.
Optionally, in a second implementation manner of the first aspect of the present invention, the performing out-of-order permutation and asymmetric computation on the marked data to be encrypted to obtain out-of-order feature data includes: randomly arranging the marked data to be encrypted by adopting a preset reverse strategy to obtain randomly arranged data to be encrypted; performing hash calculation on the randomly arranged data to be encrypted to obtain a plurality of characteristic sequences; and splicing the plurality of characteristic sequences to the randomly arranged data to be encrypted to obtain disorder characteristic data.
Optionally, in a third implementation manner of the first aspect of the present invention, the splicing the multiple feature sequences to the randomly arranged data to be encrypted to obtain out-of-order feature data includes: selecting a preset amount of data in the characteristic sequence as a head characteristic sequence and a tail characteristic sequence according to the sequence of Hash calculation; and splicing the head characteristic sequence to head data in the randomly arranged data to be encrypted, and splicing the tail characteristic sequence to tail data in the randomly arranged data to be encrypted to obtain disorder characteristic data.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the performing, by using a preset data conversion policy, numerical value conversion on each character in the unordered feature data to obtain a corresponding feature conversion numerical value and ordering information of each character includes: extracting each character in the disorder feature data, and determining the sequencing information of each character; and converting each character according to a preset system, and performing offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the performing offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character includes: performing offset calculation on each converted character to obtain an offset value corresponding to each converted character, and judging whether each offset value is larger than each corresponding converted character or not; if so, taking the offset value larger than the character corresponding to the conversion as a character conversion numerical value; if not, each converted character is taken as a character conversion numerical value.
Optionally, in a sixth implementation manner of the first aspect of the present invention, after the acquiring data to be encrypted of a web page, the method further includes: determining a webpage data type corresponding to the data to be encrypted, and judging whether the webpage data type is a character string type; and if the webpage data type is not the character string type, converting the data to be encrypted into the character string type.
The second aspect of the present invention provides a web page data encryption apparatus, including: the system comprises a marking module, a data encryption module and a data encryption module, wherein the marking module is used for acquiring data to be encrypted of a webpage and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted; the disorder calculation module is used for performing disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data; the numerical value conversion module is used for carrying out numerical value conversion on each character in the disorder characteristic data by adopting a preset data conversion strategy to obtain a corresponding characteristic conversion numerical value and sequencing information of each character; and the numerical value sequencing module is used for coding each feature conversion numerical value and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage.
Optionally, in a first implementation manner of the second aspect of the present invention, the marking module includes: the position determining unit is used for determining position information corresponding to a webpage where the data to be encrypted is located, and determining head data and tail data of the data to be encrypted according to the position information; and the verification splicing unit is used for splicing the corresponding preset verification information of the head data and the tail data respectively to obtain marked data to be encrypted.
Optionally, in a second implementation manner of the second aspect of the present invention, the out-of-order calculation module includes: the random arrangement unit is used for randomly arranging the marked data to be encrypted by adopting a preset reverse strategy to obtain randomly arranged data to be encrypted; the hash calculation unit is used for carrying out hash calculation on the randomly arranged data to be encrypted to obtain a plurality of characteristic sequences; and the characteristic splicing unit is used for splicing the plurality of characteristic sequences to the randomly arranged data to be encrypted to obtain disorder characteristic data.
Optionally, in a third implementation manner of the second aspect of the present invention, the feature splicing unit includes: selecting a preset amount of data in the characteristic sequence as a head characteristic sequence and a tail characteristic sequence according to the sequence of Hash calculation; and splicing the head characteristic sequence to head data in the randomly arranged data to be encrypted, and splicing the tail characteristic sequence to tail data in the randomly arranged data to be encrypted to obtain disorder characteristic data.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the numerical conversion module includes: the character extraction unit is used for extracting each character in the disorder characteristic data and determining the sequencing information of each character; and the offset calculation unit is used for converting each character according to a preset system and performing offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the offset calculating unit includes: performing offset calculation on each converted character to obtain an offset value corresponding to each converted character, and judging whether each offset value is larger than each corresponding converted character; if so, taking the offset value larger than the character corresponding to the conversion as a character conversion numerical value; if not, each converted character is taken as a character conversion numerical value.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the marking module further includes: the type determining unit is used for determining a webpage data type corresponding to the data to be encrypted and judging whether the webpage data type is a character string type; and the type conversion unit is used for converting the data to be encrypted into a character string type if the webpage data type is not the character string type.
A third aspect of the present invention provides a web page data encryption device, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the web page data encryption device to perform the steps of the web page data encryption method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the above-described web page data encryption method.
According to the technical scheme provided by the invention, data to be encrypted of a webpage are obtained, and the data to be encrypted is subjected to position verification marking to obtain marked data to be encrypted; carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data; numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained; and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage. Compared with the prior art, the method and the device have the advantages that the verification position marks are carried out on the webpage data to be encrypted, the marked data to be encrypted are subjected to disorder arrangement and asymmetric calculation to obtain disorder feature data, then feature value calculation is carried out on the disorder feature data, the disorder feature data are marked and coded and sequenced by using the result of the feature value calculation, and the encrypted data of the webpage are obtained. The method realizes an algorithm with lower encryption processing complexity and higher encryption and decryption speed, thereby improving the safety of the webpage related transmission data.
Drawings
FIG. 1 is a diagram of a first embodiment of a method for encrypting data of a web page according to an embodiment of the present invention;
FIG. 2 is a diagram of a second embodiment of a web page data encryption method according to the embodiment of the present invention;
FIG. 3 is a diagram of a third embodiment of a method for encrypting data of a web page according to an embodiment of the present invention;
FIG. 4 is a diagram of a fourth embodiment of a method for encrypting data of a web page according to an embodiment of the present invention;
FIG. 5 is a diagram of a fifth embodiment of a method for encrypting data of a web page according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an embodiment of a device for encrypting data of a web page according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of another embodiment of a web page data encryption apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an embodiment of a web page data encryption device in the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for encrypting webpage data, wherein the method comprises the following steps: acquiring data to be encrypted of a webpage, and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted; carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data; numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained; and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain encrypted data of the webpage. The method and the device improve the safety of the webpage related data.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be implemented in other sequences than those illustrated or described herein. Moreover, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, with reference to fig. 1, a first embodiment of a method for encrypting web page data in the embodiment of the present invention includes:
101. acquiring data to be encrypted of a webpage, and marking a verification position of the data to be encrypted to obtain marked data to be encrypted;
it is to be understood that the execution subject of the present invention may be a web page data encryption device, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence base technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
In this embodiment, because the data types transmitted and sent by different current web page systems are not unified, data transmission processing is performed in a data type mode corresponding to each web page compiling language, when acquiring the web page data to be encrypted, in order to enable the data processing of the method to be capable of general processing, unified data type processing needs to be performed on different types of web page data, and then data encryption processing needs to be performed on the data after the unified type. The verification position mark is used for adding relevant verification information to the current data mark to be encrypted so as to judge whether the data is tampered by distinguishing whether the data to be decrypted has the corresponding verification information during decryption processing, so that non-original webpage data and transmission error and inaccurate data are avoided.
In practical application, acquiring data to be encrypted of a webpage, further determining a webpage data type corresponding to the data to be encrypted, and judging whether the webpage data type is a character string type; if the webpage data type is not the character string type, converting the data to be encrypted into the character string type; further, for the data to be encrypted of the same data type, determining the position information corresponding to the webpage where the data to be encrypted is located, and determining the head data and the tail data of the data to be encrypted according to the obtained position information; and respectively splicing corresponding preset check information to the head data and the tail data to obtain marked data to be encrypted. By adding the check mark information to the data to be encrypted, the security of data transmission is enhanced, and related webpage data are prevented from being tampered during transmission to obtain transmitted original webpage data.
102. Disorder arrangement and asymmetric calculation are carried out on the marked data to be encrypted to obtain disorder characteristic data;
in this embodiment, the disorder arrangement refers to performing disorder processing on the data to be encrypted according to a preset data disorder strategy, scrambling the data according to a corresponding strategy, and performing reverse operation according to the corresponding scrambling strategy during decryption to obtain corresponding original webpage data, wherein the nominal data disorder strategy includes reverse arrangement, plug-in arrangement and the like; the asymmetric computation here, namely, the related asymmetric algorithm (namely, public key algorithm) is used to perform the encryption computation processing of an asymmetric key on data to be encrypted, so that the encrypted data can be decrypted only by another set of corresponding key, wherein in the public key algorithm cryptosystem, different keys are used for encryption and decryption, and the two keys have a mutual dependency relationship, that is, information encrypted by any one of the keys can only be decrypted by the other key, so that both communication parties can perform secret communication without exchanging keys (namely, public keys), wherein the main public key algorithm comprises: RSA algorithm, DSA algorithm, DH algorithm, ECC algorithm, etc.
In practical application, according to the marked data to be encrypted obtained by the processing, a preset reverse strategy is adopted to carry out randomly arranged data disorder processing on the marked data to be encrypted so as to obtain randomly arranged data to be encrypted; further carrying out Hash calculation on the data to be encrypted which are randomly arranged to obtain a plurality of characteristic sequences; splicing the plurality of characteristic sequences to the randomly arranged data to be encrypted to obtain disorder characteristic data, namely selecting a preset amount of data in the characteristic sequences as a head characteristic sequence and a tail characteristic sequence according to the sequence of Hash calculation; and splicing the head characteristic sequence to head data in the randomly arranged data to be encrypted, and splicing the tail characteristic sequence to tail data in the randomly arranged data to be encrypted to obtain disorder characteristic data. By carrying out disorder and asymmetric calculation processing on the data, the security of data encryption can be further improved, and the difficulty coefficient of data decryption is increased.
103. Numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained;
in this embodiment, the data conversion policy refers to a processing data policy for converting out-of-order feature data into a corresponding form, for example, a policy for converting data to be encrypted into data of a corresponding data type, into data of a corresponding language, and into data of a corresponding system; the ranking information here refers to the corresponding ranking position information of each character data in the feature conversion data in the overall feature conversion data. Through the conversion processing of the corresponding data, the data is further encrypted and disguised, and the safety of the webpage data is enhanced.
In practical application, extracting each character in the disorder feature data according to the disorder feature data obtained by the processing, and determining the sequencing information corresponding to each character; carrying out data system conversion on each character according to a preset system, carrying out 20-unit left shift processing on each converted data, carrying out offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character, namely carrying out offset calculation on each converted character to obtain an offset value corresponding to each converted character, and judging whether each offset value is larger than each corresponding converted character or not; if the judgment result is larger than the preset value, taking the offset value larger than the corresponding converted character as a character conversion numerical value; and if the judgment result is not larger than the judgment result, taking each converted character as a character conversion numerical value.
104. And coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage.
In this embodiment, the encoding refers to converting a feature conversion value into a Unicode, so as to facilitate data transmission and processing of a computer, where the function called by the encoding is a function built in a language corresponding to each netpage system, each language has a 10-system character conversion method, the 10-system character conversion method is a direct or indirect method for converting the 10-system character into a character, and then all data of the computer are represented by 2-mechanism 0 and 1, and the 2-system and 10-system characters can be converted into each other, for example, the code pointat (an instruction of Java, which can return a character (Unicode code point) at a specified index) and fromCodePoint (return corresponding character from code point) of javaScript, and thus the corresponding character conversion is a binary data format processed by converting data into a computer bottom layer.
In practical application, according to the feature conversion numerical values obtained by the processing, the feature conversion numerical values are converted into code points corresponding to Unicode by utilizing built-in functions of corresponding programming languages of all webpage systems, and then the code points of all characters are converted into Unicode characters; and sequentially arranging the uniformly coded feature conversion data according to the sequence order of the characters according to the sequence information of the characters, and combining to obtain the encrypted data of the webpage.
In the embodiment of the invention, data to be encrypted of a webpage are obtained, and the data to be encrypted is subjected to check position marking to obtain marked data to be encrypted; carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data; numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained; and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage. Compared with the prior art, the method and the device have the advantages that the verification position marks are carried out on the webpage data to be encrypted, the marked data to be encrypted are subjected to disorder arrangement and asymmetric calculation to obtain disorder feature data, then feature value calculation is carried out on the disorder feature data, the disorder feature data are marked and coded and sequenced by using the result of the feature value calculation, and the encrypted data of the webpage are obtained. The method realizes an algorithm with lower encryption processing complexity and higher encryption and decryption speed, thereby improving the safety of the webpage related transmission data.
Referring to fig. 2, a second embodiment of the method for encrypting web page data according to the embodiment of the present invention includes:
201. determining a webpage data type corresponding to the data to be encrypted, and judging whether the webpage data type is a character string type;
in this embodiment, the web data type refers to various web programming languages (e.g., String types in languages such as javaScript, java, go, etc.) and corresponding data types (e.g., Number, String, List, Tuple, Sets, Dictionary, etc.).
In practical application, after data to be encrypted of a webpage are acquired, a webpage programming language writing record of the webpage system is called, so that a webpage data type corresponding to the data to be encrypted is determined, and whether the webpage data type is a character string type or not is judged for the data to be encrypted.
202. If the webpage data type is not the character string type, converting the data to be encrypted into the character string type;
in this embodiment, after determining whether the data type of the web page is a String type, if the data type of the web page is not the String type, before performing data encryption processing on the data to be encrypted, String type conversion of the data type is performed on the data to be encrypted, and JSON format conversion cannot be performed on the data to be encrypted. For example, JSON.parse and JSON.Stringfy of javaScript and the like, so as to realize the conversion of character string type data), and after format conversion, carrying out check position marking processing on the data to be encrypted to obtain marked data to be encrypted.
203. Carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data;
204. numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained;
205. and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage.
In the embodiment of the invention, the webpage data type corresponding to the data to be encrypted is determined, and whether the webpage data type is a character string type is judged; and if the webpage data type is not the character string type, converting the data to be encrypted into the character string type. Compared with the prior art, the encryption method has the advantages that before the encryption processing is carried out on the data to be encrypted, the data type unification processing is carried out on the data to be encrypted firstly, then the data to be encrypted of the unified data type is encrypted, the universal processing performance of the encryption method on different webpage systems is realized, and the webpage data can be encrypted by simply inserting and transplanting the data to be encrypted to carry out the webpage systems.
Referring to fig. 3, a third embodiment of the method for encrypting web page data according to the embodiment of the present invention includes:
301. determining position information corresponding to a webpage where the data to be encrypted is located, and determining head data and tail data of the data to be encrypted according to the position information;
in this embodiment, the location information refers to location information of each data in the current data to be encrypted in the total data to be encrypted; here header data. Refers to the initial data in the data to be encrypted; the tail data refers to the last data at the tail in the data to be encrypted.
In practical application, data to be encrypted of a webpage are obtained, each piece of data in the data to be encrypted is traversed, accordingly, corresponding position information in the webpage data where the data to be encrypted is located is determined, and head data and tail data of the data to be encrypted are determined according to the position information of each piece of data.
302. Respectively splicing corresponding preset verification information to the head data and the tail data to obtain marked data to be encrypted;
in this embodiment, the check information refers to the custom-added header check information and trailer check information.
In practical application, according to the determined head data and tail data of the data to be encrypted, before the head check information is added to the head data, the tail check information is added to the tail data, and then the marked data to be encrypted is obtained through combination.
303. Carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data;
304. numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained;
305. and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage.
In the embodiment of the invention, the position information corresponding to the webpage where the data to be encrypted is located is determined, and the head data and the tail data of the data to be encrypted are determined according to the position information; and respectively splicing corresponding preset check information to the head data and the tail data to obtain marked data to be encrypted. Compared with the prior art, the method and the device have the advantages that data traversal is carried out on the acquired data to be encrypted, the head data and the tail data are determined, corresponding verification information is added, the marked data to be encrypted is obtained through combination, and the transmission safety of the added data to be encrypted and the data safety verification during encryption are improved.
Referring to fig. 4, a fourth embodiment of the method for encrypting web page data according to the embodiment of the present invention includes:
401. acquiring data to be encrypted of a webpage, and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted;
402. randomly arranging the marked data to be encrypted by adopting a preset reverse strategy to obtain randomly arranged data to be encrypted;
in this embodiment, the reverse-narrating policy refers to one of disorder policies, and data to be encrypted after the mark is subjected to data reverse-narrating processing (for example, data dcba is obtained by reverse-narrating data abcd).
In practical application, a preset reverse strategy is adopted, and the marked data to be encrypted is subjected to reverse sequencing processing, so that the data to be encrypted after reverse arrangement is obtained.
403. Carrying out Hash calculation on the randomly arranged data to be encrypted to obtain a plurality of characteristic sequences;
in this embodiment, the hash calculation herein refers to performing data feature value calculation by using a related asymmetric algorithm (e.g., MD5 algorithm, etc.) to obtain a feature sequence.
In practical application, the randomly arranged data to be encrypted is subjected to hash calculation by using an MD5 algorithm to generate a corresponding number of feature sequences (for example, 32-bit feature values may be generated correspondingly).
404. Splicing the plurality of characteristic sequences to randomly arranged data to be encrypted to obtain disorder characteristic data;
in this embodiment, when performing hash calculation by using the MD5 algorithm, the sequence of calculation of each feature value is recorded at the same time, and then, according to the sequence of hash calculation, data of a preset number (32-bit feature values) in a feature sequence is selected as a head feature sequence (for example, 16 hash values obtained by calculation first) and a tail feature sequence (for example, 16 hash values obtained by calculation last); and then splicing the head characteristic sequence to the head data in the randomly arranged data to be encrypted, and splicing the tail characteristic sequence to the tail data in the randomly arranged data to be encrypted to obtain the disorder characteristic data.
405. Numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained;
406. and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage.
In the embodiment of the invention, a preset reverse strategy is adopted to randomly arrange the marked data to be encrypted to obtain randomly arranged data to be encrypted; carrying out Hash calculation on the randomly arranged data to be encrypted to obtain a plurality of characteristic sequences; selecting a preset amount of data in the characteristic sequence as a head characteristic sequence and a tail characteristic sequence according to the sequence of Hash calculation; and splicing the head characteristic sequence to head data in the randomly arranged data to be encrypted, and splicing the tail characteristic sequence to tail data in the randomly arranged data to be encrypted to obtain disorder characteristic data. Compared with the prior art, the method and the device have the advantages that the marked data to be encrypted are subjected to narration and asymmetric calculation, so that the corresponding head characteristic data and tail characteristic data are added to the data to be encrypted after narration, the safe encryption processing of the data to be encrypted is realized, and the data leakage caused by the leakage of an encryption method can be avoided by utilizing the asymmetric calculation.
Referring to fig. 5, a fifth embodiment of the method for encrypting webpage data according to the embodiment of the present invention includes:
501. acquiring data to be encrypted of a webpage, and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted;
502. carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data;
503. extracting each character in the disorder characteristic data, and determining the sequencing information of each character;
in this embodiment, according to the disorder feature data obtained by the processing, each character in the disorder feature data is cyclically traversed and extracted by using a built-in function in each web page system, and the ranking information of each character in the disorder feature data is determined while the character is traversed.
504. Converting each character according to a preset system, and performing offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character;
in this embodiment, according to each character in the extracted disorder feature data, a single character is converted into a corresponding 10-system numerical value, and after the obtained 10-system numerical value is converted, the formula is calculated according to the offset: the method comprises the following steps of (1) carrying out deviant calculation on x × I × J-pos ═ y (wherein x is a 10-system result converted from a single character, I is an item factor, J is a free factor, and pos is an offset, I, J and pos can be set by self according to different webpage data, and corresponding offset calculation formulas can be set according to different webpage data or different webpage systems), obtaining deviant values corresponding to each converted character, and judging whether each deviant value is larger than each corresponding converted character or not; if so, taking the offset value larger than the character corresponding to the conversion as a character conversion numerical value; if not, each converted character is taken as a character conversion numerical value.
505. And coding the feature conversion numerical values, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain encrypted data of the webpage.
In the embodiment of the invention, each character in the disorder characteristic data is extracted, and the sequencing information of each character is determined; converting each character according to a preset system, carrying out offset calculation on each converted character to obtain an offset value corresponding to each converted character, and judging whether each offset value is larger than each corresponding converted character or not; if so, taking the offset value larger than the character corresponding to the conversion as a character conversion numerical value; if not, each converted character is taken as a character conversion numerical value. Compared with the prior art, the method and the device have the advantages that the different types of data are subjected to corresponding offset value calculation through the binary conversion and the offset calculation of the disorder characteristic data, the further encryption and hiding of the data are realized, and the safety of the data is improved.
With reference to fig. 6, the above describes a method for encrypting web page data in an embodiment of the present invention, and a web page data encryption apparatus in an embodiment of the present invention is described below, where an embodiment of the web page data encryption apparatus in an embodiment of the present invention includes:
the marking module 601 is configured to obtain data to be encrypted of a webpage, and perform a check position marking on the data to be encrypted to obtain marked data to be encrypted;
the disorder calculation module 602 is configured to perform disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder feature data;
a numerical value conversion module 603, configured to perform numerical value conversion on each character in the disorder feature data by using a preset data conversion policy, so as to obtain a corresponding feature conversion numerical value and ordering information of each character;
the numerical value sorting module 604 is configured to encode each feature conversion numerical value, and sort the encoded feature conversion numerical values according to the sorting information to obtain encrypted data of a web page.
In the embodiment of the invention, data to be encrypted of a webpage are obtained, and the data to be encrypted is subjected to check position marking to obtain marked data to be encrypted; carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data; numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained; and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage. Compared with the prior art, the method and the device have the advantages that the verification position marks are carried out on the webpage data to be encrypted, the marked data to be encrypted are subjected to disorder arrangement and asymmetric calculation to obtain disorder feature data, then feature value calculation is carried out on the disorder feature data, the disorder feature data are marked and coded and sequenced by using the result of the feature value calculation, and the encrypted data of the webpage are obtained. The method realizes an algorithm with lower encryption processing complexity and higher encryption and decryption speed, thereby improving the safety of the webpage related transmission data.
Referring to fig. 7, another embodiment of the web page data encryption apparatus according to the embodiment of the present invention includes:
the marking module 601 is configured to obtain data to be encrypted of a webpage, and perform a check position marking on the data to be encrypted to obtain marked data to be encrypted;
a disorder calculation module 602, configured to perform disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder feature data;
a numerical value conversion module 603, configured to perform numerical value conversion on each character in the disorder feature data by using a preset data conversion policy, so as to obtain a corresponding feature conversion numerical value and ordering information of each character;
the numerical value sorting module 604 is configured to encode each feature conversion numerical value, and sort the encoded feature conversion numerical values according to the sorting information to obtain encrypted data of a web page.
Further, the marking module 601 includes:
a position determining unit 6011, configured to determine position information corresponding to a webpage where the data to be encrypted is located, and determine, according to the position information, head data and tail data of the data to be encrypted; and a verification splicing unit 6012, configured to splice corresponding preset verification information to the head data and the tail data, respectively, to obtain marked data to be encrypted.
Further, the out-of-order computation module 602 includes:
a random arrangement unit 6021, configured to randomly arrange the marked data to be encrypted by using a preset reverse order strategy, so as to obtain randomly arranged data to be encrypted; a hash calculation unit 6022, configured to perform hash calculation on the randomly arranged data to be encrypted to obtain a plurality of feature sequences; the feature splicing unit 6023 is configured to splice the plurality of feature sequences to the randomly arranged data to be encrypted, so as to obtain disorder feature data.
Further, the feature splicing unit 6023 includes:
selecting a preset amount of data in the characteristic sequence as a head characteristic sequence and a tail characteristic sequence according to the sequence of Hash calculation; and splicing the head characteristic sequence to head data in the randomly arranged data to be encrypted, and splicing the tail characteristic sequence to tail data in the randomly arranged data to be encrypted to obtain disorder characteristic data.
Further, the numerical conversion module 603 includes:
a character extraction unit 6031 configured to extract each character in the out-of-order feature data and determine ordering information of the each character; and an offset calculation unit 6032, configured to convert each character according to a preset system, and perform offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character.
Further, the offset calculation unit 6032 includes:
performing offset calculation on each converted character to obtain an offset value corresponding to each converted character, and judging whether each offset value is larger than each corresponding converted character; if so, taking the offset value larger than the character corresponding to the conversion as a character conversion numerical value; if not, each converted character is taken as a character conversion numerical value.
Further, the marking module 601 further includes:
a type determining unit 6013, configured to determine a webpage data type corresponding to the data to be encrypted, and determine whether the webpage data type is a character string type; a type conversion unit 6014, configured to convert the data to be encrypted into a string type if the web page data type is not a string type.
In the embodiment of the invention, the data to be encrypted is subjected to data unification treatment, and then the data subjected to unification treatment is subjected to disorder arrangement and asymmetric calculation, so that the probability of data cracking is reduced, and then the data conversion and deviant calculation are performed on disorder characteristic data, so that the characteristic conversion data is subjected to uniform coding and sequencing, and the data to be encrypted of the webpage is obtained. Compared with the prior art, the method and the device have the advantages that the rapid encryption processing of the data to be encrypted is realized, the use is convenient, the requirements on the hardware of the computer and the mobile equipment are low, the algorithm complexity is moderate, the method and the device are very suitable for the data encryption scene with safety requirements and limited safety requirements, and the safety of the webpage data is improved.
Fig. 6 and 7 describe the web page data encryption apparatus in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the web page data encryption device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 8 is a schematic structural diagram of a web page data encryption device according to an embodiment of the present invention, where the web page data encryption device 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) storing an application 833 or data 832. Memory 820 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations on the web page data encryption device 800. Further, the processor 810 may be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the web page data encryption device 800.
The web page data encryption device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the web page data encryption device configuration shown in fig. 8 does not constitute a limitation of the web page data encryption device, and may include more or less components than those shown, or combine some components, or a different arrangement of components.
The invention further provides a webpage data encryption device, which comprises a memory and a processor, wherein computer readable instructions are stored in the memory, and when being executed by the processor, the computer readable instructions cause the processor to execute the steps of the webpage data encryption method in the embodiments.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when executed on a computer, cause the computer to perform the steps of the web page data encryption method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A webpage data encryption method is characterized by comprising the following steps:
acquiring data to be encrypted of a webpage, and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted;
carrying out disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data;
numerical value conversion is carried out on each character in the disorder characteristic data by adopting a preset data conversion strategy, and a corresponding characteristic conversion numerical value and sequencing information of each character are obtained;
and coding each feature conversion numerical value, and sequencing the coded feature conversion numerical values according to the sequencing information to obtain encrypted data of the webpage.
2. The method for encrypting webpage data according to claim 1, wherein the step of marking the verification position of the data to be encrypted to obtain the marked data to be encrypted comprises:
determining position information corresponding to a webpage where the data to be encrypted is located, and determining head data and tail data of the data to be encrypted according to the position information;
and respectively splicing corresponding preset verification information to the head data and the tail data to obtain marked data to be encrypted.
3. The method for encrypting the webpage data according to claim 2, wherein the step of performing disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder feature data comprises the steps of:
randomly arranging the marked data to be encrypted by adopting a preset reverse strategy to obtain randomly arranged data to be encrypted;
performing hash calculation on the randomly arranged data to be encrypted to obtain a plurality of characteristic sequences;
and splicing the plurality of characteristic sequences to the randomly arranged data to be encrypted to obtain disorder characteristic data.
4. The method for encrypting the webpage data according to claim 3, wherein the splicing the plurality of feature sequences to the randomly arranged data to be encrypted to obtain the out-of-order feature data comprises:
selecting a preset amount of data in the characteristic sequence as a head characteristic sequence and a tail characteristic sequence according to the sequence of Hash calculation;
and splicing the head characteristic sequence to the head data in the randomly arranged data to be encrypted, and splicing the tail characteristic sequence to the tail data in the randomly arranged data to be encrypted to obtain disorder characteristic data.
5. The method for encrypting the webpage data according to claim 1, wherein the step of performing numerical value conversion on each character in the disorder feature data by using a preset data conversion strategy to obtain a corresponding feature conversion numerical value and the sequencing information of each character comprises the steps of:
extracting each character in the disorder feature data, and determining the sequencing information of each character;
and converting each character according to a preset system, and performing offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character.
6. The method for encrypting webpage data according to claim 5, wherein the performing offset calculation on each converted character to obtain a character conversion numerical value corresponding to each character comprises:
performing offset calculation on each converted character to obtain an offset value corresponding to each converted character, and judging whether each offset value is larger than each corresponding converted character;
if so, taking the offset value of the character which is larger than the corresponding conversion as a character conversion numerical value;
if not, each converted character is taken as a character conversion numerical value.
7. The web page data encryption method according to any one of claims 1 to 6, further comprising, after the acquiring data to be encrypted of the web page:
determining a webpage data type corresponding to the data to be encrypted, and judging whether the webpage data type is a character string type;
and if the webpage data type is not the character string type, converting the data to be encrypted into the character string type.
8. A web page data encryption apparatus, characterized in that the web page data encryption apparatus comprises:
the system comprises a marking module, a data encryption module and a data encryption module, wherein the marking module is used for acquiring data to be encrypted of a webpage and carrying out check position marking on the data to be encrypted to obtain marked data to be encrypted;
the disorder calculation module is used for performing disorder arrangement and asymmetric calculation on the marked data to be encrypted to obtain disorder characteristic data;
the numerical value conversion module is used for performing numerical value conversion on each character in the disorder characteristic data by adopting a preset data conversion strategy to obtain a corresponding characteristic conversion numerical value and sequencing information of each character;
and the numerical value sequencing module is used for coding each feature conversion numerical value and sequencing the coded feature conversion numerical values according to the sequencing information to obtain the encrypted data of the webpage.
9. A web page data encryption device characterized by comprising: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invokes the instructions in the memory to cause the web page data encryption device to perform the steps of the web page data encryption method of any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the steps of the web page data encryption method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210512532.8A CN115001659A (en) | 2022-05-12 | 2022-05-12 | Webpage data encryption method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210512532.8A CN115001659A (en) | 2022-05-12 | 2022-05-12 | Webpage data encryption method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115001659A true CN115001659A (en) | 2022-09-02 |
Family
ID=83028006
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210512532.8A Pending CN115001659A (en) | 2022-05-12 | 2022-05-12 | Webpage data encryption method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115001659A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117459322A (en) * | 2023-12-22 | 2024-01-26 | 济南工程职业技术学院 | Computer software data encryption method based on Internet of things |
-
2022
- 2022-05-12 CN CN202210512532.8A patent/CN115001659A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117459322A (en) * | 2023-12-22 | 2024-01-26 | 济南工程职业技术学院 | Computer software data encryption method based on Internet of things |
CN117459322B (en) * | 2023-12-22 | 2024-03-08 | 济南工程职业技术学院 | Computer software data encryption method based on Internet of things |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2021513141A (en) | Generation and identification of 2D barcodes | |
CN106612172A (en) | Data change recovery algorithm capable of restoring data authenticity in cloud storage | |
US9607160B2 (en) | Method and apparatus for providing string encryption and decryption in program files | |
WO2015156786A1 (en) | Redactable document signatures | |
CN103530535A (en) | Shell adding and removing method for Android platform application program protection | |
CN101477610B (en) | Software watermark process for combined embedding of source code and target code | |
US8699703B2 (en) | System and method for pseudo-random polymorphic tree construction | |
CA2928836A1 (en) | Methods and apparatuses of digital data processing | |
CA3150187C (en) | Method and apparatus for protecting web script codes | |
CN113704781A (en) | File secure transmission method and device, electronic equipment and computer storage medium | |
CN106780280B (en) | Digital watermarking encryption method and device | |
CN111475690A (en) | Character string matching method and device, data detection method and server | |
CN115001659A (en) | Webpage data encryption method, device, equipment and storage medium | |
CN117336018A (en) | Encryption and decryption method and device for physiological sign monitoring data | |
US20240220457A1 (en) | Method of compressing and decompressing a file via cellular automata pre-processing | |
CN113642020B (en) | Dynamic encryption method and device for configuration file, electronic equipment and storage medium | |
CN113810375B (en) | Webshell detection method, device and equipment and readable storage medium | |
CN114707166A (en) | Data storage and reading method, device, equipment and storage medium | |
CN111311284B (en) | Cosmetics traceability platform system based on block chain | |
CN117093964A (en) | Encryption method and device of source code, storage medium and electronic equipment | |
CN111259432A (en) | Model data protection method and readable computer storage medium | |
CN114968206A (en) | Dynamic confusion method and system for programming language codes | |
Samuel et al. | Automation Detection of Malware and Stenographical Content using Machine Learning | |
Alfawair et al. | Secure Image Indexing Using Speeded Up Robust Features (SURF) Key Points and SHAKE256 Hashing | |
US11848919B1 (en) | Patternless obfuscation of data with low-cost data recovery |
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 |