Web page URL encryption, decryption method and device, storage medium and electronic device

Through a web page URL encryption method, the mapping function, gene extraction function and signature function are used to generate encrypted cipher text, which solves the problem of crawling software using plain text numbers to crawl enterprise data, and achieves low-cost and efficient data security protection.

CN115378601BActive Publication Date: 2025-05-23BEIJING JINTI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210897449.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2025-05-23
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

In the prior art, plain text numbers in enterprise web URLs are used by crawler software, resulting in increased enterprise data security and service pressure, and the maintenance cost of symmetric encryption algorithms is high.

Method used

A web page URL encryption method is adopted to obtain the plaintext numbers to be encrypted, use the preset mapping function to generate the ciphertext of the ciphertext bit, obtain the random fill strategy based on the ciphertext bit, generate the gene factor value of the interference value and the gene information bit, randomly generate the fill value, use the signature function to generate the signature value of the check bit, and finally combine these values ​​to generate the encrypted ciphertext.

Benefits of technology

It realizes lightweight web URL encryption, reduces the consumption of machine resources, reduces maintenance costs, and at the same time, prevents attacks through self-signature, improving data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115378601B_ABST
    Figure CN115378601B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a webpage URL encryption and decryption method and device, as well as a storage medium and an electronic device, wherein the encryption method includes: obtaining a plaintext number in a webpage URL to be encrypted; generating a ciphertext of a ciphertext position according to the plaintext number; generating an interference value of a ciphertext position and a gene factor value of a gene information position according to the plaintext number and the ciphertext; randomly generating a padding value of a padding position; generating a signature value of a check position using a signature function according to the plaintext number; combining the gene factor value, the padding value and the signature value, as well as the ciphertext and the interference value of the ciphertext position to generate an encrypted ciphertext; generating an encrypted webpage URL according to the encrypted ciphertext. The present invention realizes a lightweight technology for obfuscating numbers, avoids the high cost disadvantage of using a symmetric encryption algorithm in the prior art, increases the difficulty for crawler software to crawl webpage data, and effectively maintains enterprise data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer information processing, and in particular to a web page URL encryption and decryption method and device, as well as a storage medium and an electronic device. Background Art

[0002] At present, the URLs of the details pages of certain types of data of many companies contain plain text numbers, such as http: / / XXX.test.com / id=123. Some external crawler software will use the above rules of web page URLs to crawl the data of the entire website in ascending order of ID, which brings challenges to the data security and service pressure of corporate websites. In the prior art, in response to this situation, mature signature algorithms and symmetric encryption algorithms are generally used to achieve encryption and symmetric decryption. However, the use of symmetric encryption algorithms requires the maintenance of keys on the one hand, and decryption consumes a large amount of machine resources on the other hand, which greatly increases the cost of maintaining corporate data security. Therefore, there is an urgent need for a technology that can provide lightweight encryption obfuscation for internal enterprise data for page-level anti-scraping worms. Summary of the invention

[0003] In order to solve the technical problems in the prior art that crawler software uses the regularity of plain text numbers in the URL of an enterprise webpage to crawl the data of the entire enterprise website, which brings challenges to the enterprise data security and service pressure, and the high cost caused by the common use of symmetric encryption algorithms to maintain data, the present invention is proposed. The embodiments of the present invention provide a webpage URL encryption, solution method and device, as well as a storage medium and an electronic device.

[0004] According to one aspect of an embodiment of the present invention, a webpage URL encryption method is provided, the method comprising:

[0005] Obtain the plaintext number to be encrypted in the URL of the web page to be encrypted;

[0006] According to the plaintext digit, a preset mapping function is used to generate a ciphertext of the ciphertext bit;

[0007] According to the plaintext digit and the ciphertext of the ciphertext bit, a random filling strategy is obtained using a preset gene extraction function;

[0008] Generate interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy;

[0009] Randomly generate padding values ​​for padding bits;

[0010] According to the plaintext number, a signature function is used to generate a signature value of the check digit;

[0011] Combining the gene factor value, the padding value and the signature value, as well as the ciphertext and the interference value of the ciphertext bit, to generate an encrypted ciphertext;

[0012] An encrypted webpage URL is generated according to the encrypted ciphertext.

[0013] Optionally, in the above-mentioned method embodiments of the present invention, generating a ciphertext of a ciphertext bit using a preset mapping function according to the plaintext number includes:

[0014] Extract the number of each digit in the plaintext number, wherein the number of each digit is any natural number from 0 to 9;

[0015] Using a preset mapping function to map the numbers of each digit to obtain a mapping result of the numbers of each digit, wherein the mapping function is a function that maps 0 to 9 to characters respectively, and the mapping result of the numbers of each digit is a character string with a fixed length;

[0016] The mapping results of each digit are combined to generate the ciphertext of the ciphertext bit.

[0017] Optionally, in the above-mentioned method embodiments of the present invention, according to the plaintext number and the ciphertext of the ciphertext bit, a preset gene extraction function is used to obtain a random filling strategy, including:

[0018] Extracting the number of each digit in the plaintext number;

[0019] According to the number of each digit, determine the length of the mapping result of the number of each digit based on the mapping function;

[0020] Determine the ciphertext length of the plaintext number according to the length of the mapping result of each digit;

[0021] Determine the ciphertext bit length according to the ciphertext length of the plaintext number and the preset ciphertext bit length;

[0022] The preset gene extraction function determines the random filling strategy according to the ciphertext bit pseudo-filling length, wherein the gene extraction function is a function that determines the corresponding relationship between the ciphertext bit pseudo-filling length and the random filling strategy, and the random filling strategy includes the ciphertext bit pseudo-filling length and the gene factor value of the gene information bit corresponding to the ciphertext bit pseudo-filling length.

[0023] Optionally, in the above-mentioned method embodiments of the present invention, generating the interference value of the ciphertext bit and the gene factor value of the gene information bit according to the random filling strategy includes:

[0024] Based on the ciphertext bit pseudo-padding length in the random padding strategy, generate a random number equal to the length value of the ciphertext bit pseudo-padding length as a random interference value of the ciphertext bit;

[0025] The gene factor value of the gene information bit corresponding to the proposed filling length of the ciphertext bit in the random filling strategy is filled into the gene information bit.

[0026] Optionally, in the above-mentioned method embodiments of the present invention, the gene factor value, the padding value and the signature value, and the ciphertext and the interference value of the ciphertext bit are combined to generate an encrypted ciphertext, including:

[0027] Using the ciphertext and the interference value of the ciphertext bit as the first field;

[0028] Arrange the gene factor value and the filling value alternately as a second field;

[0029] Use the signature value as the third field;

[0030] The first field, the second field, and the third field are combined in order to generate an encrypted ciphertext.

[0031] Optionally, in the above method embodiments of the present invention, generating an encrypted webpage URL according to the encrypted ciphertext includes:

[0032] Replacing the plaintext numbers to be encrypted in the URL of the webpage to be encrypted with the encrypted ciphertext;

[0033] The web page URL including the encrypted ciphertext is used as the encrypted web page URL.

[0034] According to another aspect of an embodiment of the present invention, a method for decrypting an encrypted webpage URL obtained by using the webpage URL encryption method described in an embodiment of the present invention is provided, the method comprising:

[0035] Get the encrypted ciphertext in the encrypted webpage URL;

[0036] According to the gene factor value of the gene information bit in the encrypted ciphertext, the ciphertext of the ciphertext bit is extracted using a gene reverse restoration function;

[0037] According to the ciphertext of the ciphertext bit, a first plaintext number is obtained using a reverse mapping function;

[0038] Generate a check value using a signature function according to the first plaintext number;

[0039] Determine the plaintext number corresponding to the encrypted ciphertext according to the comparison result of the check value and the signature value of the check bit in the encrypted ciphertext;

[0040] A decrypted webpage URL is generated according to the plaintext number corresponding to the encrypted ciphertext.

[0041] Optionally, in the above-mentioned method embodiments of the present invention, according to the gene factor value of the gene information bit in the encrypted ciphertext, the ciphertext of the ciphertext bit is extracted using a gene reverse restoration function, including:

[0042] According to the gene factor value of the gene information bit in the encrypted ciphertext, the gene reverse restoration function determines the ciphertext bit length to be discarded of the encrypted ciphertext, wherein the gene reverse restoration function is a function that determines the corresponding relationship between the gene factor value of the gene information bit and the ciphertext bit length to be discarded;

[0043] According to the proposed discarded length of ciphertext bits of the encrypted ciphertext and the preset length of the ciphertext bits, the ciphertext of the ciphertext bits is extracted from the encrypted ciphertext.

[0044] Optionally, in the above method embodiments of the present invention, obtaining the first plaintext number using a reverse mapping function according to the ciphertext of the ciphertext bit includes:

[0045] Mapping the ciphertext of the ciphertext bit using a reverse mapping function to determine the number of each digit in the first plaintext number, wherein the reverse mapping function is a function that maps a string of fixed length to any natural number from 0 to 9;

[0046] The numbers of each digit are combined in an order corresponding to the ciphertext of the ciphertext digit to generate a first plaintext number.

[0047] Optionally, in the above-mentioned method embodiments of the present invention, determining the plaintext number corresponding to the encrypted ciphertext according to the comparison result of the check value and the signature value of the check bit in the encrypted ciphertext includes:

[0048] When the check value is equal to the signature value of the check digit in the encrypted ciphertext, determining that the first plaintext number is the plaintext number corresponding to the encrypted ciphertext;

[0049] When the check value is not equal to the signature value of the check bit in the encrypted ciphertext, it is determined that the encrypted ciphertext is a forged ciphertext and the encrypted ciphertext is discarded.

[0050] Optionally, in the above-mentioned method embodiments of the present invention, generating a decrypted webpage URL according to the plaintext number corresponding to the encrypted ciphertext includes:

[0051] Replacing the encrypted ciphertext in the encrypted webpage URL with a plaintext number corresponding to the encrypted ciphertext;

[0052] The web page URL including the plain text number corresponding to the encrypted ciphertext is used as the decrypted web page URL.

[0053] According to another aspect of an embodiment of the present invention, a webpage URL encryption device is provided, the device comprising:

[0054] A plaintext acquisition module is used to obtain the plaintext numbers to be encrypted in the URL of the web page to be encrypted;

[0055] A first ciphertext module, used to generate a ciphertext of a ciphertext bit using a preset mapping function according to the plaintext number;

[0056] A strategy extraction module, for obtaining a random filling strategy using a preset gene extraction function according to the plaintext number and the ciphertext of the ciphertext position;

[0057] A first filling module, used to generate interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy;

[0058] A second filling module, used for randomly generating a filling value of a filling bit;

[0059] A signature generation module, used to generate a signature value of a check digit using a signature function according to the plaintext number;

[0060] An encryption ciphertext module, used for combining the gene factor value, padding value and signature value, as well as the ciphertext and interference value of the ciphertext bit, to generate an encrypted ciphertext;

[0061] The encryption result module is used to generate an encrypted webpage URL according to the encrypted ciphertext.

[0062] Optionally, in the above-mentioned device embodiments of the present invention, the first ciphertext module includes:

[0063] A first extraction unit is used to extract the number of each digit in the plaintext number, wherein the number of each digit is any natural number from 0 to 9;

[0064] A digital mapping unit, used to map the digits of each digit using a preset mapping function to obtain a mapping result of the digits of each digit, wherein the mapping function is a function that maps 0 to 9 to characters respectively, and the mapping result of the digits of each digit is a character string with a fixed length;

[0065] The first ciphertext unit is used to combine the mapping results of each digit to generate a ciphertext of the ciphertext bit.

[0066] Optionally, in the above-mentioned device embodiments of the present invention, the policy extraction module includes:

[0067] A second extraction unit, used to extract the number of each digit in the plaintext number;

[0068] A random strategy unit is used to determine the length of the mapping result of each digit based on the mapping function according to the number of each digit; determine the ciphertext length of the plaintext number according to the length of the mapping result of each digit; determine the ciphertext bit pseudo-filling length according to the ciphertext length of the plaintext number and a preset ciphertext bit length; use a preset gene extraction function to determine the random filling strategy according to the ciphertext bit pseudo-filling length, wherein the gene extraction function is a function for determining the corresponding relationship between the ciphertext bit pseudo-filling length and the random filling strategy, and the random filling strategy includes the ciphertext bit pseudo-filling length and the gene factor value of the gene information bit corresponding to the ciphertext bit pseudo-filling length.

[0069] Optionally, in each of the above-mentioned device embodiments of the present invention, the first filling module generates the interference value of the ciphertext bit and the gene factor value of the gene information bit according to the random filling strategy, including:

[0070] Based on the ciphertext bit pseudo-padding length in the random padding strategy, generate a random number equal to the length value of the ciphertext bit pseudo-padding length as a random interference value of the ciphertext bit;

[0071] The gene factor value of the gene information bit corresponding to the proposed filling length of the ciphertext bit in the random filling strategy is filled into the gene information bit.

[0072] Optionally, in the above-mentioned device embodiments of the present invention, the encryption ciphertext module includes:

[0073] A first field unit, for using the ciphertext and the interference value of the ciphertext bit as a first field;

[0074] A second field unit is used to arrange the gene factor value and the filling value alternately as a second field;

[0075] A third field unit, used to use the signature value as the third field;

[0076] The field combination unit is used to combine the first field, the second field and the third field in order to generate an encrypted ciphertext.

[0077] Optionally, in each of the above-mentioned device embodiments of the present invention, the encryption result module generates an encrypted webpage URL according to the encrypted ciphertext, including:

[0078] Replacing the plaintext numbers to be encrypted in the URL of the webpage to be encrypted with the encrypted ciphertext;

[0079] The web page URL including the encrypted ciphertext is used as the encrypted web page URL.

[0080] According to another aspect of an embodiment of the present invention, a webpage URL decryption device is provided, the device comprising:

[0081] A ciphertext acquisition module is used to obtain the encrypted ciphertext in the encrypted webpage URL;

[0082] A second ciphertext module is used to extract the ciphertext of the ciphertext position using a gene reverse restoration function according to the gene factor value of the gene information position in the encrypted ciphertext;

[0083] A reverse mapping module, configured to obtain a first plaintext number using a reverse mapping function according to the ciphertext of the ciphertext bit;

[0084] A check value module, used to generate a check value using a signature function according to the first plaintext number;

[0085] A ciphertext verification module, used to determine the plaintext number corresponding to the encrypted ciphertext according to a comparison result between the verification value and the signature value of the check bit in the encrypted ciphertext;

[0086] The decryption result module is used to generate a decrypted web page URL according to the plain text number corresponding to the encrypted ciphertext.

[0087] Optionally, in each of the above-mentioned device embodiments of the present invention, the second ciphertext module extracts the ciphertext of the ciphertext bit using the gene reverse restoration function according to the gene factor value of the gene information bit in the encrypted ciphertext, including:

[0088] According to the gene factor value of the gene information bit in the encrypted ciphertext, the gene reverse restoration function determines the ciphertext bit length to be discarded of the encrypted ciphertext, wherein the gene reverse restoration function is a function that determines the corresponding relationship between the gene factor value of the gene information bit and the ciphertext bit length to be discarded;

[0089] According to the proposed discarded length of ciphertext bits of the encrypted ciphertext and the preset length of the ciphertext bits, the ciphertext of the ciphertext bits is extracted from the encrypted ciphertext.

[0090] Optionally, in the above-mentioned device embodiments of the present invention, the reverse mapping module includes:

[0091] a ciphertext mapping unit, configured to map the ciphertext of the ciphertext bit by using a reverse mapping function to determine the number of each digit in the first plaintext number, wherein the reverse mapping function is a function that maps a character string with a fixed length to any natural number from 0 to 9;

[0092] The digital combination unit is used to combine the numbers of each digit in the order corresponding to the ciphertext of the ciphertext position to generate a first plaintext number.

[0093] Optionally, in each of the above-mentioned device embodiments of the present invention, the ciphertext verification module determines the plaintext number corresponding to the encrypted ciphertext according to the comparison result of the verification value and the signature value of the check bit in the encrypted ciphertext, including:

[0094] When the check value is equal to the signature value of the check digit in the encrypted ciphertext, determining that the first plaintext number is the plaintext number corresponding to the encrypted ciphertext;

[0095] When the check value is not equal to the signature value of the check bit in the encrypted ciphertext, it is determined that the encrypted ciphertext is a forged ciphertext and the encrypted ciphertext is discarded.

[0096] Optionally, in each of the above-mentioned device embodiments of the present invention, the decryption result module generates a decrypted webpage URL according to the plaintext number corresponding to the encrypted ciphertext, including:

[0097] Replacing the encrypted ciphertext in the encrypted webpage URL with a plaintext number corresponding to the encrypted ciphertext;

[0098] The web page URL including the plain text number corresponding to the encrypted ciphertext is used as the decrypted web page URL.

[0099] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the method described in any of the above embodiments of the present invention.

[0100] According to another aspect of an embodiment of the present invention, there is provided an electronic device, the electronic device comprising:

[0101] processor;

[0102] a memory for storing instructions executable by the processor;

[0103] The processor is used to read the executable instructions from the memory and execute the instructions to implement the method described in any one of the above embodiments of the present invention.

[0104] Based on the web page URL encryption and decryption method and device provided by the above embodiment of the present invention, as well as the storage medium and electronic device, the web page URL encryption method includes: obtaining the plaintext number to be encrypted in the web page URL to be encrypted; according to the plaintext number, using a preset mapping function to generate the ciphertext of the ciphertext position; according to the plaintext number and the ciphertext of the ciphertext position, using a preset gene extraction function to obtain a random filling strategy; according to the random filling strategy, generating the interference value of the ciphertext position and the gene factor value of the gene information position; randomly generating the filling value of the filling position; according to the plaintext number, using a signature function to generate the signature value of the check position; combining the gene factor value, the filling value and the signature value, and the ciphertext and the interference value of the ciphertext position to generate an encrypted ciphertext; generating an encrypted web page URL according to the encrypted ciphertext. The web page URL decryption method adopts a reverse approach to the encryption method to parse and verify the obtained encrypted ciphertext, thereby obtaining the correct plaintext number in the web page URL. The web page URL encryption and decryption method and device, as well as the storage medium and electronic device realize a lightweight technology for obfuscating numbers, avoiding the high cost disadvantage of the symmetric encryption algorithm used in the prior art. At the same time, the encrypted ciphertext is self-signed and the decrypted ciphertext is verified, avoiding middlemen from attacking and tampering with the web page URL, thereby realizing encrypted obfuscation processing of the web page URL, making it more difficult for crawler software to crawl web page data, and effectively maintaining the security of enterprise data.

[0105] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0106] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0107] Figure 1 It is a flowchart of a webpage URL encryption method provided by an exemplary embodiment of the present invention;

[0108] Figure 2 is a schematic diagram of a webpage URL encryption process provided by an exemplary embodiment of the present invention;

[0109] Figure 3 It is a flowchart of a webpage URL decryption method provided by an exemplary embodiment of the present invention;

[0110] Figure 4 It is a structural schematic diagram of a webpage URL encryption device provided by an exemplary embodiment of the present invention;

[0111] Figure 5 is a schematic structural diagram of a first ciphertext module provided by an exemplary embodiment of the present invention;

[0112] Figure 6 is a schematic diagram of the structure of a policy extraction module provided by an exemplary embodiment of the present invention;

[0113] Figure 7 is a schematic diagram of the structure of an encryption ciphertext module provided by an exemplary embodiment of the present invention;

[0114] Figure 8 It is a structural diagram of a webpage URL decryption device provided by an exemplary embodiment of the present invention;

[0115] Fig. 9 is a schematic structural diagram of a reverse mapping module provided by an exemplary embodiment of the present invention;

[0116] Fig.10 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0117] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.

[0118] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.

[0119] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present invention are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0120] It should also be understood that, in the embodiments of the present invention, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.

[0121] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0122] In addition, the term "and / or" in the present invention is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects before and after are in an "or" relationship.

[0123] It should also be understood that the description of the various embodiments of the present invention focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0124] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0125] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0126] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0127] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0128] Embodiments of the present invention can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0129] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0130] Exemplary Method 1

[0131] Figure 1 FIG. 1 is a flow chart of a webpage URL encryption method provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as Figure 1 As shown, the following steps are included:

[0132] Step 101, obtaining the plaintext number to be encrypted in the URL of the web page to be encrypted.

[0133] Usually, the plaintext number is located at the end of the webpage URL. For example, when the webpage URL is http: / / XXX.test.com / id=123 or http: / / XXX.test.com / 123.html, the plaintext number to be encrypted extracted from the webpage URL is 123.

[0134] Figure 2 FIG. 1 is a schematic diagram of a webpage URL encryption process provided by an exemplary embodiment of the present invention. Figure 2 As shown, for a known webpage URL: http: / / XXX.test.com / id=123, its plaintext number m=123, in this example, the plaintext number 123 will be lightly obfuscated and encrypted according to the set ciphertext format.

[0135] Step 102: Generate ciphertext of ciphertext bits using a preset mapping function according to the plaintext digits.

[0136] Preferably, according to the plaintext digit, a preset mapping function is used to generate the ciphertext of the ciphertext bit, including:

[0137] Extract the number of each digit in the plaintext number, wherein the number of each digit is any natural number from 0 to 9;

[0138] Using a preset mapping function to map the numbers of each digit to obtain a mapping result of the numbers of each digit, wherein the mapping function is a function that maps 0 to 9 to characters respectively, and the mapping result of the numbers of each digit is a character string with a fixed length;

[0139] The mapping results of each digit are combined to generate the ciphertext of the ciphertext bit.

[0140] In one embodiment, a mapping function f(x) is preset, wherein x is a natural number 0-9, and the mapping function f(x) maps 0-9 to strings of fixed length, respectively, and the characters may include [0-9, az, AZ, ~! @#¥%……&*()]. Figure 2 The plaintext number m=123 in the number is 3 digits, and the numbers on each digit are 1, 2, and 3. Then the mapping function f(x) is used to map the numbers 1, 2, and 3 respectively. After obtaining the mapping results, they are combined to generate the ciphertext v41vmz4a93 of the ciphertext bit, and fill it to the 0-9 digits of the ciphertext bit. At this time, through Figure 2 It can be seen that bits 10-21 in the ciphertext are missing.

[0141] Step 103, according to the plaintext number and the ciphertext of the ciphertext bit, a preset gene extraction function is used to obtain a random filling strategy.

[0142] Preferably, according to the plaintext number and the ciphertext of the ciphertext bit, a preset gene extraction function is used to obtain a random filling strategy, including:

[0143] Extracting the number of each digit in the plaintext number;

[0144] According to the number of each digit, determine the length of the mapping result of the number of each digit based on the mapping function;

[0145] Determine the ciphertext length of the plaintext number according to the length of the mapping result of each digit;

[0146] Determine the ciphertext bit length according to the ciphertext length of the plaintext number and the preset ciphertext bit length;

[0147] The preset gene extraction function determines the random filling strategy according to the ciphertext bit pseudo-filling length, wherein the gene extraction function is a function that determines the corresponding relationship between the ciphertext bit pseudo-filling length and the random filling strategy, and the random filling strategy includes the ciphertext bit pseudo-filling length and the gene factor value of the gene information bit corresponding to the ciphertext bit pseudo-filling length.

[0148] Step 104: Generate interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy.

[0149] Preferably, generating the interference value of the ciphertext bit and the gene factor value of the gene information bit according to the random filling strategy includes:

[0150] Based on the ciphertext bit pseudo-padding length in the random padding strategy, generate a random number equal to the length value of the ciphertext bit pseudo-padding length as a random interference value of the ciphertext bit;

[0151] The gene factor value of the gene information bit corresponding to the proposed filling length of the ciphertext bit in the random filling strategy is filled into the gene information bit.

[0152] In one embodiment, after the mapping function f(x) is established for the plaintext, in order to make the ciphertext complete, it is necessary to fill the vacant positions outside the ciphertext, and at the same time, it is necessary to effectively distinguish the ciphertext and the filled values. Therefore, this embodiment sets a gene extraction function g(f(x)). Figure 2 As shown, after extracting the numbers 1, 2 and 3 of each digit in the plaintext number, the length of the mapping results of the numbers 1, 2 and 3 is determined based on the mapping results of the mapping function f(x) for the numbers 1, 2 and 3, and the sum of them determines that the ciphertext length of the plaintext number 123 is 10 bits. Since the preset ciphertext length is 22 bits, it can be determined that the length of the ciphertext to be filled is 12 bits. When the length of the ciphertext to be filled is determined to be 12 bits, the gene extraction function can determine the random filling strategy corresponding to the ciphertext bit to be filled length according to the predetermined correspondence between the ciphertext length to be filled and the random filling strategy, and determine the gene factor value of the gene information bit corresponding to the ciphertext bit to be filled length from the random filling strategy. According to Figure 2 It can be seen that the present embodiment includes three gene information bits, 22 bits, 25 bits and 30 bits respectively, and their gene factor values ​​are 1, I and e respectively. For the 12 bits to be filled in the ciphertext bit, a 12-bit random number 637cb35rbdfb is randomly generated as an interference value. By using the gene extraction function to generate the gene factor, the ciphertext bit generated according to the mapping function can be self-explanatory.

[0153] Step 105: randomly generate a padding value for the padding bit.

[0154] In one embodiment, Figure 2 As shown, for the padding bits 23-24 and 26 to 29, random numbers be and fdvf are generated as padding values, respectively.

[0155] Step 106: Generate a signature value of the check digit using a signature function according to the plaintext number.

[0156] For the plaintext numbers to be encrypted in the obtained URL, a signature function can be pre-generated for signing to obtain the signature value of the check digit. The signature function can generate a value for each digit in the plaintext number, and then perform a comprehensive operation on each generated value to determine the signature value, or it can be an exhaustive enumeration of the plaintext numbers, and then generate a signature value for each plaintext number. The signature is mainly used to detect forgery. For example, the original plaintext number is signed to obtain a unique signature value for the check digit. Then, when the signature is verified during decryption, if it is found that the obtained check value is inconsistent with the signature value of the check digit in the encrypted ciphertext, it can be said that there is a counterfeit encryption behavior. From Figure 2 It can be seen that in this embodiment, when the plaintext number is 123, the signature value of the check digit generated by the signature function is 7.

[0157] Step 107, combining the gene factor value, padding value and signature value, as well as the ciphertext and interference value of the ciphertext bit to generate an encrypted ciphertext.

[0158] Preferably, the gene factor value, the padding value and the signature value, as well as the ciphertext and the interference value of the ciphertext bit are combined to generate an encrypted ciphertext, including:

[0159] Using the ciphertext and the interference value of the ciphertext bit as the first field;

[0160] Arrange the gene factor value and the filling value alternately as a second field;

[0161] Use the signature value as the third field;

[0162] The first field, the second field, and the third field are combined in order to generate an encrypted ciphertext.

[0163] In one embodiment, from Figure 2 It can be seen that the ciphertext bits are 0 to 21, which are used as the first field, the gene information bits are 22, 25 and 30, and the 23-24 and 26-29 bits as the filling bits are arranged alternately as the second field, and the check bit 31 is used as the third field. They are combined in the order of the first field, the second field and the third field, and the encrypted ciphertext y=v41vmz4a93637cb354befb1belfdvfe7 of the plaintext number 123 is obtained.

[0164] Step 108, generating an encrypted web page URL according to the encrypted ciphertext.

[0165] Preferably, generating an encrypted webpage URL according to the encrypted ciphertext includes:

[0166] Replacing the plaintext numbers to be encrypted in the URL of the webpage to be encrypted with the encrypted ciphertext;

[0167] The web page URL including the encrypted ciphertext is used as the encrypted web page URL.

[0168] In one embodiment, when the corresponding encrypted ciphertext v41vmz4a93637cb354befb1belfdvfe7 is obtained according to the plaintext number 123, the web page URL to be encrypted can be generated according to the encrypted ciphertext: http: / / XXX.test.com / id=123. The encrypted web page URL is: http: / / XXX.test.com / id=v41vmz4a93637cb354befb1belfdvfe7.

[0169] The webpage URL encryption method described in this embodiment protects the security of internal enterprise data and prevents web crawlers from sequentially traversing and crawling URLs. At the same time, compared with the encryption using symmetric encryption algorithms in the prior art, this method is a lightweight obfuscated encryption. At the same time, it can also prevent attacks through self-signatures, which has the same technical effect as the prior art while greatly saving encryption and decryption costs.

[0170] Exemplary Method 2

[0171] Figure 3 FIG. 1 is a flow chart of a webpage URL decryption method provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as Figure 3 As shown, the following steps are included:

[0172] In step 201, the encrypted ciphertext in the encrypted webpage URL is obtained.

[0173] In step 202, according to the gene factor value of the gene information bit in the encrypted ciphertext, a gene reverse restoration function is used to extract the ciphertext of the ciphertext bit.

[0174] Preferably, according to the gene factor value of the gene information bit in the encrypted ciphertext, the ciphertext of the ciphertext bit is extracted using a gene reverse restoration function, including:

[0175] According to the gene factor value of the gene information bit in the encrypted ciphertext, the gene reverse restoration function determines the ciphertext bit length to be discarded of the encrypted ciphertext, wherein the gene reverse restoration function is a function that determines the corresponding relationship between the gene factor value of the gene information bit and the ciphertext bit length to be discarded;

[0176] According to the proposed discarded length of ciphertext bits of the encrypted ciphertext and the preset length of the ciphertext bits, the ciphertext of the ciphertext bits is extracted from the encrypted ciphertext.

[0177] In step 203, a first plaintext number is obtained using a reverse mapping function according to the ciphertext of the ciphertext bit.

[0178] Preferably, according to the ciphertext of the ciphertext bit, using a reverse mapping function to obtain the first plaintext number comprises:

[0179] Mapping the ciphertext of the ciphertext bit using a reverse mapping function to determine the number of each digit in the first plaintext number, wherein the reverse mapping function is a function that maps a string of fixed length to any natural number from 0 to 9;

[0180] The numbers of each digit are combined in an order corresponding to the ciphertext of the ciphertext digit to generate a first plaintext number.

[0181] In step 204, a check value is generated using a signature function according to the first plaintext number.

[0182] In step 205, the plaintext number corresponding to the encrypted ciphertext is determined based on the comparison result between the check value and the signature value of the check digit in the encrypted ciphertext.

[0183] Preferably, determining the plaintext number corresponding to the encrypted ciphertext according to the comparison result of the check value and the signature value of the check bit in the encrypted ciphertext includes:

[0184] When the check value is equal to the signature value of the check digit in the encrypted ciphertext, determining that the first plaintext number is the plaintext number corresponding to the encrypted ciphertext;

[0185] When the check value is not equal to the signature value of the check bit in the encrypted ciphertext, it is determined that the encrypted ciphertext is a forged ciphertext and the encrypted ciphertext is discarded.

[0186] In step 206, a decrypted webpage URL is generated according to the plaintext number corresponding to the encrypted ciphertext.

[0187] Preferably, generating a decrypted webpage URL according to the plaintext number corresponding to the encrypted ciphertext includes:

[0188] Replacing the encrypted ciphertext in the encrypted webpage URL with a plaintext number corresponding to the encrypted ciphertext;

[0189] The web page URL including the plain text number corresponding to the encrypted ciphertext is used as the decrypted web page URL.

[0190] In one embodiment, the encrypted webpage URL: http: / / XXX.test.com / id=v41vmz4a93637cb354befb1belfdvfe7 generated by the webpage URL encryption method of this embodiment is extracted to obtain the encrypted ciphertext v41vmz4a93637cb354befb1belfdvfe7. Since the gene information bit has been specified in the ciphertext format, according to the values ​​1, I and e of the gene factor in the gene information bit, the corresponding relationship between the gene factor in the gene information bit specified by the gene reverse reduction function and the ciphertext bit to be discarded length can be known that the ciphertext bit to be discarded length of the encrypted ciphertext is the same as the to-be-filled length in the gene extraction function, which is 12 bits, and the result of the ciphertext bit of the encrypted ciphertext after discarding the interference value is v41vmz4a93. Since there is a symmetric relationship between the reverse mapping function and the mapping function f(x), the reverse mapping function f'(x) is a function that maps a string with a fixed length to any natural number from 0 to 9. Therefore, it can be known from the reverse mapping function that the numbers corresponding to v41vmz4a93 are 1, 2, and 3 respectively. According to their arrangement order, the first plaintext number 123 can be obtained. In order to prevent tampering with the encrypted ciphertext, it is necessary to verify the result through the signature value of the check bit in the encrypted ciphertext. The specific method is to substitute the obtained first plaintext number into the signature function to generate the check value of the check bit. When the check value is the same as the signature value of the check bit in the obtained encrypted ciphertext, it means that the encrypted ciphertext has not been tampered with. At this time, the encrypted webpage URL can be obtained after decryption: http: / / XXX.test.com / id=123.

[0191] Exemplary device 1

[0192] Figure 4 FIG. 1 is a schematic diagram of the structure of a webpage URL encryption device provided by an exemplary embodiment of the present invention. Figure 4 As shown, the webpage URL encryption device described in this embodiment includes:

[0193] The plaintext acquisition module 301 is used to obtain the plaintext numbers to be encrypted in the URL of the webpage to be encrypted;

[0194] A first ciphertext module 302, configured to generate a ciphertext of a ciphertext bit using a preset mapping function according to the plaintext number;

[0195] A strategy extraction module 303, for obtaining a random filling strategy using a preset gene extraction function according to the plaintext number and the ciphertext of the ciphertext position;

[0196] A first filling module 304, used to generate interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy;

[0197] A second filling module 305, used to randomly generate a filling value for a filling bit;

[0198] The signature generation module 306 is used to generate a signature value of a check digit using a signature function according to the plaintext number;

[0199] The encrypted ciphertext module 307 is used to combine the gene factor value, the padding value and the signature value, and the ciphertext and the interference value of the ciphertext bit to generate an encrypted ciphertext;

[0200] The encryption result module 308 is used to generate an encrypted webpage URL according to the encrypted ciphertext.

[0201] Figure 5 is a schematic diagram of the structure of a first ciphertext module provided by an exemplary embodiment of the present invention. Figure 5 As shown, the first ciphertext module in this embodiment includes:

[0202] A first extraction unit 321 is used to extract the number of each digit in the plaintext number, wherein the number of each digit is any natural number from 0 to 9;

[0203] A digital mapping unit 322 is used to map the digits of each digit using a preset mapping function to obtain a mapping result of the digits of each digit, wherein the mapping function is a function that maps 0 to 9 to characters respectively, and the mapping result of the digits of each digit is a character string with a fixed length;

[0204] The first ciphertext unit 323 is used to combine the mapping results of each digit to generate a ciphertext of the ciphertext bit.

[0205] Figure 6 FIG. 1 is a schematic diagram of the structure of a strategy extraction module provided by an exemplary embodiment of the present invention. Figure 6 As shown, the policy extraction module in this embodiment includes:

[0206] A second extraction unit 331 is used to extract the number of each digit in the plain text number;

[0207] The random strategy unit 332 is used to determine the length of the mapping result of each digit based on the mapping function according to the number of each digit; determine the ciphertext length of the plaintext number according to the length of the mapping result of each digit; determine the ciphertext bit pseudo-filling length according to the ciphertext length of the plaintext number and a preset ciphertext bit length; use a preset gene extraction function to determine the random filling strategy according to the ciphertext bit pseudo-filling length, wherein the gene extraction function is a function that determines the corresponding relationship between the ciphertext bit pseudo-filling length and the random filling strategy, and the random filling strategy includes the ciphertext bit pseudo-filling length and the gene factor value of the gene information bit corresponding to the ciphertext bit pseudo-filling length.

[0208] Preferably, the first filling module 304 generates interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy, including:

[0209] Based on the ciphertext bit pseudo-padding length in the random padding strategy, generate a random number equal to the length value of the ciphertext bit pseudo-padding length as a random interference value of the ciphertext bit;

[0210] The gene factor value of the gene information bit corresponding to the proposed filling length of the ciphertext bit in the random filling strategy is filled into the gene information bit.

[0211] Figure 7 Schematic diagram of the structure of an encryption ciphertext module provided by an exemplary embodiment of the present invention. Figure 7 As shown, the encryption ciphertext module described in this embodiment includes:

[0212] A first field unit 371, configured to use the ciphertext and the interference value of the ciphertext bit as a first field;

[0213] The second field unit 372 is used to arrange the gene factor value and the filling value alternately as a second field;

[0214] The third field unit 373 is used to use the signature value as the third field;

[0215] The field combining unit 374 is used to combine the first field, the second field and the third field in order to generate an encrypted ciphertext.

[0216] Preferably, the encryption result module 308 generates an encrypted webpage URL according to the encrypted ciphertext, including:

[0217] Replacing the plaintext numbers to be encrypted in the URL of the webpage to be encrypted with the encrypted ciphertext;

[0218] The web page URL including the encrypted ciphertext is used as the encrypted web page URL.

[0219] The steps of encrypting the web page URL to be encrypted by the web page URL encryption device described in this embodiment are the same as those of the web page URL encryption method, which obtains the plaintext numbers to be encrypted in the web page URL to be encrypted, encrypts the plaintext numbers to generate encrypted ciphertext of the ciphertext bits, determines the gene factors of the gene information bits through the gene extraction function, generates the signature value of the check bits through the signature function, and randomly fills the padding bits and the ciphertext bits except the encrypted ciphertext, and the technical effects achieved are also the same, which will not be repeated here.

[0220] Exemplary device 2

[0221] Figure 8 FIG. 1 is a schematic diagram of the structure of a webpage URL decryption device provided by an exemplary embodiment of the present invention. Figure 8 As shown, the webpage URL decryption device described in this embodiment includes:

[0222] The ciphertext acquisition module 401 is used to acquire the encrypted ciphertext in the encrypted webpage URL;

[0223] The second ciphertext module 402 is used to extract the ciphertext of the ciphertext bit using the gene reverse restoration function according to the gene factor value of the gene information bit in the encrypted ciphertext;

[0224] A reverse mapping module 403, configured to obtain a first plaintext number using a reverse mapping function according to the ciphertext of the ciphertext bit;

[0225] A check value module 404, configured to generate a check value using a signature function according to the first plaintext number;

[0226] A ciphertext verification module 405, configured to determine a plaintext number corresponding to the encrypted ciphertext according to a comparison result between the verification value and a signature value of a check digit in the encrypted ciphertext;

[0227] The decryption result module 406 is used to generate a decrypted webpage URL according to the plaintext number corresponding to the encrypted ciphertext.

[0228] Preferably, the second ciphertext module 402 extracts the ciphertext of the ciphertext bit using a gene reverse restoration function according to the gene factor value of the gene information bit in the encrypted ciphertext, including:

[0229] According to the gene factor value of the gene information bit in the encrypted ciphertext, the gene reverse restoration function determines the ciphertext bit length to be discarded of the encrypted ciphertext, wherein the gene reverse restoration function is a function that determines the corresponding relationship between the gene factor value of the gene information bit and the ciphertext bit length to be discarded;

[0230] According to the proposed discarded length of ciphertext bits of the encrypted ciphertext and the preset length of the ciphertext bits, the ciphertext of the ciphertext bits is extracted from the encrypted ciphertext.

[0231] Fig. 9 FIG. 1 is a schematic diagram of the structure of a reverse mapping module provided by an exemplary embodiment of the present invention. Fig. 9 As shown, the reverse mapping module 403 in this embodiment includes:

[0232] A ciphertext mapping unit 431 is used to map the ciphertext of the ciphertext bit using a reverse mapping function to determine the number of each digit in the first plaintext number, wherein the reverse mapping function is a function that maps a string of fixed length to any natural number from 0 to 9;

[0233] The digital combination unit 432 is used to combine the numbers of each digit in the order corresponding to the ciphertext of the ciphertext position to generate a first plaintext number.

[0234] Preferably, the ciphertext verification module 405 determines the plaintext number corresponding to the encrypted ciphertext according to the comparison result of the verification value and the signature value of the check bit in the encrypted ciphertext, including:

[0235] When the check value is equal to the signature value of the check digit in the encrypted ciphertext, determining that the first plaintext number is the plaintext number corresponding to the encrypted ciphertext;

[0236] When the check value is not equal to the signature value of the check bit in the encrypted ciphertext, it is determined that the encrypted ciphertext is a forged ciphertext and the encrypted ciphertext is discarded.

[0237] Preferably, the decryption result module 406 generates a decrypted webpage URL according to the plaintext number corresponding to the encrypted ciphertext, including:

[0238] Replacing the encrypted ciphertext in the encrypted webpage URL with a plaintext number corresponding to the encrypted ciphertext;

[0239] The web page URL including the plain text number corresponding to the encrypted ciphertext is used as the decrypted web page URL.

[0240] The steps of decrypting the encrypted web page URL by the web page URL decryption device described in this embodiment are the same as those of the web page URL decryption method. After obtaining the encrypted ciphertext in the encrypted web page URL, the length of the ciphertext bits to be discarded of the encrypted ciphertext is determined through the gene reverse restoration function to determine the ciphertext of the ciphertext bits, and then the first plaintext number corresponding to the ciphertext of the ciphertext bits is determined according to the reverse mapping function. Through the signature function, a check value of the check bit is generated according to the first plaintext number, and compared with the signature value of the check bit in the encrypted ciphertext to determine whether the first plaintext number is the plaintext number corresponding to the encrypted ciphertext, thereby finally determining the steps of the web page URL after decryption of the encrypted web page URL, and the technical effects achieved are also the same, which will not be repeated here.

[0241] Exemplary Electronic Devices

[0242] Fig.10 The electronic device provided by an exemplary embodiment of the present invention may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signals from them. Fig.10 FIG. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure. Fig.10 As shown, the electronic device includes one or more processors 1001 and a memory 1002 .

[0243] The processor 1001 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0244] The memory 1002 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1001 may run the program instructions to implement the webpage URL encryption method and webpage URL decryption method of the software program of each embodiment of the present disclosure described above and / or other desired functions. In one example, the electronic device may also include: an input device 1003 and an output device 1004, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0245] In addition, the input device 1003 may also include, for example, a keyboard, a mouse, and the like.

[0246] The output device 1004 can output various information to the outside. The output device 1004 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto.

[0247] Of course, to simplify, Fig.10 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.

[0248] Exemplary computer program products and computer-readable storage media

[0249] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the web page URL encryption method and web page URL decryption method according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

[0250] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0251] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, causes the processor to execute the steps of the web page URL encryption method and web page URL decryption method according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0252] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0253] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0254] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0255] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with it.

[0256] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0257] It should also be noted that in the apparatus, equipment and method of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present disclosure. The above description of the disclosed aspects is provided to enable any technician in the field to make or use the present disclosure. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown here, but to the widest scope consistent with the principles and novel features disclosed herein.

[0258] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A web page URL encryption method, It is characterized in that The method comprises: Obtain the plaintext number to be encrypted in the URL of the web page to be encrypted; According to the plaintext number, a ciphertext of the ciphertext bit is generated using a preset mapping function, including: Extract the number of each digit in the plaintext number, wherein the number of each digit is any natural number from 0 to 9; Using a preset mapping function to map the numbers of each digit to obtain a mapping result of the numbers of each digit, wherein the mapping function is a function that maps 0 to 9 to characters respectively, and the mapping result of the numbers of each digit is a character string with a fixed length; The mapping results of each digit are combined to generate the ciphertext of the ciphertext bit; According to the plaintext number and the ciphertext of the ciphertext bit, a random filling strategy is obtained using a preset gene extraction function, including: Extracting the number of each digit in the plaintext number; According to the number of each digit, determine the length of the mapping result of the number of each digit based on the mapping function; Determine the ciphertext length of the plaintext number according to the length of the mapping result of each digit; Determine the ciphertext bit length according to the ciphertext length of the plaintext number and the preset ciphertext bit length; The preset gene extraction function determines the random filling strategy according to the ciphertext bit pseudo-filling length, wherein the gene extraction function is a function that determines the corresponding relationship between the ciphertext bit pseudo-filling length and the random filling strategy, and the random filling strategy includes the ciphertext bit pseudo-filling length and the gene factor value of the gene information bit corresponding to the ciphertext bit pseudo-filling length; Generate interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy; Randomly generate padding values ​​for padding bits; According to the plaintext number, a signature function is used to generate a signature value of the check digit; Combining the gene factor value, the padding value and the signature value, as well as the ciphertext and the interference value of the ciphertext bit, to generate an encrypted ciphertext; An encrypted webpage URL is generated according to the encrypted ciphertext.

2. The method according to claim 1, It is characterized in that Generating interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy includes: Based on the ciphertext bit pseudo-padding length in the random padding strategy, generate a random number equal to the length value of the ciphertext bit pseudo-padding length as a random interference value of the ciphertext bit; The gene factor value of the gene information bit corresponding to the proposed filling length of the ciphertext bit in the random filling strategy is filled into the gene information bit.

3. The method according to claim 1, It is characterized in that The gene factor value, the padding value and the signature value, as well as the ciphertext and the interference value of the ciphertext bit are combined to generate an encrypted ciphertext, including: Using the ciphertext and the interference value of the ciphertext bit as the first field; Arrange the gene factor value and the filling value alternately as a second field; Use the signature value as the third field; The first field, the second field, and the third field are combined in order to generate an encrypted ciphertext.

4. The method according to claim 1, It is characterized in that Generating an encrypted webpage URL according to the encrypted ciphertext includes: Replacing the plaintext numbers to be encrypted in the URL of the webpage to be encrypted with the encrypted ciphertext; The web page URL including the encrypted ciphertext is used as the encrypted web page URL.

5. A method for decrypting a webpage URL encrypted in any one of claims 1 to 4, It is characterized in that The method comprises: Get the encrypted ciphertext in the encrypted webpage URL; According to the gene factor value of the gene information bit in the encrypted ciphertext, the ciphertext of the ciphertext bit is extracted using a gene reverse restoration function, including: According to the gene factor value of the gene information bit in the encrypted ciphertext, the gene reverse restoration function determines the ciphertext bit length to be discarded of the encrypted ciphertext, wherein the gene reverse restoration function is a function that determines the corresponding relationship between the gene factor value of the gene information bit and the ciphertext bit length to be discarded; Extracting the ciphertext of the ciphertext bits from the encrypted ciphertext according to the ciphertext bits to be discarded length of the encrypted ciphertext and the preset length of the ciphertext bits; According to the ciphertext of the ciphertext bit, a first plaintext number is obtained using a reverse mapping function; Generate a check value using a signature function according to the first plaintext number; Determine the plaintext number corresponding to the encrypted ciphertext according to the comparison result of the check value and the signature value of the check bit in the encrypted ciphertext; A decrypted webpage URL is generated according to the plaintext number corresponding to the encrypted ciphertext.

6. The method according to claim 5, It is characterized in that According to the ciphertext of the ciphertext bit, a first plaintext number is obtained by using a reverse mapping function, comprising: Mapping the ciphertext of the ciphertext bit using a reverse mapping function to determine the number of each digit in the first plaintext number, wherein the reverse mapping function is a function that maps a string of fixed length to any natural number from 0 to 9; The numbers of each digit are combined in an order corresponding to the ciphertext of the ciphertext digit to generate a first plaintext number.

7. The method according to claim 5, It is characterized in that Determining the plaintext number corresponding to the encrypted ciphertext according to the comparison result between the check value and the signature value of the check bit in the encrypted ciphertext includes: When the check value is equal to the signature value of the check digit in the encrypted ciphertext, determining that the first plaintext number is the plaintext number corresponding to the encrypted ciphertext; When the check value is not equal to the signature value of the check bit in the encrypted ciphertext, it is determined that the encrypted ciphertext is a forged ciphertext and the encrypted ciphertext is discarded.

8. The method according to claim 5, It is characterized in that Generate a plaintext number corresponding to the encrypted ciphertext Decrypted web URLs include: Replacing the encrypted ciphertext in the encrypted webpage URL with a plaintext number corresponding to the encrypted ciphertext; The web page URL including the plain text number corresponding to the encrypted ciphertext is used as the decrypted web page URL.

9. A web page URL encryption device, It is characterized in that The device comprises: A plaintext acquisition module is used to obtain the plaintext numbers to be encrypted in the URL of the web page to be encrypted; The first ciphertext module is used to generate a ciphertext of a ciphertext bit according to the plaintext number by using a preset mapping function, including: Extract the number of each digit in the plaintext number, wherein the number of each digit is any natural number from 0 to 9; Using a preset mapping function to map the numbers of each digit to obtain a mapping result of the numbers of each digit, wherein the mapping function is a function that maps 0 to 9 to characters respectively, and the mapping result of the numbers of each digit is a character string with a fixed length; The mapping results of each digit are combined to generate the ciphertext of the ciphertext bit; A strategy extraction module is used to obtain a random filling strategy using a preset gene extraction function according to the plaintext number and the ciphertext of the ciphertext position, including: Extracting the number of each digit in the plaintext number; According to the number of each digit, determine the length of the mapping result of the number of each digit based on the mapping function; Determine the ciphertext length of the plaintext number according to the length of the mapping result of each digit; Determine the ciphertext bit length according to the ciphertext length of the plaintext number and the preset ciphertext bit length; The preset gene extraction function determines the random filling strategy according to the ciphertext bit pseudo-filling length, wherein the gene extraction function is a function that determines the corresponding relationship between the ciphertext bit pseudo-filling length and the random filling strategy, and the random filling strategy includes the ciphertext bit pseudo-filling length and the gene factor value of the gene information bit corresponding to the ciphertext bit pseudo-filling length; A gene factor module, used to generate interference values ​​of ciphertext bits and gene factor values ​​of gene information bits according to the random filling strategy; A random padding module, used to randomly generate padding values ​​for padding bits; A signature generation module, used to generate a signature value of a check digit using a signature function according to the plaintext number; An encryption ciphertext module, used for combining the gene factor value, padding value and signature value, as well as the ciphertext and interference value of the ciphertext bit, to generate an encrypted ciphertext; The encryption result module is used to generate an encrypted webpage URL according to the encrypted ciphertext.

10. A webpage URL decryption device, It is characterized in that The device comprises: A ciphertext acquisition module is used to obtain the encrypted ciphertext in the encrypted webpage URL; The second ciphertext module is used to extract the ciphertext of the ciphertext position using the gene reverse restoration function according to the gene factor value of the gene information position in the encrypted ciphertext, including: According to the gene factor value of the gene information bit in the encrypted ciphertext, the gene reverse restoration function determines the ciphertext bit length to be discarded of the encrypted ciphertext, wherein the gene reverse restoration function is a function that determines the corresponding relationship between the gene factor value of the gene information bit and the ciphertext bit length to be discarded; Extracting the ciphertext of the ciphertext bits from the encrypted ciphertext according to the ciphertext bits to be discarded length of the encrypted ciphertext and the preset length of the ciphertext bits; A reverse mapping module, configured to obtain a first plaintext number using a reverse mapping function according to the ciphertext of the ciphertext bit; A check value module, used to generate a check value using a signature function according to the first plaintext number; A ciphertext verification module, used to determine the plaintext number corresponding to the encrypted ciphertext according to a comparison result between the verification value and the signature value of the check bit in the encrypted ciphertext; The decryption result module is used to generate a decrypted web page URL according to the plain text number corresponding to the encrypted ciphertext.

11. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and the computer program is used to execute the method according to any one of claims 1 to 8.

12. An electronic device, It is characterized in that The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-8.

Citation Information

Patent Citations

  • Encryption and decryption method and device

    CN108134666A

  • Method, device and system for self-checking release and access of URL, and medium

    CN111984989A

  • Data processing method and device, electronic equipment and medium

    CN114584378A