A web page data encryption method

By segmenting and multiple-encrypting web page data, and using local and global encryption sequences combined with random number XOR and hash operations, the problem of low security of web page data encryption in the existing technology is solved, and higher data security is achieved. Security and resistance to cracking.

CN118468326BActive Publication Date: 2024-09-13CHENGDU JINTOBANG INTERNET INFORMATION SERVICE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410942124.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-13
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

The security of existing web page data encryption methods depends on the security of the key. If the key is leaked, the security of the data cannot be guaranteed, and the encryption process is easily cracked, resulting in low security of web page data encryption.

Method used

By segmenting the web page data, multiple web page encoding vectors are generated, and the local encryption sequence and the global encryption sequence are used for double encryption. Combined with random number XOR and hash operations, a virtual encoding vector is constructed to achieve multi-level encryption and improve Cryptographic security.

Benefits of technology

Significantly improves the encryption security of web page data. Through multiple encryption and ciphertext fusion, the original data is hidden, and the anti-cracking ability is enhanced to ensure that the data still has high security when the key is leaked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468326B
    Figure CN118468326B
Patent Text Reader

Abstract

The present invention discloses a web page data encryption method, which belongs to the technical field of web page data encryption. The present invention divides web page data according to content paragraphs in a web page to obtain multiple web page sub-data segments, and encrypts each web page sub-data segment. During encryption, each web page sub-data segment is divided according to a fixed length to obtain multiple web page encoding vectors. Each web page sub-data segment is composed of multiple web page encoding vectors. Each web page encoding vector is first encrypted according to a local encryption sequence, and then each encrypted web page sub-data segment is encrypted again according to a global encryption sequence, thereby realizing double encryption and improving the encryption security of web page data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of web page data encryption, and in particular to a web page data encryption method. Background Art

[0002] In modern society, with the popularization of the Internet and the development of technology, the security and privacy protection of web data has become an important issue. Web data includes users' personal information, transaction records, communication content, etc. If these data are illegally obtained and used, it will cause serious damage to the rights and interests of users. Therefore, how to effectively protect the security of web data and prevent data from being illegally stolen or tampered with is an important challenge facing current Internet technology.

[0003] However, there are still some problems with the existing web page data encryption methods. The security of some encryption methods depends on the security of the key. If the key is leaked, the security of the data cannot be guaranteed. At the same time, the encryption method is simple and the encryption process is easy to be cracked, which leads to the problem that the web page data encryption security is not high. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, a web page data encryption method provided by the present invention solves the problem of low security of web page data encryption in the prior art.

[0005] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a web page data encryption method, comprising the following steps:

[0006] S1. Segment the web page data according to the content paragraphs in the web page to obtain multiple sections of web page sub-data;

[0007] S2, segmenting each web page sub-data segment according to a fixed length to obtain multiple web page encoding vectors;

[0008] S3, generating a virtual encoding vector for each web page encoding vector;

[0009] S4, encrypting each web page coding vector according to the virtual coding vector and based on the local encryption sequence to obtain each encrypted web page coding vector;

[0010] S5, concatenating multiple encrypted web page encoding vectors to obtain each segment of encrypted web page sub-data;

[0011] S6. Encrypt each segment of encrypted web page sub-data according to the global encryption sequence to obtain double-encrypted web page sub-data.

[0012] The beneficial effects of the present invention are as follows: the present invention divides web page data according to content paragraphs in a web page to obtain multiple segments of web page sub-data, and encrypts each segment of web page sub-data. During encryption, each segment of web page sub-data is divided according to a fixed length to obtain multiple web page coding vectors. Each segment of web page sub-data is composed of multiple web page coding vectors. Each web page coding vector is first encrypted according to a local encryption sequence, and then each segment of encrypted web page sub-data is encrypted again according to a global encryption sequence, thereby achieving double encryption and improving the encryption security of web page data.

[0013] Furthermore, S3 includes the following sub-steps:

[0014] S31, performing bitwise XOR processing on the webpage coding vector and the first random number to obtain a first random coding vector;

[0015] S32, performing bitwise XOR processing on the webpage code vector and the second random number to obtain a second random code vector;

[0016] S33: Perform a hash operation on the first random code vector and the second random code vector to obtain a virtual code vector.

[0017] The beneficial effect of the above further scheme is: the present invention performs XOR processing on the web page coding vector with the first random number and the second random number respectively to obtain the first random coding vector and the second random coding vector, and then performs hash processing on the first random coding vector and the second random coding vector to obtain a virtual coding vector, so that the constructed virtual coding vector has double randomness, thereby improving encryption security.

[0018] Furthermore, the S4 comprises the following sub-steps:

[0019] S41, constructing coding matrices for the virtual coding vector and the webpage coding vector respectively, to obtain a virtual coding matrix and a webpage coding matrix;

[0020] S42, extracting diagonal elements of the virtual coding matrix to obtain a first local encryption sequence;

[0021] S43, extracting the diagonal elements of the webpage encoding matrix to obtain a second local encryption sequence;

[0022] S44, encrypting the webpage encoding vector using a first local encryption sequence to obtain a first encrypted ciphertext;

[0023] S45, encrypting the webpage encoding vector using a second local encryption sequence to obtain a second encrypted ciphertext;

[0024] S46. Perform bit-wise addition processing on the first encrypted ciphertext and the second encrypted ciphertext to obtain an encrypted web page encoding vector.

[0025] The beneficial effects of the above-mentioned further scheme are as follows: the present invention constructs coding matrices for the virtual coding vector and the web page coding vector respectively, extracts the corresponding diagonal elements, constructs a local encryption sequence, uses a first local encryption sequence to encrypt the web page coding vector, and uses a second local encryption sequence to encrypt the web page coding vector, obtains two encrypted ciphertexts, and then adds them bit by bit to merge the ciphertexts and hide the original data.

[0026] Furthermore, the expression of the virtual coding matrix in S41 is: A=a T a, where A is a virtual coding matrix, a is a virtual coding vector, and T is a transposition operation; the expression of the web page coding matrix is: B=b T b, where B is the web page encoding matrix and b is the web page encoding vector.

[0027] Furthermore, the encryption formulas in S44 and S45 are both: ,in, is the nth encrypted element in the first encrypted ciphertext or the second encrypted ciphertext, x m is the mth element in the first partial encryption sequence or the second partial encryption sequence, b n-m is the nmth element in the web page encoding vector, where n and m are positive integers, and M is the length of the first local encryption sequence or the second local encryption sequence.

[0028] The beneficial effect of the above further scheme is: when encrypting, the present invention uses the first local encryption sequence or the second local encryption sequence to weight each element with a single element in the web page encoding vector to obtain a corresponding encryption element, thereby realizing multi-level encryption and improving encryption security.

[0029] Furthermore, the S6 comprises the following sub-steps:

[0030] S61, constructing a global encryption sequence according to multiple encrypted web page encoding vectors in each segment of encrypted web page sub-data;

[0031] S62, performing bitwise XOR processing on the global encryption sequence and the i-th encrypted web page encoding vector in each segment of encrypted web page sub-data to obtain the i-th double encrypted ciphertext, where the initial value of i is 1;

[0032] S63, performing bitwise XOR processing on the i-th double encrypted ciphertext and the i+1-th encrypted web page encoding vector in each segment of encrypted web page sub-data to obtain the i+1-th double encrypted ciphertext;

[0033] S64, determine whether i is less than or equal to N-1, if so, jump to step S65, if not, i is incremented by 1, and jump to step S63, where N is the number of encrypted web page encoding vectors;

[0034] S65. Concatenate all double-encrypted ciphertexts to obtain double-encrypted web page sub-data.

[0035] The beneficial effect of the above-mentioned further scheme is as follows: the present invention constructs a global encryption sequence based on multiple encrypted web page coding vectors in each segment of encrypted web page sub-data, and after the global encryption sequence encrypts the first encrypted web page coding vector, forms the first double encrypted ciphertext, and then uses the first double encrypted ciphertext to encrypt the second double encrypted ciphertext, until all encrypted web page coding vectors are encrypted, so that the encryption process is progressive layer by layer, and each encrypted web page coding vector has a different encrypted ciphertext, thereby improving the security of encryption.

[0036] Furthermore, the S61 includes the following sub-steps:

[0037] S611, calculating a flag value according to each encrypted web page encoding vector;

[0038] S612, constructing all flag values ​​into a flag value vector;

[0039] S613. Construct a flag matrix based on the flag value vector, H=E T E, where H is the flag matrix, E is the flag value vector, and T is the transpose;

[0040] S614, constructing a first candidate sequence according to the row elements of the marker matrix;

[0041] S615, constructing a second candidate sequence according to the column elements of the marker matrix;

[0042] S616. Construct a global encryption sequence according to the first candidate sequence and the second candidate sequence.

[0043] Furthermore, the formula for calculating the flag value in S611 is: , where s is the sign value, e is the natural constant, r i is the i-th element in the encrypted web page encoding vector, i is a positive integer, and L is the number of elements in the encrypted web page encoding vector.

[0044] Furthermore, the kth element in the first candidate sequence constructed in S614 is the sum of the elements in the kth row of the marker matrix, and the kth element in the second candidate sequence constructed in S615 is the sum of the elements in the kth column of the marker matrix, and k is a positive integer.

[0045] Furthermore, the formula for constructing the global encryption sequence in S616 is: , where G is the global encryption sequence, X 1 is the first candidate sequence, X 2 is the first candidate sequence, is bitwise multiplication.

[0046] The beneficial effect of the above-mentioned further scheme is as follows: the present invention constructs a flag matrix according to all encrypted web page coding vectors, constructs a first candidate sequence according to each row element, constructs a second candidate sequence according to each column element, multiplies the first candidate sequence and the second candidate sequence bit by bit to construct a global encryption sequence, and the global encryption sequence is derived from the encrypted web page coding vector. When the construction rules are unknown, the global encryption sequence cannot be cracked. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 The present invention is a flow chart of a web page data encryption method. DETAILED DESCRIPTION

[0048] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0049] like Figure 1 As shown, a web page data encryption method includes the following steps:

[0050] S1. Segment the web page data according to the content paragraphs in the web page to obtain multiple sections of web page sub-data;

[0051] S2, segmenting each web page sub-data segment according to a fixed length to obtain multiple web page encoding vectors;

[0052] S3, generating a virtual encoding vector for each web page encoding vector;

[0053] S4, encrypting each web page coding vector according to the virtual coding vector and based on the local encryption sequence to obtain each encrypted web page coding vector;

[0054] S5, concatenating multiple encrypted web page encoding vectors to obtain each segment of encrypted web page sub-data;

[0055] S6. Encrypt each segment of encrypted web page sub-data according to the global encryption sequence to obtain double-encrypted web page sub-data.

[0056] The S3 comprises the following sub-steps:

[0057] S31, performing bitwise XOR processing on the webpage coding vector and the first random number to obtain a first random coding vector;

[0058] S32, performing bitwise XOR processing on the webpage code vector and the second random number to obtain a second random code vector;

[0059] S33: Perform a hash operation on the first random code vector and the second random code vector to obtain a virtual code vector.

[0060] The present invention performs XOR processing on the web page coding vector with the first random number and the second random number respectively to obtain the first random coding vector and the second random coding vector, and then performs hash processing on the first random coding vector and the second random coding vector to obtain a virtual coding vector, so that the constructed virtual coding vector has double randomness, thereby improving encryption security.

[0061] The S4 comprises the following sub-steps:

[0062] S41, constructing coding matrices for the virtual coding vector and the webpage coding vector respectively, to obtain a virtual coding matrix and a webpage coding matrix;

[0063] S42, extracting diagonal elements of the virtual coding matrix to obtain a first local encryption sequence;

[0064] S43, extracting the diagonal elements of the webpage encoding matrix to obtain a second local encryption sequence;

[0065] S44, encrypting the webpage encoding vector using a first local encryption sequence to obtain a first encrypted ciphertext;

[0066] S45, encrypting the webpage encoding vector using a second local encryption sequence to obtain a second encrypted ciphertext;

[0067] S46. Perform bit-wise addition processing on the first encrypted ciphertext and the second encrypted ciphertext to obtain an encrypted web page encoding vector.

[0068] The present invention constructs coding matrices for virtual coding vectors and web page coding vectors respectively, extracts corresponding diagonal elements, constructs local encryption sequences, uses a first local encryption sequence to encrypt the web page coding vector, uses a second local encryption sequence to encrypt the web page coding vector, obtains two encrypted ciphertexts, adds them bit by bit, merges the ciphertexts, and hides the original data.

[0069] The expression of the virtual coding matrix in S41 is: A=a T a, where A is a virtual coding matrix, a is a virtual coding vector, and T is a transposition operation; the expression of the web page coding matrix is: B=b T b, where B is the web page encoding matrix and b is the web page encoding vector.

[0070] The encryption formulas in S44 and S45 are: ,in, is the nth encrypted element in the first encrypted ciphertext or the second encrypted ciphertext, xm is the mth element in the first partial encryption sequence or the second partial encryption sequence, b n-m is the nmth element in the web page encoding vector, where n and m are positive integers, and M is the length of the first local encryption sequence or the second local encryption sequence.

[0071] When encrypting, the present invention weights each element in the first local encryption sequence or the second local encryption sequence and a single element in the web page encoding vector to obtain a corresponding encryption element, thereby achieving multi-level encryption and improving encryption security.

[0072] The S6 comprises the following sub-steps:

[0073] S61, constructing a global encryption sequence according to multiple encrypted web page encoding vectors in each segment of encrypted web page sub-data;

[0074] S62, performing bitwise XOR processing on the global encryption sequence and the i-th encrypted web page encoding vector in each segment of encrypted web page sub-data to obtain the i-th double encrypted ciphertext, where the initial value of i is 1;

[0075] S63, performing bitwise XOR processing on the i-th double encrypted ciphertext and the i+1-th encrypted web page encoding vector in each segment of encrypted web page sub-data to obtain the i+1-th double encrypted ciphertext;

[0076] S64, determine whether i is less than or equal to N-1, if so, jump to step S65, if not, i is incremented by 1, and jump to step S63, where N is the number of encrypted web page encoding vectors;

[0077] S65. Concatenate all double-encrypted ciphertexts to obtain double-encrypted web page sub-data.

[0078] During the XOR processing of the present invention, when there is inconsistency in length, a method of adding 0 is adopted to make the length the same.

[0079] The present invention constructs a global encryption sequence based on multiple encrypted web page coding vectors in each segment of encrypted web page sub-data. After the global encryption sequence encrypts the first encrypted web page coding vector, the first double encrypted ciphertext is formed, and then the first double encrypted ciphertext is used to encrypt the second double encrypted ciphertext until all the encrypted web page coding vectors are encrypted. This makes the encryption process progressive layer by layer, and each encrypted web page coding vector has a different encrypted ciphertext, thereby improving the security of encryption.

[0080] The S61 includes the following sub-steps:

[0081] S611, calculating a flag value according to each encrypted web page encoding vector;

[0082] S612, constructing all flag values ​​into a flag value vector;

[0083] S613. Construct a flag matrix based on the flag value vector, H=E T E, where H is the flag matrix, E is the flag value vector, and T is the transpose;

[0084] S614, constructing a first candidate sequence according to the row elements of the marker matrix;

[0085] S615, constructing a second candidate sequence according to the column elements of the marker matrix;

[0086] S616. Construct a global encryption sequence according to the first candidate sequence and the second candidate sequence.

[0087] The formula for calculating the flag value in S611 is: , where s is the sign value, e is the natural constant, r i is the i-th element in the encrypted web page encoding vector, i is a positive integer, and L is the number of elements in the encrypted web page encoding vector.

[0088] The kth element in the first candidate sequence constructed in S614 is the sum of the elements in the kth row of the marker matrix, and the kth element in the second candidate sequence constructed in S615 is the sum of the elements in the kth column of the marker matrix, where k is a positive integer.

[0089] The first candidate sequence is a sequence consisting of the sum of elements in each row, and the second candidate sequence is a sequence consisting of the sum of elements in each column.

[0090] The formula for constructing the global encryption sequence in S616 is: , where G is the global encryption sequence, X 1 is the first candidate sequence, X 2 is the first candidate sequence, is bitwise multiplication.

[0091] The present invention constructs a flag matrix according to all encrypted web page coding vectors, constructs a first candidate sequence according to elements in each row, constructs a second candidate sequence according to elements in each column, multiplies the first candidate sequence and the second candidate sequence bit by bit, and constructs a global encryption sequence. The global encryption sequence is derived from the encrypted web page coding vector. When the construction rules are unknown, the global encryption sequence cannot be cracked.

[0092] The present invention divides web page data according to content paragraphs in a web page to obtain multiple web page sub-data segments, and encrypts each web page sub-data segment. During encryption, each web page sub-data segment is divided according to a fixed length to obtain multiple web page coding vectors. Each web page sub-data segment is composed of multiple web page coding vectors. Each web page coding vector is first encrypted according to a local encryption sequence, and then each encrypted web page sub-data segment is encrypted again according to a global encryption sequence, thereby achieving double encryption and improving the encryption security of web page data.

[0093] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A web page data encryption method, characterized in that: The following steps are involved: S1. Segment the web page data according to the content paragraphs in the web page to obtain multiple sections of web page sub-data; S2, segmenting each web page sub-data segment according to a fixed length to obtain multiple web page encoding vectors; S3, generating a virtual encoding vector for each web page encoding vector; S4, encrypting each web page coding vector according to the virtual coding vector and based on the local encryption sequence to obtain each encrypted web page coding vector; S5, concatenating multiple encrypted web page encoding vectors to obtain each segment of encrypted web page sub-data; S6. Encrypt each segment of encrypted web page sub-data according to the global encryption sequence to obtain double-encrypted web page sub-data; The S3 comprises the following sub-steps: S31, performing bitwise XOR processing on the webpage coding vector and the first random number to obtain a first random coding vector; S32, performing bitwise XOR processing on the webpage code vector and the second random number to obtain a second random code vector; S33, performing a hash operation on the first random code vector and the second random code vector to obtain a virtual code vector; The S4 comprises the following sub-steps: S41, constructing coding matrices for the virtual coding vector and the webpage coding vector respectively, to obtain a virtual coding matrix and a webpage coding matrix; S42, extracting diagonal elements of the virtual coding matrix to obtain a first local encryption sequence; S43, extracting the diagonal elements of the webpage encoding matrix to obtain a second local encryption sequence; S44, encrypting the webpage encoding vector using a first local encryption sequence to obtain a first encrypted ciphertext; S45, encrypting the webpage encoding vector using a second local encryption sequence to obtain a second encrypted ciphertext; S46, performing bitwise addition processing on the first encrypted ciphertext and the second encrypted ciphertext to obtain an encrypted webpage encoding vector; The expression of the virtual coding matrix in S41 is: A=a T a, where A is a virtual coding matrix, a is a virtual coding vector, and T is a transposition operation; the expression of the web page coding matrix is: B = b T b, where B is the web page encoding matrix and b is the web page encoding vector; The encryption formulas in S44 and S45 are: in, is the nth encrypted element in the first encrypted ciphertext or the second encrypted ciphertext, x m is the mth element in the first partial encryption sequence or the second partial encryption sequence, b n-m is the nmth element in the webpage encoding vector, where n and m are positive integers, and M is the length of the first partial encryption sequence or the second partial encryption sequence; The S6 comprises the following sub-steps: S61, constructing a global encryption sequence according to multiple encrypted web page encoding vectors in each segment of encrypted web page sub-data; S62, performing bitwise XOR processing on the global encryption sequence and the i-th encrypted web page encoding vector in each segment of encrypted web page sub-data to obtain the i-th double encrypted ciphertext, where the initial value of i is 1; S63, performing bitwise XOR processing on the i-th double encrypted ciphertext and the i+1-th encrypted web page encoding vector in each segment of encrypted web page sub-data to obtain the i+1-th double encrypted ciphertext; S64, determine whether i is less than or equal to N-1, if so, jump to step S65, if not, i is incremented by 1, and jump to step S63, where N is the number of encrypted web page encoding vectors; S65, concatenating all double-encrypted ciphertexts to obtain double-encrypted webpage sub-data; The S61 includes the following sub-steps: S611, calculating a flag value according to each encrypted web page encoding vector; S612, constructing all flag values ​​into a flag value vector; S613, construct a flag matrix according to the flag value vector, H = E T E, where H is the flag matrix, E is the flag value vector, and T is the transpose; S614, constructing a first candidate sequence according to the row elements of the marker matrix; S615, constructing a second candidate sequence according to the column elements of the marker matrix; S616. Construct a global encryption sequence according to the first candidate sequence and the second candidate sequence; The formula for calculating the flag value in S611 is: Among them, s is the sign value, e is the natural constant, r i is the i-th element in the encrypted web page encoding vector, i is a positive integer, and L is the number of elements in the encrypted web page encoding vector; The kth element in the first candidate sequence constructed in S614 is the sum of the elements in the kth row of the marker matrix, and the kth element in the second candidate sequence constructed in S615 is the sum of the elements in the kth column of the marker matrix, where k is a positive integer; The formula for constructing the global encryption sequence in S616 is: Among them, G is the global encryption sequence, X1 is the first candidate sequence, X2 is the second candidate sequence, is bitwise multiplication.