A chaining encryption method, apparatus, device and storage medium
By encrypting, encoding, and padding the inner and outer links, a target encrypted link is formed, which solves the problem of high openness and low cracking difficulty of the encryption method in the existing technology, and realizes link transmission with high security and high compatibility.
Patent Information
- Application Number
- CN202211330717.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-10-26
AI Technical Summary
Existing encryption algorithms and software have highly publicized algorithmic logic, making them relatively easy to crack. Multiple encryption methods are difficult to combine effectively, resulting in poor encryption of links and a high risk of decryption.
By encrypting the parameters of the inner link, an encrypted string is obtained and filled into the inner link. The parameters are read from the outer link and encoded according to the same encoding rules. Finally, the encoded parameters and the link are filled into the outer link to form the target encrypted link.
It improves the anti-decryption and anti-tampering capabilities of the link, effectively avoids third-party interception, and enhances the security and compatibility of link transmission.
Smart Images

Figure CN115801337B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer and the field of digital medicine, and in particular to a link encryption method, device and equipment and a storage medium. BACKGROUND
[0002] When the interface of two cooperating companies is docked, it is necessary to develop according to the interface address and parameters defined by both parties. For the developed product page, both parties will call the request through a defined uniform resource locator (URL) as an outer link, and will follow the required parameters behind the URL, so as to jump to the inner link to enter the developed page. For example, in the medical field, the medical service provider sends an outer link to the customer's device, and then jumps to the specified content page to selectively obtain the customer's case, examination report, prescription and other information. However, such URL is easy to be intercepted, deciphered or tampered by a third party, which may lead to incorrect access location and even leakage of important information.
[0003] In the prior art, there are various commonly used encryption algorithms or encryption software, and cooperating companies often use existing encryption algorithms or encryption software to encrypt and decrypt the transmitted and received links. In the process of implementing the present application, the inventors realized that at least the following problems exist in the prior art: the algorithm logic of the existing encryption algorithm and encryption software is highly publicized, the cracking difficulty is limited, and the compatibility between different encryption methods is poor, and multiple encryption is difficult to produce a combined effect. The above shortcomings result in poor link encryption effect and high cracking risk. SUMMARY
[0004] The present application provides a link encryption method, device, equipment and storage medium to solve the technical problems of high publicity of existing encryption methods, low cracking difficulty, difficulty in multiple encryption to produce a combined effect, and thus poor link encryption effect and high cracking risk.
[0005] In a first aspect, a link encryption method is provided, comprising:
[0006] obtaining a link to be encrypted, the link to be encrypted comprising an inner link and an outer link;
[0007] reading an inner link parameter from the inner link and encrypting the inner link parameter to obtain an encrypted string, and filling the encrypted string into the inner link according to a preset inner link filling method to obtain an encrypted inner link;
[0008] reading an outer link parameter from the outer link and encoding the outer link parameter and the encrypted inner link according to the same encoding rule to obtain an encoded outer parameter and an encoded inner link;
[0009] fill the encoded outer layer parameter and the encoded inner layer link to the outer layer link according to a preset outer chain filling mode to obtain a target encrypted link.
[0010] In a second aspect, a link encryption apparatus is provided, comprising:
[0011] a link acquisition module configured to acquire a link to be encrypted, the link to be encrypted comprising an inner layer link and an outer layer link;
[0012] an encryption module configured to read an inner layer link parameter from the inner layer link, encrypt the inner layer link parameter to obtain an encrypted string, and fill the encrypted string to the inner layer link according to a preset inner chain filling mode to obtain an encrypted inner layer link;
[0013] an encoding module configured to read an outer layer link parameter from the outer layer link, and encode the outer layer link parameter and the encrypted inner layer link according to a same encoding rule to obtain an encoded outer layer parameter and an encoded inner layer link;
[0014] a filling module configured to fill the encoded outer layer parameter and the encoded inner layer link to the outer layer link according to a preset outer chain filling mode to obtain a target encrypted link.
[0015] In a third aspect, a link encryption method device is provided, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the steps of the link encryption method when executing the program.
[0016] In a fourth aspect, a link encryption method device readable storage medium is provided, wherein the storage medium stores a software program, and the software program implements the steps of the link encryption method when executed by a processor.
[0017] The scheme realized by the link encryption method, device, equipment and storage medium comprises the following steps: obtaining a link to be encrypted comprising an inner link and an outer link; reading an inner link parameter from the inner link and performing encryption processing on the inner link parameter to obtain an encrypted string; filling the encrypted string into the inner link to obtain an encrypted inner link; reading an outer link parameter from the outer link; and performing encoding processing on the outer link parameter and the encrypted inner link according to a same encoding rule to obtain an encoded outer link parameter and an encoded inner link; and filling the encoded outer link parameter and the encoded inner link into the outer link to obtain a target encrypted link, thereby completing encryption of the link to be encrypted. The scheme solves the problems of high encryption publicity, low cracking difficulty, difficulty in producing a combined effect of multiple encryption, poor link encryption effect and high decryption risk in the prior art. The inner link and the outer link are processed through encryption, encoding and filling to obtain the target encrypted link containing information of the inner link and the outer link, and the combination of encryption, encoding and filling effectively improves the compatibility, complexity and uniqueness of link encryption, eliminates the decryption risk when the link is intercepted, effectively improves the security of link transmission, and has the characteristics of high security and strong applicability. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0019] Figure 1 is a schematic diagram of an application environment of a link encryption method in an embodiment of the present application;
[0020] Figure 2 is a flowchart of a link encryption method in an embodiment of the present application;
[0021] Figure 3 is Figure 2 is a flowchart of a specific implementation of step S220 in the method;
[0022] Figure 4 is Figure 2 is a flowchart of a specific implementation of step S230 in the method;
[0023] Figure 5 is Figure 2 is another flowchart of a specific implementation of step S230 in the method;
[0024] Figure 6 is Figure 2 is a schematic diagram of a step that can be included before step S230 in the method;
[0025] Figure 7 is Figure 2 a specific implementation flowchart of step S240 in the method
[0026] Figure 8 is a structural schematic diagram of a link encryption device according to an exemplary embodiment of the present application;
[0027] Figure 9 is a structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0029] First of all, it should be noted that the link encryption method provided by the embodiments of the present application can be applied in the application environment such as Figure 1 Figure 1 is a schematic diagram of an application environment of a link encryption method in an embodiment of the present application, wherein the server end 1 provides a link, the client end 2 acquires the link, the server end 1 and the client end 2 realize transmission of the link and data interaction through a network, the server end 1 and the client end 2 can include but are not limited to personal computers, notebook computers, smart phones, tablet computers and portable wearable smart devices and other electronic devices with information transmission or communication functions, and can also be a cluster composed of one or several of the above-mentioned electronic devices, and it is worth noting that in the above-mentioned scenario description, the server end 1 and the client end 2 are distinguished for link encryption behavior, that is, the server end 1 can be a service provider or a service requester, and the client end 2 can be a service provider or a service requester, for example, in a possible application scenario, in the delivery scenario of a digital medical product, the client end 2 can be a provider of a digital medical product, and the server end 1 can be a demander of the digital medical product, and the server end 1 needs to acquire a specific digital medical product from the client end 2 by sending an encrypted link, and for another possible application scenario, in the scenario of acquiring medical information of a demander by a provider of a digital medical product, the client end 2 can be a demander of a digital medical product, and the server end 1 can be a provider of the digital medical product, and the server end 1 needs to acquire medical information such as a case, a test report or a prescription from the client end 2, that is, the demander, by sending an encrypted link, as described in the above-mentioned application scenario, in the process of requesting information through an encrypted link, the security of medical data can be guaranteed, and the link encryption process will be described in detail in subsequent embodiments.
[0030] It needs to be understood that in the above-mentioned application environment, the server end 1 acquires a link to be encrypted first, the acquisition here can be generation at the server end 1 or direct acquisition from a third party, that is, the encryption method can be applied in the process of link generation or independent of the process of link generation, wherein the link to be encrypted is a double link, which refers to a link form generally including an inner link and an outer link, when identifying the double link, the outer link is identified first and the webpage pointed to by the address provided by the outer link is displayed, then the inner link is identified after entering the webpage and jumps to the webpage pointed to by the address provided by the inner link, for example, in some application scenarios, when the interfaces of two cooperating companies are connected, they will need to develop according to the interface addresses and parameters defined by both parties, for the developed product page, both parties will call and request through a defined uniform resource locator (URL) as an outer link, and will follow the required parameters behind the URL, so as to call the inner link to enter the developed page.
[0031] The server end 1 obtains the to-be-encrypted link including the inner link and the outer link, reads the inner link parameter from the inner link, and encrypts the inner link parameter to obtain an encrypted string. The encrypted string is filled into the inner link according to a preset inner link filling mode to obtain an encrypted inner link. The outer link parameter is read from the outer link, and the outer link parameter and the encrypted inner link are encoded according to the same encoding rule to obtain encoded outer link parameters and encoded inner link. Finally, the encoded outer link parameters and the encoded inner link are filled into the outer link according to a preset outer link filling mode to obtain a target encrypted link, and the encryption of the to-be-encrypted link is completed. The target encrypted link obtained through the above method is filled into the outer link after the original inner link is encrypted and encoded. The client end 2 obtains the target encrypted link encrypted by the server end 1 through the network, and decrypts the target encrypted link. Even if the third-party port intercepts the target encrypted link, the third-party port cannot obtain the link content because the third-party port cannot decrypt the target encrypted link.
[0032] As described above, in the present application, first, the to-be-encrypted link is obtained, the inner link parameter is read from the inner link, and the inner link parameter is encrypted to obtain an encrypted string. The encrypted string is filled into the inner link according to a preset inner link filling mode to obtain an encrypted inner link. The outer link parameter is read from the outer link, and the outer link parameter and the encrypted inner link are encoded according to the same encoding rule to obtain encoded outer link parameters and encoded inner link. Finally, the encoded outer link parameters and the encoded inner link are filled into the outer link according to a preset outer link filling mode to obtain a target encrypted link, and the encryption of the to-be-encrypted link is completed. The present application effectively improves the anti-decoding ability and the anti-tampering ability of the link by encrypting and integrating the inner link and the outer link, and effectively avoids third-party interception.
[0033] The present application will be described in detail below through specific embodiments.
[0034] In an embodiment, refer to Figure 2 , Figure 2 is a flowchart of a link encryption method in an embodiment of the present application, including the following steps:
[0035] In step S210, a to-be-encrypted link is obtained, and the to-be-encrypted link includes an inner link and an outer link.
[0036] In step S220, an inner link parameter is read from the inner link, and the inner link parameter is encrypted to obtain an encrypted string. The encrypted string is filled into the inner link according to a preset inner link filling mode to obtain an encrypted inner link.
[0037] Step S230, reading the outer layer link parameter from the outer layer link, and encoding the outer layer link parameter and the encrypted inner layer link according to the same encoding rule to obtain an encoded outer layer parameter and an encoded inner layer link;
[0038] Step S240, filling the encoded outer layer parameter and the encoded inner layer link into the outer layer link according to a preset outer chain filling mode to obtain a target encrypted link.
[0039] Steps S210-S240 are specifically described as follows:
[0040] In step S210, the link to be encrypted is obtained, and the link to be encrypted includes an inner layer link and an outer layer link;
[0041] For this step, the link to be encrypted is first obtained, and the link to be encrypted includes an inner layer link and an outer layer link. The setting principle of the inner layer link and the outer layer link has been described in the application scenario, and will not be repeated here.
[0042] In step S220, the inner layer link parameter is read from the inner layer link, and the inner layer link parameter is encrypted to obtain an encrypted string. The encrypted string is filled into the inner layer link according to a preset inner chain filling mode to obtain an encrypted inner layer link.
[0043] For this step, the inner layer link parameter in the inner layer link needs to be read and encrypted first. It is worth noting that the unencrypted link generally adopts a fixed format, including protocols, domain names, paths and parameters arranged in sequence. Among them, the protocol, domain name and path are used to link to the corresponding network address, and the parameter is used to carry the interaction information. The parameter is generally connected at the back end of the path through a specific symbol, and the format of the parameter is generally key-value pair (key-value). For example, in some embodiments, after the path, the parameter is "? ID=123", "?" is a specific symbol used to separate the path and the parameter, "ID=123" indicates that the content of "ID" is "123". By carrying the parameter in the link, specific information can be stored or transmitted in the transmission process of the link.
[0044] Based on the position of the parameter in the link and the rule that the parameter is separated from the path by a specific symbol, the inner link parameter in the inner link can be read by identifying the specific symbol in the link and combining the identified position, and then the inner link parameter is encrypted by using a predefined encryption method. The encryption method can be various encryption methods commonly used in the technical field, such as MD5 (Message-Digest Algorithm 5, Message-Digest Algorithm 5) encryption, SHA (Secure Hash Algorithm, Secure Hash Algorithm) encryption, or AES (Advanced Encryption Standard, Advanced Encryption Standard) encryption, etc. For example, in the embodiment, the inner link parameter is encrypted by using the AES encryption algorithm according to the internal key predefined and known only to both parties. During the encryption process, the data encoding format used by the embodiment is the UTF-8 (Universal Character Set / Unicode Transformation Format, Universal Character Set / Unicode Transformation Format) encoding format, which is beneficial to improve the encoding compatibility and avoid the appearance of unrecognizable garbled code when encoding Chinese.
[0045] After the inner link parameter is encrypted, the result obtained is a string of random garbled code, that is, an encrypted string. The encrypted string can only be decrypted by the key predefined and known only to both parties to obtain the original inner link parameter. The encrypted string is filled into the inner link according to the preset inner chain filling method to obtain an encrypted inner link. The inner chain filling method here refers to a method that can obtain an encrypted inner link of a specific format according to the filling method. The encrypted inner link includes the encrypted string. For example, in some embodiments, the inner chain filling method is to reserve the part other than the inner link parameter, and fill the encrypted string into the position of the original inner link parameter. In terms of format, that is, replace the original inner link parameter with the encrypted string. This is a relatively simple inner chain filling format, which hides the unencrypted inner link parameter in the inner encrypted link and contains the encrypted string obtained by encrypting the inner link parameter. In other embodiments, the encrypted string can also be segmented and filled, filled multiple times, etc.
[0046] In an embodiment, the application also exemplarily shows a filling method of an encrypted string, as shown in Figure 3 Figure 3 is Figure 2 a specific embodiment flowchart of step S220 in
[0047] In step S310, a feature key-value pair is generated according to a preset feature keyword and using the encrypted string as a feature value.
[0048] In step S320, the inner-layer link parameter in the inner-layer link is replaced by the feature key-value pair.
[0049] For steps S310-S320, the feature key-value pair is generated using the preset feature keyword and the encrypted string. Here, the key-value pair refers to data in a key-value format. For example, in some embodiments, the encrypted string obtained by encrypting the inner-layer link parameter "ID=123" is "aaabbb". The "aaabbb" is a string of isolated random codes and does not have a key-value format. In order to facilitate subsequent filling, encoding, and identification, it is necessary to represent it in a key-value format. Therefore, in combination with the pre-set feature keyword, such as "data1", the feature key-value pair is generated to represent it, such as "data1=aaabbb".
[0050] After generating the feature key-value pair, the filling is started. In this embodiment, the filling method is to directly replace the inner-layer link parameter in the inner-layer link with the feature key-value pair, so that the unencrypted inner-layer link parameter is hidden in the inner-layer encrypted link, and the encrypted string obtained by encrypting the inner-layer link parameter is included. The feature key-value pair retains the key-value format, which conforms to the existing format of the parameter in the link from the format, facilitates the reading and calling of the encrypted string in the subsequent steps, and also helps to improve the difficulty of manual identification by a third party after intercepting the link.
[0051] In step S230, the outer-layer link parameter is read from the outer-layer link, and the outer-layer link parameter and the encrypted inner-layer link are encoded according to the same encoding rule to obtain the encoded outer-layer parameter and the encoded inner-layer link.
[0052] For this step, it can be understood that, similar to the inner-layer link parameter, the outer-layer link also carries an outer-layer link parameter. Step S230 needs to encode the outer-layer link parameter to obtain the encoded outer-layer parameter, and encode the encrypted inner-layer link to obtain the encoded inner-layer link. The same encoding rule is used to encode the outer-layer link parameter and the encrypted inner-layer link, which can increase the compatibility between the encoded outer-layer link parameter and the encrypted inner-layer link. If the encoded outer-layer parameter and the encoded inner-layer link obtained after encoding are spliced, a third party cannot identify the splicing position of the outer-layer link parameter and the encrypted inner-layer link by identifying the difference in the encoding rule. In addition, using a unified encoding rule also helps to simplify the encoding and decoding process.
[0053] In one embodiment, this application also exemplarily illustrates a specific implementation scheme for obtaining outer-layer encoded parameters and inner-layer encoded links through encoding processing, such as... Figure 4 As shown, Figure 4 yes Figure 2 A flowchart illustrating a specific implementation of step S230, namely, the step of encoding the outer layer link parameters and the encrypted inner layer link to obtain the encoded outer layer parameters and the encoded inner layer link, specifically includes the following steps:
[0054] Step S410: Obtain the encoding container and fill the outer link parameter and the encrypted inner link into the encoding container in the form of ordinary key-value pairs according to the first filling order.
[0055] Step S420: Encode the ordinary key-value pairs in the encoding container to obtain multiple encoded key-value pairs;
[0056] Step S430: Read the encoded key-value pairs from the encoded container according to the first reading order to obtain the outer encoded parameters and the inner encoded links. The first reading order corresponds to the first padding order.
[0057] For steps S410-S430, the outer link parameter and the encrypted inner link need to be filled into the encoding container in the form of ordinary key-value pairs according to the first filling order. Here, the encoding container refers to a structure container that can store key-value pairs, established through programming. For example, in some implementations, a MAP structure is defined through encoding. A MAP structure is a data set structure, which can be understood as a collection that stores data in the form of ordinary key-value pairs. The key can be any type of data, and the value is a string. For example, when filling the outer link parameter "ID2=456", the filling content is "key=ID2, value=456". For example, when filling in encrypted inner links, if the encrypted inner link is not in key-value format, it cannot be directly filled as a regular key-value pair. In this case, a key can be manually defined for the non-key-value data. For instance, if the encrypted string in the encrypted inner link is garbled "aaabbb", the content to be filled could be, for example, "key = data1, value = aaabbb", where "data1" is a manually defined key for "aaabbb" to facilitate filling and reading. Alternatively, if the encrypted inner link is already in key-value format, such as "data1 = aaabbb", then it can be directly filled as a regular key-value pair.
[0058] After the above filling steps, when reading the contents filled in the container, the corresponding data can be obtained by reading the same set of key and value. In other implementations, other commonly used encoding containers can also be used.
[0059] After filling, the filled normal key-value pairs in the encoding container are encoded to obtain a plurality of encoded key-value pairs. The encoding can be completed by programming. The programming logic is to encode the key-value format data in the encoding container as the target. In this way, the encoding of all data in the encoding container can be completed at one time, which is beneficial to simplify the operation steps and improve the efficiency.
[0060] After encoding, the encoded key-value pairs are read from the encoding container in the first reading order to obtain the encoded outer layer parameter and the encoded inner layer link. The first reading order corresponds to the first filling order. It should be understood that the first filling order refers to the order of filling the outer layer link parameter and the encrypted inner layer link in the key-value format into the encoding container. The first reading order refers to the reading order of reading the encoded key-value format encoded key-value pairs from the encoding container. The first reading order corresponds to the first filling order, that is, the data arrangement format in the read encoded outer layer parameter and encoded inner layer link is the same as that in the outer layer link parameter and encrypted inner layer link before encoding, and the data arrangement order is not dislocated.
[0061] Through the above filling method, the encoding in the encoding container can effectively simplify the encoding process while ensuring the consistency of the data arrangement order. In another embodiment, the application also exemplarily shows another specific implementation scheme of obtaining the encoded outer layer parameter and the encoded inner layer link through encoding processing, as shown in Figure 5 , Figure 5 is Figure 2 Another specific implementation flowchart of step S230 in
[0062] Step S510, the normal key-value pairs are read from the encoding container in the second reading order to obtain the to-be-encoded string. The second reading order corresponds to the arrangement order of the filled content in the outer chain filling method.
[0063] Step S520, the to-be-encoded string is encoded to obtain an encoded string. The encoded string includes the encoded outer layer parameter corresponding to the outer layer link parameter and the encoded inner layer link corresponding to the encrypted inner layer link.
[0064] Step S530, the encoded string is filled into the outer layer link to obtain the target encrypted link.
[0065] For steps S510-520, this embodiment provides another scheme for filling and reading using an encoding container. Compared with steps S410-S430 in the previous embodiment, the purpose is the same: to encode the outer link parameters and the encrypted inner link according to the same encoding rule so that they can be filled into the outer link in the subsequent steps using the outer link filling method. The difference is that in this embodiment, after the outer link parameters and the encrypted inner link are filled into the encoding container in the form of ordinary key-value pairs, they are read according to the second reading order to obtain the string to be encoded. The second reading order corresponds to the arrangement order of the filling content in the outer link filling method. That is, the ordinary key-value pairs in the encoding container are read first according to the arrangement order of the outer link filling content in the subsequent steps, so that the read ordinary key-value pairs are arranged in this order to form the string to be encoded. Then the string to be encoded is encoded to obtain the encoded string. The encoded string includes the encoded outer parameters obtained by encoding the outer link parameters and the encoded inner link obtained by encoding the encrypted inner link. The encoded outer parameters and the encoded inner link are arranged in the encoded string according to the format required by the outer link filling method.
[0066] For step S540, after obtaining the encoded string, since the content within the encoded string, including the outer encoded parameters and the inner encoded links, is already arranged in the format required by the outer link filling method, it is not necessary to fill the outer links sequentially using the inner encoded links and outer encoded parameters. Instead, the encoded string is directly filled into the outer links to obtain the target encrypted link. Essentially, it is still filling the outer encoded parameters and inner encoded links into the outer links according to the outer link filling method. However, by utilizing the reading of the encoding container, the filling step is effectively simplified. In some other embodiments, in application scenarios where the link encryption method provided in this embodiment needs to be applied multiple times, if the inner or outer links appear repeatedly, the ordinary key-value pairs stored in the encoding container can be read repeatedly without completely repeating the encoding process for the ordinary key-value pairs. This helps to further save development resources and improve the link encryption efficiency.
[0067] Furthermore, in the above embodiments, the encoding rule used in the encoding process is percent-encoding (URLencoding / Percent-encoding), which is beneficial to further improve adaptability.
[0068] In one embodiment, such as Figure 6 As shown, Figure 6 yes Figure 2 The schematic diagram of steps that may be included before step S230 includes the following steps before reading the outer link parameters from the outer link and encoding the outer link parameters and the encrypted inner link:
[0069] Step S610, adding a first identification parameter at the end of the outer layer link, so that the first identification parameter is as the end field of the outer layer link parameter;
[0070] For step S610, it can be completed by adding UTM (Urchin Tracking Module / Urchin Tracking Manager, traffic channel marker) characters, for example, adding "UTM=ppt_eerr" as the first identification parameter at the end of the outer layer link, that is, after the outer layer link parameter, the first identification parameter will always be as the end field of the outer layer link parameter, and the party decrypting the link can filter the subsequent invalid links according to the identified first identification parameter.
[0071] In step S240, the encoded outer layer parameter and the encoded inner layer link are filled into the outer layer link according to the preset outer chain filling mode to obtain the target encrypted link, and the encryption of the to-be-encrypted link is completed;
[0072] For this step, for the encoded outer layer parameter and the encoded inner layer link obtained by step S230, the basic idea is to fill the encoded outer layer parameter and the encoded inner layer link into the outer layer link according to the filling position and filling order specified by the preset outer chain filling mode to obtain the target encrypted link, so that the target encrypted link contains the outer layer link and the inner layer link which cannot be directly identified by the third party,
[0073] For ease of understanding, the outer chain filling mode is exemplarily described herein. For example, in some embodiments, the obtained encoded outer layer parameter is "cccddd", and the encoded inner layer link is "https%253A%252F%252Fwww.in.com%252Fin%253Fdata%253Deeefff". It can be understood that the encoded inner layer link is obtained by encoding the inner layer link after the filled encrypted string. The characters such as https and www in the encoded inner layer link can be recognized in the encoding process and will not be encoded into other characters, and the symbols and encrypted strings will be encoded into other characters, for example, the encrypted string is encoded to "eeefff". The filling mode specified by the outer chain filling mode is, for example, https: / / www.out.com / out / ?%3Fcontent%3D{content}, wherein %3Fcontent%3D is a specific format character specified by the outer chain filling mode, and {content} is the encoded outer layer parameter and the encoded inner layer link filled in order, that is, the outer chain parameter is replaced by %3Fcontent%3D{content}. After filling, {content} is {cccdddhttps%253A%252F%252Fwww.in.com%252Fin%253Fdata%253Deeefff}, and the final obtained target encrypted link is https: / / www.out.com / out / ?%3Fcontent%3D{cccdddhttps%253A%252F%252Fwww.in.com%252Fin%253Fdata%253Deeefff}.
[0074] In some other embodiments, in addition to the outer layer link and the inner layer link same as the above-mentioned embodiments, a first identification parameter is added at the end of the outer layer link, for example, "UTM=ppt_eerr". The final obtained target encrypted link is https: / / www.out.com / out / ?%3Fcontent%3D{cccdddhttps%253A%252F%252Fwww.in.com%252Fin%253Fdata%253Deeefffutm%2522%253A%2522ppt_eerr%2522%257D}, wherein "utm%2522%253A%2522ppt_eerr%2522%257D" is a string obtained by encoding the first identification parameter. The first identification parameter has been described above in combination with step S610 and will not be repeated here.
[0075] In an embodiment, the application also specifically shows an implementation of the outer chain filling method, as shown in Figure 7 Figure 7 Figure 2 is
[0076] In step S710, the outer link also includes an outer link domain name, a second identification parameter is added between the outer link domain name and the outer link parameter, and the outer link parameter is removed;
[0077] In step S720, the encoded outer parameter, the encoded inner link and the first identification parameter are sequentially filled behind the second identification parameter;
[0078] For steps S710-S720, a second identification parameter is added between the outer link domain name and the outer link parameter of the outer link, and the outer link parameter is removed, and the encoded outer parameter, the encoded inner link and the first identification parameter are sequentially filled behind the second identification parameter. It should be understood that the second identification parameter is an identifier artificially defined and used to distinguish the start position of the outer link parameter in the outer link, and the purpose is to facilitate identification and distinction of each segment of the target encrypted link when the target encrypted link is decrypted. For example, in some embodiments, the second identification parameter is defined as "scheme=global_h5", the first identification parameter is defined as "UTM=ppt_eerr", the encoded outer parameter is defined as "cccddd", and the encoded inner link is defined as "https%253A%252F%252Fwww.in.com%252Fin%253Fdata%253Deeefff". According to steps S710-S720, the target link parameter is https: / / www.out.com / out / ?scheme=global_h5{cccdddhttps%253A%252F%252Fwww.in.com%252Fin%253Fdata%253Deeefffutm%2522%253A%2522ppt_eerr%2522%257D}.
[0079] In some embodiments, after filling the encoded outer parameter and the encoded inner link into the outer link according to the preset outer chain filling method to obtain the target encrypted link, the following steps are further included:
[0080] The target encrypted link and the encryption key are packaged to obtain an encrypted data packet, and the encryption key is obtained based on the encryption processing;
[0081] The encrypted data packet is sent to the client;
[0082] For the above steps, it can be understood that the purpose of the target encrypted link is to obtain the content pointed by the link address from the client, and after encryption is completed on the server side, decryption needs to be completed on the client side, at which time the target encrypted link and the encrypted key corresponding thereto are packaged, the obtained encrypted data packet is sent to the client for decryption and reading, thereby ensuring the security and confidentiality of the request process. In the embodiment, the encrypted key used for decryption is based on the encryption processing, that is, in the process of implementing the link encryption method described in the above embodiments, different encrypted keys can be correspondingly generated according to different encryption processing, and the specific generation manner can be random generation based on the encryption processing mode, artificial specification, or definition according to the online protocol of the client and the server, which is beneficial to maintaining the dynamicity of the encrypted key and further improving the link transmission security.
[0083] It can be understood that the above description of the outer chain filling manner through the specific embodiments is only exemplary, and the format, data and data processing process included therein are all descriptions used for understanding. In actual embodiments, the final results obtained also have differences according to the differences in link format, outer chain filling manner and related data processing mode selection. Any method idea that conforms to the idea kernel disclosed in the present application should belong to the implementation scope of the present application.
[0084] In summary, in the link encryption method provided by the present application, first, the to-be-encrypted link including the inner layer link and the outer layer link is obtained, the inner layer link parameter is read from the inner layer link, and the inner layer link parameter is encrypted to obtain an encrypted string. The encrypted string is filled into the inner layer link to obtain an encrypted inner layer link. The outer layer link parameter is read from the outer layer link, and the outer layer link parameter and the encrypted inner layer link are encoded according to the same encoding rule to obtain an encoded outer layer parameter and an encoded inner layer link. The encoded outer layer parameter and the encoded inner layer link are filled into the outer layer link to obtain a target encrypted link, and the encryption of the to-be-encrypted link is completed. The problems of high disclosure degree of encryption method, low cracking difficulty, difficulty in producing combined effect of multiple encryption, and poor link encryption effect and high decryption risk in the prior art are solved. The inner layer link and the outer layer link are processed by encryption, encoding and filling to obtain a target encrypted link containing information of the inner layer link and the outer layer link. The combination of encryption, encoding and filling effectively improves the compatibility, complexity and uniqueness of link encryption, eliminates the decryption risk when the link is intercepted, effectively improves the security of link transmission, and has the characteristics of high security and strong applicability.
[0085] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0086] In an embodiment, the application also specifically provides a link encryption device corresponding to the link encryption method in the above-mentioned embodiments, as shown in Figure 8 Figure 8 is a structural schematic diagram of the link encryption device shown in an exemplary embodiment of the application, comprising a link acquisition module 801, an encryption module 802, an encoding module 803 and a padding module 804, and each module is described in detail as follows:
[0087] The link acquisition module 801 is configured to acquire a link to be encrypted, and the link to be encrypted comprises an inner link and an outer link.
[0088] The encryption module 802 is configured to read an inner link parameter from the inner link, and encrypt the inner link parameter to obtain an encrypted string, and pad the encrypted string to the inner link according to a preset inner link padding mode to obtain an encrypted inner link.
[0089] The encoding module 803 is configured to read an outer link parameter from the outer link, and encode the outer link parameter and the encrypted inner link according to the same encoding rule to obtain an encoded outer link parameter and an encoded inner link.
[0090] The padding module 804 is configured to pad the encoded outer link parameter and the encoded inner link to the outer link according to a preset outer link padding mode to obtain a target encrypted link.
[0091] In some embodiments, the encoding module 803 is further configured to:
[0092] acquire an encoding container, and pad the outer link parameter and the encrypted inner link in the form of a normal key-value pair to the encoding container according to a first padding order;
[0093] encode the normal key-value pair in the encoding container to obtain a plurality of encoded key-value pairs;
[0094] read the encoded key-value pairs from the encoding container according to a first reading order to obtain the encoded outer link parameter and the encoded inner link, and the first reading order corresponds to the first padding order.
[0095] In some embodiments, the encoding module 803 and the padding module 804 are further collectively configured to:
[0096] acquire an encoding container, and pad the outer link parameter and the encrypted inner link in the form of a normal key-value pair to the encoding container according to a first padding order;
[0097] read the normal key-value pairs from the encoding container according to a second reading order to obtain a to-be-encoded string, and the second reading order corresponds to the arrangement order of the padding content in the outer link padding mode.
[0098] The encoding processing is performed on the to-be-encoded string to obtain an encoded string, and the encoded string includes an encoded outer-layer parameter corresponding to the outer-layer link parameter and an encoded inner-layer link corresponding to the encrypted inner-layer link;
[0099] The encoded string is filled into the outer-layer link to obtain the target encrypted link.
[0100] In some embodiments, the encryption module 802 is further configured to:
[0101] According to the preset feature keyword, a feature key-value pair is generated by using the encrypted string as a feature value.
[0102] The inner-layer link parameter in the inner-layer link is replaced by the feature key-value pair.
[0103] In some embodiments, the encryption module 802 is further configured to:
[0104] A first identification parameter is added at the end of the outer-layer link, so that the first identification parameter serves as an end field of the outer-layer link parameter.
[0105] In some embodiments, the filling module 804 is further configured to:
[0106] The outer-layer link further includes an outer-layer link domain name, a second identification parameter is added between the outer-layer link domain name and the outer-layer link parameter, and the outer-layer link parameter is removed;
[0107] The encoded outer-layer parameter, the encoded inner-layer link, and the first identification parameter are sequentially filled behind the second identification parameter.
[0108] As described above, the link encryption device provided by the embodiments of the present application first acquires a to-be-encrypted link including an inner link and an outer link, reads an inner link parameter from the inner link, and performs encryption processing on the inner link parameter to obtain an encrypted string, fills the encrypted string into the inner link to obtain an encrypted inner link, reads an outer link parameter from the outer link, and performs encoding processing on the outer link parameter and the encrypted inner link according to the same encoding rule to obtain an encoded outer parameter and an encoded inner link, fills the encoded outer parameter and the encoded inner link into the outer link to obtain a target encrypted link, and completes encryption of the to-be-encrypted link, thereby solving the problem in the prior art that the encryption mode is highly public, the cracking difficulty is low, multiple encryption is difficult to produce a combined effect, and the link encryption effect is poor, and the cracking risk is high, the inner link and the outer link are processed through encryption, encoding and filling to obtain the target encrypted link containing information of the inner link and the outer link at the same time, and the combination of encryption, encoding and filling effectively improves the compatibility, complexity and uniqueness of link encryption, eliminates the cracking risk when the link is intercepted, effectively improves the security of link transmission, and has the characteristics of high security and strong applicability.
[0109] An embodiment of the present application further provides a link encryption method device, including: one or more processors; a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the link encryption method provided in each of the above embodiments.
[0110] Figure 9 The structural schematic diagram of the computer system of the electronic device suitable for implementing the embodiments of the present application is shown. It should be noted that, Figure 9 The computer system 900 of the electronic device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0111] As Figure 9 shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 902 or programs loaded from a storage portion 908 into a random access memory (RAM) 903, such as the method described in the above embodiments. In the RAM 903, various programs and data required for system operation are also stored. The CPU 901, the ROM 902 and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also linked to the bus 904.
[0112] The following components are linked to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also linked to the I / O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 910 as necessary, so that a computer program read out therefrom is installed in the storage section 908 as necessary.
[0113] In particular, according to embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing a computer program for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, various functions defined in the system of the present application are executed.
[0114] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer-readable signal medium can include a data signal propagated in a baseband or as a carrier wave in a propagated data signal, in which the computer-readable computer program is carried. Such a propagated data signal can take on many forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit the program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted in any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.
[0115] The flowcharts and block diagrams in the drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that shown in the figures. For example, two blocks noted in succession can actually be executed substantially concurrently, or they can sometimes be executed in reverse order, depending on the functionality involved. It should also be noted that each block in the flowcharts or block diagrams, and combinations of blocks in the flowcharts or block diagrams, can be implemented by special-purpose hardware-based systems, which perform the specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0116] As described above, the electronic device provided by the embodiment of the present application first acquires the user identity information and product demand information of the user, the product demand information including basic demand information and personalized demand information, matches the basic demand information with the preset template library to obtain a target basic interface, determines the personalized feature and the personalized feature parameter according to the personalized demand information, adjusts the target feature parameter of the target basic interface, generates a target customized interface, and associates the target customized interface with the user identity information. When the target customized interface display request including the user identity information sent by the client is acquired, the target customized interface is displayed on the client. The present application improves the differentiated response capability by matching the product demand with the template library, effectively reduces the order approval, configuration and development workload for the differentiated demand of the target customized interface, is beneficial to saving the human resource configuration, and improves the product development efficiency and quality control efficiency.
[0117] The units described in the embodiments of the present application can be implemented in the form of software or hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0118] Another aspect of the present application also provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, causes the computer to perform the link encryption method as described above. The computer readable storage medium can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the electronic device.
[0119] Another aspect of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the link encryption method provided in each of the above embodiments.
[0120] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
[0121] The above-described embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A chaining encryption method characterized by, The method comprises the following steps: obtaining a link to be encrypted, the link to be encrypted comprising an inner link and an outer link; reading an inner link parameter from the inner link, and performing encryption processing on the inner link parameter to obtain an encrypted string, and filling the encrypted string into the inner link according to a preset inner link filling mode to obtain an encrypted inner link; reading an outer link parameter from the outer link, and performing encoding processing on the outer link parameter and the encrypted inner link according to the same encoding rule to obtain an encoded outer parameter and an encoded inner link, comprising: obtaining an encoding container, and filling the outer link parameter and the encrypted inner link into the encoding container in the form of a normal key-value pair according to a first filling order; performing encoding processing on the normal key-value pair in the encoding container to obtain a plurality of encoded key-value pairs; reading the encoded key-value pair from the encoding container according to a first reading order to obtain the encoded outer parameter and the encoded inner link, the first reading order corresponding to the first filling order; or, reading the normal key-value pair from the encoding container according to a second reading order to obtain a to-be-encoded string, the second reading order corresponding to the arrangement order of the filled content in the preset outer link filling mode; performing encoding processing on the to-be-encoded string to obtain an encoded string, the encoded string comprising the encoded outer parameter corresponding to the outer link parameter and the encoded inner link corresponding to the encrypted inner link; filling the encoded outer parameter and the encoded inner link into the outer link according to the outer link filling mode to obtain a target encrypted link.
2. The link encryption method of claim 1, wherein, The step of filling the encrypted string into the inner link according to the preset inner link filling mode comprises: generating a feature key-value pair by using the encrypted string as a feature value according to a preset feature keyword; replacing the inner link parameter in the inner link with the feature key-value pair.
3. The link encryption method of claim 1, wherein, Before reading the outer link parameter from the outer link and performing encoding processing on the outer link parameter and the encrypted inner link, the method further comprises: adding a first identification parameter at the end of the outer link, so that the first identification parameter serves as an end field of the outer link parameter.
4. The linked encryption method of claim 3, wherein, The outer link filling mode comprises: The outer link further comprises an outer link domain name, a second identification parameter is added between the outer link domain name and the outer link parameter, and the outer link parameter is removed; the encoded outer parameter, the encoded inner link and the first identification parameter are sequentially filled after the second identification parameter.
5. The linked encryption method of any one of claims 1 to 4, wherein, After filling the encoded outer parameter and the encoded inner link into the outer link according to the preset outer link filling mode to obtain a target encrypted link, the method further comprises the following steps: packing the target encrypted link and an encryption key to obtain an encrypted data packet, the encryption key being obtained based on the encryption processing; sending the encrypted data packet to a client.
6. A chaining encryption device characterized by comprising: The method comprises the following steps: a link obtaining module is configured to obtain a link to be encrypted, the link to be encrypted comprising an inner link and an outer link; The encryption module is configured to read an inner-layer link parameter from the inner-layer link, encrypt the inner-layer link parameter to obtain an encrypted string, fill the encrypted string into the inner-layer link according to a preset inner-link filling manner, and obtain an encrypted inner-layer link. The encoding module is configured to: read an outer-layer link parameter from the outer-layer link, and encode the outer-layer link parameter and the encrypted inner-layer link according to a same encoding rule to obtain an encoded outer-layer parameter and an encoded inner-layer link; obtain an encoding container, fill the outer-layer link parameter and the encrypted inner-layer link into the encoding container in a form of a normal key-value pair according to a first filling order; encode the normal key-value pair in the encoding container to obtain a plurality of encoded key-value pairs, read the encoded key-value pairs from the encoding container according to a first reading order to obtain the encoded outer-layer parameter and the encoded inner-layer link, and the first reading order corresponds to the first filling order; alternatively, read the normal key-value pair from the encoding container according to a second reading order to obtain an encoded string to be encoded, and the second reading order corresponds to an arrangement order of filled content in a preset outer-link filling manner; encode the encoded string to be encoded to obtain an encoded string, and the encoded string includes the encoded outer-layer parameter corresponding to the outer-layer link parameter and the encoded inner-layer link corresponding to the encrypted inner-layer link; and the filling module is configured to fill the encoded outer-layer parameter and the encoded inner-layer link into the outer-layer link according to the outer-link filling manner to obtain a target encrypted link.
7. A chained encryption method device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes the computer program to implement the steps of the link encryption method according to any one of claims 1 to 5.
8. A chained encryption method device readable storage medium, said storage medium having stored therein a computer program, characterized in that: The computer program is executed by the processor to implement the steps of the link encryption method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Information processing method, platform and system and computer storage medium
CN110807210A