Generation method and decryption method of encryption request

Through a hybrid technology of symmetric encryption and asymmetric encryption, combined with digital signature and signature verification technology, the key mechanism is dynamically updated, and the problem of insufficient system security after client key leakage is solved, achieving efficient information transmission security improvement.

CN118944928APending Publication Date: 2024-11-12BEIJING CENTURY LOTTERY VIDEO MEDIA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411006461.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-12

Smart Images

  • Figure CN118944928A_ABST
    Figure CN118944928A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an encryption request generation method and device, a decryption method and device, electronic equipment and a computer readable medium. A specific embodiment of the method comprises the following steps: generating a symmetric encryption algorithm key about a to-be-sent request; encrypting a request parameter in the to-be-sent request by using the symmetric encryption algorithm key to obtain an encrypted request parameter; obtaining a signature request parameter with signature information generated by the target server; and generating an encryption request according to the signature request parameter and the encryption request parameter and sending the encryption request to an interface corresponding to the request parameter. According to the embodiment, digital signature and signature verification technologies are utilized, so that the difficulty of tampering the information is improved, and the data integrity is enhanced. By using the hybrid encryption technology of symmetric encryption and asymmetric encryption, the difficulty of information transmission cracking is improved, the system security is enhanced, the information leakage risk is reduced, and the system security level is improved. And a dynamic secret key updating mechanism is introduced, so that the information transmission security is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a method for generating and decrypting an encryption request, a device, an electronic device, and a computer-readable medium. Background Art

[0002] In the prior art, the interface communication information between the client and the server is extremely vulnerable to attacks. If the interface information is intercepted, captured or even modified, it will cause immeasurable losses.

[0003] In the existing interface communication key storage mechanism, the client key is generally stored separately in its own file. If the client code is reverse cracked and the key is obtained, it will lead to the leakage of the entire interface information and the failure of the security mechanism. The existing technical solutions fail to effectively prevent the security of system interface transmission after the client key is leaked, and the subsequent security upgrade measures and targeted punishment mechanisms are not taken. Summary of the invention

[0004] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0005] Some embodiments of the present disclosure propose a method for generating and decrypting an encryption request, a device, an electronic device, and a computer-readable medium to solve the technical problems mentioned in the above background technology section.

[0006] In a first aspect, some embodiments of the present disclosure provide a method for generating an encryption request, the method comprising: in response to detecting a request to be sent, generating a symmetric encryption algorithm key for the request to be sent; using the symmetric encryption algorithm key to encrypt request parameters in the request to be sent to obtain encrypted request parameters; sending the request parameters in the request to be sent to a target server, and obtaining signature request parameters with signature information generated by the target server; generating an encryption request based on the signature request parameters and the encryption request parameters, and sending the encryption request to an interface corresponding to the request parameters.

[0007] In a second aspect, some embodiments of the present disclosure provide a method for decrypting an encrypted request generated as described in the first aspect, the method comprising: in response to receiving an encryption request sent by a target node, decrypting the encryption request using an asymmetric encryption algorithm private key to obtain encrypted data and signature request parameters; sending the signature request parameters to a target server, and obtaining a signature verification result generated by the target server regarding the signature request parameters, wherein the signature verification result is obtained by the target server using an asymmetric encryption algorithm and using the asymmetric encryption algorithm private key to verify the signature information in the signature request parameters; in response to the signature verification result satisfying a preset condition, decrypting the encrypted data using a symmetric encryption algorithm key to obtain request parameters and executing a request regarding the request parameters.

[0008] In a third aspect, some embodiments of the present disclosure provide a device for generating an encryption request, comprising: a generation unit, configured to generate a symmetric encryption algorithm key for the request to be sent in response to detecting the request to be sent; an encryption unit, configured to encrypt the request parameters in the request to be sent using the symmetric encryption algorithm key to obtain encrypted request parameters; a first acquisition unit, configured to send the request parameters in the request to be sent to a target server, and obtain signature request parameters with signature information generated by the target server; a sending unit, configured to generate an encryption request based on the signature request parameters and the encryption request parameters, and send the encryption request to an interface corresponding to the request parameters.

[0009] In a fourth aspect, some embodiments of the present disclosure provide a decryption device for an encrypted request, comprising: a first decryption unit, configured to, in response to receiving an encryption request sent by a target node, decrypt the encryption request using a private key of an asymmetric encryption algorithm to obtain encrypted data and signature request parameters; a second acquisition unit, configured to send the signature request parameters to a target server, and obtain a signature verification result generated by the target server regarding the signature request parameters, wherein the signature verification result is obtained by the target server using an asymmetric encryption algorithm and using the private key of the asymmetric encryption algorithm to verify the signature information in the signature request parameters; the second decryption unit, configured to, in response to the signature verification result satisfying a preset condition, decrypt the encrypted data using a symmetric encryption algorithm key to obtain request parameters and execute the request regarding the request parameters.

[0010] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation method of the first aspect or the second aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect or the second aspect.

[0012] One of the above embodiments of the present disclosure has the following beneficial effects: using digital signature and signature verification technology to increase the difficulty of information tampering and enhance data integrity. Using hybrid encryption technology of symmetric encryption and asymmetric encryption to increase the difficulty of information transmission being cracked and enhance system security. Multi-level security detection and multi-process encryption and decryption processing reduce the risk of information leakage and improve the system security level. Introduce a dynamic key update mechanism to enhance information transmission security. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0014] Figure 1 is a flowchart of some embodiments of a method for generating an encryption request according to some embodiments of the present disclosure;

[0015] Figure 2 is a flow chart of some embodiments of a decryption method of a method for generating an encryption request according to the present disclosure;

[0016] Figure 3 is a schematic diagram of a multi-terminal interaction process according to some embodiments of the present disclosure;

[0017] Figure 4 is a schematic diagram of the structure of some embodiments of the encryption request generating device according to the present disclosure;

[0018] Figure 5 is a schematic diagram of the structure of some embodiments of the encryption request decryption device according to the present disclosure;

[0019] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0021] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0022] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0025] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0026] refer to Figure 1 , shows a process 100 of some embodiments of the encryption request generation method according to the present disclosure. The encryption request generation method comprises the following steps:

[0027] Step 101: In response to detecting a request to be sent, generating a symmetric encryption algorithm key for the request to be sent.

[0028] In some embodiments, in response to detecting a request to be sent, an executing entity (eg, a server) of the encryption request generation method may generate a symmetric encryption algorithm key for the request to be sent.

[0029] Here, the above symmetric encryption algorithm key is usually generated randomly.

[0030] It is understandable that the method for generating an encryption request can be executed by a terminal device, or it can also be executed by a server. The execution subject of the above method can also include a device formed by integrating the above terminal device and the above server through a network, or it can also be executed by various software programs. Among them, the terminal device can be various electronic devices with information processing capabilities, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. The execution subject can also be embodied as a server, software, etc. When the execution subject is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0031] Step 102: Encrypt the request parameters in the request to be sent using the symmetric encryption algorithm key to obtain encrypted request parameters.

[0032] In some embodiments, the execution entity (eg, a server) may use the symmetric encryption algorithm key to encrypt the request parameters in the request to be sent to obtain encrypted request parameters.

[0033] In some optional implementation methods of some embodiments, the above-mentioned execution entity can use the symmetric encryption algorithm key to symmetrically encrypt the request parameters to obtain encrypted data; use the asymmetric encryption algorithm public key to encrypt the symmetric encryption algorithm key to obtain encrypted request parameters.

[0034] Step 103: Send the request parameters in the request to be sent to the target server, and obtain the signature request parameters with signature information generated by the target server.

[0035] In some embodiments, the execution entity may send the request parameters in the request to be sent to the target server via a wired connection or a wireless connection, and obtain the signature request parameters with signature information generated by the target server.

[0036] It should be noted that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0037] In some optional implementation methods of some embodiments, the above-mentioned execution entity can convert the bean object of the request parameter into a sortMap and send it to the target server; obtain the request timestamp and unique identifier of the sortMap generated by the target server; splice the request timestamp, sortMap and unique identifier according to preset rules to obtain a spliced ​​string; send the spliced ​​string to the target server, and obtain the spliced ​​string with signature information from the target server, and use the spliced ​​string with signature information as a signature request parameter, wherein the signature information is obtained by the server using an asymmetric encryption algorithm and using the asymmetric encryption algorithm private key to sign the spliced ​​string.

[0038] Step 104: Generate an encryption request according to the signature request parameters and the encryption request parameters, and send the encryption request to an interface corresponding to the request parameters.

[0039] In some embodiments, the execution entity may generate an encryption request according to the signature request parameters and the encryption request parameters, and send the encryption request to an interface corresponding to the request parameters.

[0040] As an example, the encryption request generation method can be implemented as follows:

[0041] 1. The client converts the interface request parameter requestBody object bean into an ordered Map, namely sortMap.

[0042] 2. Request the signature verification server to obtain the timestamp of this request and the unique identifier nonce of the request.

[0043] 3. Concatenate the obtained ordered Map (sortMap), timestamp and nonce into a string: content according to the rules.

[0044] 4. Request the obtained content to the signature verification server, and generate the signature sign of this request on the signature verification server (use an independent RSA asymmetric encryption algorithm and private key to sign the content).

[0045] 5. Randomly generate the AES encryption and decryption key aes key. The AES key here needs to be randomly generated each time the interface is called. This measure can effectively improve security.

[0046] 6. Use aes key to encrypt the interface parameter requestBody, data = base64 (AES (json parameter)).

[0047] 7. Encrypt the AES key using the RSA public key (the agreed public key is used for the first time, and then obtained according to the business process), effectively ensuring the reliability and security of the key of the AES algorithm key = base64 (RSA (AES key)).

[0048] 8. Concatenate the client request json data. After the above steps, the basic data content of the interface transmission is obtained. Generate an encrypted request according to the following interface request data format and send it to the interface:

[0049] {

[0050] key:base64(RSA(aes key)),

[0051] data:base64(AES(json parameter)),

[0052] "timestamp":"",

[0053] "nonce":"",

[0054] "sign":""

[0055] }.

[0056] 9. Perform different business logic processing according to the status code returned by the interface request: The interface returns a successful status code: process according to normal logic.

[0057] The interface returns the RSA public key replacement status code (abnormal code): request the server to obtain the latest RSA public key, and all subsequent operations will use this latest public key for encryption operations.

[0058] Specifically, Figure 3 As shown, Figure 3 is a schematic diagram of a multi-terminal interaction process in some embodiments of the present disclosure, Figure 3 The client (target node) in is the execution subject of a method for generating an encryption request. Figure 3 The signature verification server in is the target server. Figure 3 The server (interface) in is the execution subject of an encryption request decryption method.

[0059] The client requests the content to be signed and verified: To ensure that the requested data is not maliciously tampered with, the client in the present invention will perform a signature operation on the requested data according to special rules. At the same time, the server will perform a data verification process on the data to protect the data integrity to the greatest extent.

[0060] The signing and verification operations of the request content are performed on the signature verification server. When the client signs the data, it uses the RSA asymmetric encryption algorithm and its private key used exclusively by the signature verification server to sign the content processed according to special rules. When the server verifies the request content, it uses its own public key and corresponding attributes for verification.

[0061] The client's signing operation on the request content includes: the timestamp of this request, the unique identifier of the request: nonce and the content of this request generate a string according to special rules, and then send it to the signature verification server for content signing.

[0062] When the server receives the request, it sends the request content and the original signature content to the signature verification server for verification according to the rules.

[0063] Client parameter encryption process: In order to further increase the security of interface transmission information, the client parameter encryption process in the present invention includes symmetric encryption and asymmetric encryption.

[0064] Symmetric encryption provides the first layer of protection for parameters, while asymmetric encryption provides the second layer of protection for parameters. Asymmetric encryption algorithms require two keys: a public key and a private key. The public key and the private key are a pair. If the data is encrypted with the public key, it can only be decrypted with the corresponding private key.

[0065] In the present invention, the client uses the public key of RSA to encrypt the parameter information, and the server uses the private key of RSA to decrypt the parameter information. When the system is run for the first time, the public key and private key agreed in advance by both parties are used, and the subsequent operations follow the interactive process.

[0066] The symmetric encryption algorithm in the present invention is AES, and the asymmetric encryption algorithm is RSA

[0067] Implement dynamic secret keys: If the system server recognizes that the interface information has been cracked and determines that the client key has been leaked or the information has been tampered with, the server can immediately update the private key content of the asymmetric encryption algorithm in the existing interface. If the private key is replaced, the client determines whether to update the public key of the asymmetric algorithm through a specific abnormal status code. This operation implements a mechanism for synchronization between the client and the server after the asymmetric key is changed. This mechanism for updating secret keys is extremely difficult to be identified by reverse engineers. If the client still uses the old key for data encryption after the key is replaced, the system will easily identify the abnormal person and take effective blocking measures.

[0068] System blocks illegal information: If illegal requests exceed the threshold, the server determines that the client request is an illegal operation, and actively blocks the IP and user of the client request, and records the current device information, and subsequently blocks the relevant personnel who use this device to operate, so as to continuously maintain system security.

[0069] This method aims to protect the request data from being maliciously tampered with, increase the difficulty of the interface being cracked, and block the relevant subject content, including devices, IP, etc. In order to protect the request data from being maliciously tampered with, the present invention will sign the interface request data with special rules, and perform an effective data signature verification process on the server side to maximize the program protection of data integrity; in order to increase the difficulty of cracking during transmission, the present invention adopts a complex parameter encryption process on the client side and a dynamic key generation and blocking processing strategy on the server side, which significantly increases the difficulty of the interface being cracked and can achieve dynamic key updates, thereby continuously and effectively protecting the information security of the interface communication and accurately punishing the manipulators behind the corresponding interface cracking.

[0070] One of the above embodiments of the present disclosure has the following beneficial effects: using digital signature and signature verification technology to increase the difficulty of information tampering and enhance data integrity. Using hybrid encryption technology of symmetric encryption and asymmetric encryption to increase the difficulty of information transmission being cracked and enhance system security. Multi-level security detection and multi-process encryption and decryption processing reduce the risk of information leakage and improve the system security level. Introduce a dynamic key update mechanism to enhance information transmission security.

[0071] Continue to refer Figure 2 , shows a process 200 of some embodiments of the encryption request decryption method according to the present disclosure. The encryption request generation method comprises the following steps:

[0072] Step 201, in response to receiving an encryption request sent by a target node, decrypt the encryption request using an asymmetric encryption algorithm private key to obtain encrypted data and signature request parameters.

[0073] In some embodiments, in response to receiving an encryption request sent by a target node, the execution entity may decrypt the encryption request using an asymmetric encryption algorithm private key to obtain encrypted data and signature request parameters.

[0074] It is understandable that the decryption method of the encrypted request can be executed by a terminal device, or it can also be executed by a server. The execution subject of the above method can also include a device formed by integrating the above terminal device and the above server through a network, or it can also be executed by various software programs. Among them, the terminal device can be various electronic devices with information processing capabilities, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. The execution subject can also be embodied as a server, software, etc. When the execution subject is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0075] Step 202: Send the signature request parameters to a target server, and obtain a signature verification result generated by the target server regarding the signature request parameters.

[0076] In some embodiments, the above-mentioned execution entity can send the signature request parameters to the target server, and obtain the signature verification result generated by the target server regarding the signature request parameters, wherein the signature verification result is obtained by the target server using an asymmetric encryption algorithm and using the asymmetric encryption algorithm private key to verify the signature information in the signature request parameters.

[0077] Step 203: In response to the signature verification result satisfying a preset condition, the encrypted data is decrypted using a symmetric encryption algorithm key to obtain request parameters and execute a request regarding the request parameters.

[0078] In some embodiments, in response to the signature verification result satisfying a preset condition, the execution entity may decrypt the encrypted data using a symmetric encryption algorithm key to obtain request parameters and execute a request regarding the request parameters.

[0079] In some optional implementations of some embodiments, in response to detecting an exception during the decryption process of the encryption request, the above-mentioned execution entity may generate an exception status code; send the exception status code to the target node, and replace the asymmetric encryption algorithm private key, the asymmetric encryption algorithm public key and / or the encryption algorithm key.

[0080] As an example, the encryption request decryption method can be performed as follows:

[0081] 1. After receiving the client request, the server first obtains the RSA private key currently used by the server, and then uses this private key to decrypt the key value in the client request parameter.

[0082] If the decryption is successful using the private key, it means that the request is legal, and the real JSON parameter is obtained by decrypting the data using the aes key.

[0083] 2. Check the received parameters: timestamp, nonce. If the timestamp is greater than the current time and exceeds the threshold, the abnormal process is executed. If the nonce is requested repeatedly, the abnormal process is executed.

[0084] 3. Get the currently valid request content, then concatenate the timestamp and nonce with the request sign to call the signature verification server for verification.

[0085] The signature verification server uses the request content, timestamp, and nonce to generate a signature according to specific rules and the signature verification service's own public key, and then verifies the signature with the request sign content.

[0086] If the signature verification fails, the exception process will be executed.

[0087] 4. Finally, map the request parameters to the parameter object of the interface, and then continue to execute the server-side business logic;

[0088] If the private key decryption fails or the signature verification fails, it means that the request is illegal and the client is still using the abandoned public key for operation. The service returns an error code for changing the RSA public key and records the relevant body content of the request.

[0089] 6. Determine and replace the RSA public key and private key used by the current system:

[0090] If it is determined that the RSA public key has been leaked or the data has been tampered with, the system will generate a new RSA public key and private key and replace the RSA private key currently used by the server.

[0091] Through this measure, if the client (target node) public key is not updated and continues to request in the original way, the server (interface) will fail to decrypt. If the request fails multiple times, it will trigger an early warning and blocking measures.

[0092] If the client recognizes the error code for changing the RSA public key and performs the corresponding public key replacement operation, the warning content will be automatically cleared after the interface request.

[0093] 7. Block illegal request entities:

[0094] If the server identifies an illegal request and reaches the corresponding threshold, the system will block the subject information, including blocking the requesting IP (prohibiting the receipt of requests from this IP), blocking the user (freezing the current user status), and recording the current device information. If the device continues to operate, the relevant IP and user will be blocked.

[0095] Specifically, Figure 3 As shown, Figure 3 is a schematic diagram of a multi-terminal interaction process in some embodiments of the present disclosure, Figure 3 The client (target node) in is the execution subject of a method for generating an encryption request. Figure 3 The signature verification server in is the target server. Figure 3 The server (interface) in is the execution subject of an encryption request decryption method.

[0096] One of the above embodiments of the present disclosure has the following beneficial effects: using digital signature and signature verification technology to increase the difficulty of information tampering and enhance data integrity. Using hybrid encryption technology of symmetric encryption and asymmetric encryption to increase the difficulty of information transmission being cracked and enhance system security. Multi-level security detection and multi-process encryption and decryption processing reduce the risk of information leakage and improve the system security level. Introduce a dynamic key update mechanism to enhance information transmission security.

[0097] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a device for generating an encryption request, and these device embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0098] like Figure 4 As shown, the encryption request generation device 400 of some embodiments includes: a generation unit 401, an encryption unit 402, a first acquisition unit 403 and a sending unit 404. Among them, the generation unit 401 is configured to generate a symmetric encryption algorithm key for the request to be sent in response to detecting the request to be sent; the encryption unit 402 is configured to encrypt the request parameters in the request to be sent using the symmetric encryption algorithm key to obtain the encrypted request parameters; the first acquisition unit 403 is configured to send the request parameters in the request to be sent to the target server, and obtain the signature request parameters with signature information generated by the target server; the sending unit 404 is configured to generate an encryption request according to the signature request parameters and the encryption request parameters, and send the encryption request to the interface corresponding to the request parameters.

[0099] It is understood that the units described in the device 400 are similar to those described in the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 400 and the units included therein, and will not be described in detail here.

[0100] One of the above embodiments of the present disclosure has the following beneficial effects: using digital signature and signature verification technology to increase the difficulty of information tampering and enhance data integrity. Using hybrid encryption technology of symmetric encryption and asymmetric encryption to increase the difficulty of information transmission being cracked and enhance system security. Multi-level security detection and multi-process encryption and decryption processing reduce the risk of information leakage and improve the system security level. Introduce a dynamic key update mechanism to enhance information transmission security.

[0101] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an encrypted request decryption device. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0102] like Figure 5 As shown, the encryption request decryption device 500 of some embodiments includes: a first decryption unit 501, a second acquisition unit 502, and a second decryption unit 503. The first decryption unit 501 is configured to, in response to receiving an encryption request sent by a target node, decrypt the encryption request using an asymmetric encryption algorithm private key to obtain encrypted data and signature request parameters; the second acquisition unit 502 is configured to send the signature request parameters to a target server, and obtain the signature verification result generated by the target server regarding the signature request parameters, wherein the signature verification result is obtained by the target server using an asymmetric encryption algorithm and using the asymmetric encryption algorithm private key to verify the signature information in the signature request parameters; the second decryption unit 503 is configured to, in response to the signature verification result satisfying a preset condition, decrypt the encrypted data using a symmetric encryption algorithm key to obtain request parameters and execute the request regarding the request parameters.

[0103] It is understood that the units described in the device 500 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0104] One of the above embodiments of the present disclosure has the following beneficial effects: using digital signature and signature verification technology to increase the difficulty of information tampering and enhance data integrity. Using hybrid encryption technology of symmetric encryption and asymmetric encryption to increase the difficulty of information transmission being cracked and enhance system security. Multi-level security detection and multi-process encryption and decryption processing reduce the risk of information leakage and improve the system security level. Introduce a dynamic key update mechanism to enhance information transmission security.

[0105] Reference below Figure 6, which shows a structural diagram of an electronic device (eg, an execution subject of an encryption request generation method or an execution subject of an encryption request decryption method) 600 suitable for implementing some embodiments of the present disclosure. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0106] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0107] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0108] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0109] It should be noted that the computer-readable medium described in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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.

[0110] In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.

[0111] The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0112] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0113] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: generates a symmetric encryption algorithm key for the request to be sent in response to detecting the request to be sent; encrypts the request parameters in the request to be sent using the symmetric encryption algorithm key to obtain encrypted request parameters; sends the request parameters in the request to be sent to the target server, and obtains the signature request parameters with signature information generated by the target server; generates an encrypted request based on the signature request parameters and the encryption request parameters, and sends the encrypted request to the interface corresponding to the request parameters. Or the electronic device: in response to receiving an encryption request sent by a target node, decrypt the encryption request using an asymmetric encryption algorithm private key to obtain encrypted data and signature request parameters; send the signature request parameters to a target server, and obtain a signature verification result generated by the target server on the signature request parameters, wherein the signature verification result is obtained by the target server using an asymmetric encryption algorithm and using an asymmetric encryption algorithm private key to verify the signature information in the signature request parameters; in response to the signature verification result satisfying a preset condition, decrypt the encrypted data using a symmetric encryption algorithm key to obtain request parameters and execute a request on the request parameters. .

[0114] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including a generation unit, an encryption unit, a first acquisition unit, and a sending unit. The names of these units do not constitute limitations on the units themselves in certain circumstances, for example, the generation unit may also be described as "a unit that generates a symmetric encryption algorithm key for a request to be sent in response to detecting the request to be sent".

[0117] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0118] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A method for generating an encryption request, comprising: In response to detecting a request to be sent, generating a symmetric encryption algorithm key for the request to be sent; Encrypting the request parameters in the request to be sent using the symmetric encryption algorithm key to obtain encrypted request parameters; Send the request parameters in the request to be sent to the target server, and obtain the signature request parameters with signature information generated by the target server; An encryption request is generated according to the signature request parameter and the encryption request parameter, and the encryption request is sent to an interface corresponding to the request parameter.

2. The method according to claim 1, wherein: The sending of the request parameters in the request to be sent to the target server and obtaining the signature request parameters with signature information generated by the target server includes: Convert the bean object of the request parameter into sortMap and send it to the target server; Obtaining a request timestamp and a unique identifier for the sortMap generated by the target server; Concatenate the request timestamp, sortMap and unique identifier according to a preset rule to obtain a concatenated string; The concatenated string is sent to the target server, and the concatenated string with signature information is obtained from the target server, and the concatenated string with signature information is used as a signature request parameter, wherein the signature information is obtained by the server using an asymmetric encryption algorithm and a private key of the asymmetric encryption algorithm to sign the concatenated string.

3. The method according to claim 1, wherein: The step of encrypting the request parameters in the request to be sent by using the symmetric encryption algorithm key to obtain the encrypted request parameters includes: Using the symmetric encryption algorithm key to symmetrically encrypt the request parameter to obtain encrypted data; The symmetric encryption algorithm key is encrypted using the asymmetric encryption algorithm public key to obtain encryption request parameters.

4. A method for decrypting an encrypted request generated according to the method of any one of claims 1 to 3, comprising: In response to receiving the encryption request sent by the target node, decrypt the encryption request using the asymmetric encryption algorithm private key to obtain encrypted data and signature request parameters; Send the signature request parameters to the target server, and obtain the signature verification result generated by the target server on the signature request parameters, wherein the signature verification result is obtained by the target server using an asymmetric encryption algorithm and a private key of the asymmetric encryption algorithm to verify the signature information in the signature request parameters; In response to the signature verification result satisfying a preset condition, the encrypted data is decrypted using a symmetric encryption algorithm key to obtain request parameters and execute a request regarding the request parameters.

5. The method according to claim 4, wherein: The method further comprises: In response to detecting an exception occurring during the decryption process of the encryption request, generating an exception status code; The abnormal status code is sent to the target node, and the asymmetric encryption algorithm private key, the asymmetric encryption algorithm public key and / or the encryption algorithm key are replaced.

6. An encryption request generating device, comprising: A generating unit, configured to generate a symmetric encryption algorithm key for the request to be sent in response to detecting the request to be sent; an encryption unit, configured to encrypt the request parameters in the request to be sent using the symmetric encryption algorithm key to obtain encrypted request parameters; A first obtaining unit is configured to send the request parameters in the request to be sent to a target server, and obtain the signature request parameters with signature information generated by the target server; The sending unit is configured to generate an encryption request according to the signature request parameter and the encryption request parameter, and send the encryption request to an interface corresponding to the request parameter.

7. An encrypted request decryption device, comprising: A first decryption unit is configured to, in response to receiving an encryption request sent by a target node, decrypt the encryption request using a private key of an asymmetric encryption algorithm to obtain encrypted data and a signature request parameter; A second obtaining unit is configured to send the signature request parameters to a target server, and obtain a signature verification result generated by the target server regarding the signature request parameters, wherein the signature verification result is obtained by the target server using an asymmetric encryption algorithm and a private key of the asymmetric encryption algorithm to verify the signature information in the signature request parameters; The second decryption unit is configured to, in response to the signature verification result satisfying a preset condition, decrypt the encrypted data using a symmetric encryption algorithm key to obtain a request parameter and execute a request regarding the request parameter.

8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in any one of claims 1-3 or 4-5.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 3 or 4 to 5 is implemented.

Citation Information

Cited By

  • Security encryption method, device, system and equipment for vehicle information and medium

    CN120389894A