Method and processor for processing data
By generating and encrypting verification data based on the importance level of the data, the problem of low security during data transmission is solved, and the security of data transmission is improved.
Patent Information
- Application Number
- CN202310790490.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-06-29
AI Technical Summary
During data transmission, the use of the HTTP protocol poses risks of sensitive information visibility and leakage, resulting in low security.
By determining the importance level of the data to be transmitted, corresponding verification data is generated. The verification data and the data to be transmitted are then encrypted to construct encrypted request data, which is then verified by the server to determine the security of the data.
It improves the security of data transmission, ensures that data is not tampered with during transmission, and verifies the authenticity and integrity of the data.
Smart Images

Figure CN116707958B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more specifically, to a data processing method and a processor. Background Technology
[0002] Currently, in data exchange scenarios, data transmission is generally completed through dedicated lines with other cooperating platforms. In special scenarios, the Internet and Hypertext Transfer Protocol (HTTP) may be used. However, the above methods have the visibility of sensitive information during data transmission, and data transmission using the HTTP protocol is easily monitored, posing a risk of sensitive information leakage, thus resulting in low security in the data transmission process.
[0003] There is currently no effective solution to the technical problem of low security during data transmission. Summary of the Invention
[0004] This application provides a data processing method, processor, and electronic device to solve the problem of low security during data transmission.
[0005] According to one aspect of this application, a data processing method is provided. The method may include: receiving a transmission request, wherein the transmission request is used to request the transmission of data to be transmitted to a server; determining the importance level of the data to be transmitted; determining verification data corresponding to the importance level, wherein the verification data is used to verify the data to be transmitted; encrypting the verification data and the data to be transmitted, and obtaining encrypted request data based on the encrypted verification data and the data to be transmitted, wherein the encrypted request data is used to enable the server to verify the verification data, and determining the security of the data to be transmitted based on the obtained verification result.
[0006] Optionally, determining the verification data corresponding to the importance level includes: determining the verification data based on the magnitude relationship between the target level and the importance level.
[0007] Optionally, based on the relationship between the target level and the importance level, the verification data is determined, including: in response to the importance level being greater than the target level, the verification data includes at least two of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0008] Optionally, based on the relationship between the target level and the importance level, the verification data is determined, including: in response to the importance level not being greater than the target level, the verification data includes any one of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0009] Optionally, the verification data and the data to be transmitted are encrypted to obtain encrypted request data, including: obtaining the first key in the transmission request; converting the data composed of the verification data, the data to be transmitted and the first key into a string; performing a message digest on the string to obtain message digest data; encrypting the message digest data to obtain a signature string; and constructing encrypted request data based on the signature string.
[0010] Optionally, based on the signature string, constructing encrypted request data includes: encrypting the first key based on the first public key to obtain a key string, and encrypting the data to be transmitted based on the first key to obtain an encrypted message; combining the encrypted message, the signature string, and the key string to obtain encrypted request data.
[0011] According to one aspect of this application, another data processing method is also provided. This method may include: acquiring encrypted request data from a client; decrypting the encrypted request data to obtain decrypted data; and determining a verification result based on the decrypted data, wherein the verification result is used to characterize the validity of the encrypted request data.
[0012] Optionally, determining the verification result based on the decrypted data includes: obtaining the client's verification data from the database; determining the target verification data based on the verification data and the decrypted data, and determining the message digest data in the decrypted data; verifying the target verification data based on the message digest data to obtain the verification result.
[0013] Optionally, the target verification data is verified based on the message digest data to obtain a verification result, including: in response to the message digest data being the same as the target verification data, determining that the verification result is used to characterize the encrypted request data as valid data.
[0014] Optionally, determining the message digest data in the decrypted data includes: decrypting the signature string in the encryption request data based on the first key to obtain the message digest data.
[0015] According to another aspect of this application, a data processing apparatus is also provided. The apparatus may include: a receiving unit for receiving a transmission request, wherein the transmission request requests the transmission of data to be transmitted to a server; a first determining unit for determining the importance level of the data to be transmitted; a second determining unit for determining verification data corresponding to the importance level, wherein the verification data is used to verify the data to be transmitted; and an encryption unit for encrypting the verification data and the data to be transmitted, and obtaining encrypted request data based on the encrypted verification data and the data to be transmitted, wherein the encrypted request data is used to enable the server to verify the verification data, and the security of the data to be transmitted is determined based on the obtained verification result.
[0016] According to another aspect of this application, another data processing apparatus is also provided. The apparatus may include: an acquisition unit for acquiring encrypted request data from a client; a decryption unit for decrypting the encrypted request data to obtain decrypted data; and a third determination unit for determining a verification result based on the decrypted data, wherein the verification result characterizes the validity of the encrypted request data.
[0017] According to another aspect of the present invention, a processor is also provided, which is used to run a program, wherein the program executes a data processing method during runtime.
[0018] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute a data processing method.
[0019] This application employs the following steps: receiving a transmission request, wherein the transmission request is used to request the transmission of data to be transmitted to the server; determining the importance level of the data to be transmitted; determining verification data corresponding to the importance level, wherein the verification data is used to verify the data to be transmitted; encrypting the verification data and the data to be transmitted, and obtaining encrypted request data based on the encrypted verification data and the data to be transmitted, wherein the encrypted request data is used to enable the server to verify the verification data, and determining the security of the data to be transmitted based on the obtained verification result. That is, in this application, based on the importance level of the data to be transmitted in the client, the verification data that needs to be encrypted is determined; encrypted request data is generated based on the verification data and the request is sent to the server; the server verifies the verification data in the encrypted request data, and based on the verification result, determines whether the data to be transmitted has been modified during transmission. Thus, by encrypting the data to be transmitted to ensure its security, and by verifying the verification data to determine whether the data to be transmitted has been modified, the technical effect of improving the security of data transmission is achieved, solving the technical problem of low security during data transmission. Attached Figure Description
[0020] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0021] Figure 1 This is a flowchart of a data processing method provided according to an embodiment of this application;
[0022] Figure 2 This is a flowchart of another data processing method provided according to an embodiment of this application;
[0023] Figure 3 This is a flowchart illustrating a data processing procedure in a client according to an embodiment of this application;
[0024] Figure 4 This is a flowchart illustrating a data processing procedure in a server according to an embodiment of this application;
[0025] Figure 5 This is a schematic diagram of a data processing apparatus according to an embodiment of this application;
[0026] Figure 6 This is a schematic diagram of another data processing apparatus according to an embodiment of this application;
[0027] Figure 7 This is a hardware structure block diagram of an electronic device (or mobile device) for a data processing method according to an embodiment of the present invention. Detailed Implementation
[0028] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first," "second," etc., used in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be used interchangeably where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] Example 1
[0032] It should be noted that the data processing method and apparatus in this application can be used in the field of data processing for transmitting data, or in any field other than data processing for transmitting data. This application does not limit the application field of the data processing method.
[0033] The present invention will now be described in conjunction with preferred implementation steps.
[0034] This application provides a data processing method embodiment to solve the technical problem of low security during data transmission. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0035] Figure 1 This is a flowchart of a data processing method provided according to an embodiment of this application, such as... Figure 1 As shown, the method may include the following steps:
[0036] Step S102: Receive a transmission request, wherein the transmission request is used to request that the data to be transmitted be transmitted to the server.
[0037] Step S104: Determine the importance level of the data to be transmitted.
[0038] Step S106: Determine the verification data corresponding to the importance level, wherein the verification data is used to verify the data to be transmitted.
[0039] Step S108: Encrypt the verification data and the data to be transmitted, and obtain encrypted request data based on the encrypted verification data and the data to be transmitted. The encrypted request data is used to enable the server to verify the verification data, and determine the security of the data to be transmitted based on the obtained verification result.
[0040] Through the above steps, a transmission request created by the service requester can be obtained. Upon receiving the transmission request, the importance level of the data to be transmitted can be determined, and verification data matching the importance level can be identified. Both the verification data and the data to be transmitted can be encrypted, and encrypted request data can be obtained based on the encrypted verification data and the data to be transmitted. The encrypted request data can be sent to the server. The server can verify the encrypted request data and determine whether the data to be transmitted has been tampered with based on the verification result, thus determining the security of the data to be transmitted. The service requester can be a client. The transmission request can be used to request the transmission of data to be transmitted to the server. It can be a request created by the client based on actual needs, such as an HTTP request sent by the client based on the HTTP protocol. This is only an example and does not impose specific restrictions on the type and creation method of the transmission request. The importance level can be used to characterize the importance of the data to be transmitted. For example, a higher level indicates greater importance, or a lower level indicates greater importance. The importance level can be represented by Chinese characters, numbers, etc., such as "Level 1" or "Level 1". This is only an example and does not impose specific restrictions on the relationship between importance level and importance, or on the representation of the importance level. Verification data can be used to verify whether the data to be transmitted has been tampered with. It may include the client's latitude and longitude information, network protocol address, and the client's Media Access Control Address (MAC address), etc. This is just an example and does not impose specific restrictions on the types of verification data. The data to be transmitted can be data corresponding to the transmission request, or it can be business data (biz).
[0041] Optionally, when a client wants to transmit data to the server, it can create a transmission request. Upon receiving the client's transmission request, the server determines the verification data corresponding to the importance level. It can encrypt the verification data and the data to be transmitted using a pre-defined encryption method, and construct encrypted request data based on the encrypted data. This encrypted request data can then be sent to the server. The server can verify the encrypted request data and determine whether the data to be transmitted has been tampered with based on the verification result, thus determining the security of the data to be transmitted. Here, the server can be the service responder. The encrypted request data can be request data including verification data and the data to be transmitted, or it can be a request constructed based on the encrypted verification data and the data to be transmitted. It can be used to enable the server to verify the verification data and determine the security of the data to be transmitted based on the obtained verification result.
[0042] For example, when a client wants to transmit data to the server, it can create a transmission request. Upon receiving the client's transmission request, the server can determine the verification data corresponding to the data to be transmitted in the transmission request based on a pre-defined correspondence between importance levels and verification data. It can then encrypt both the verification data and the data to be transmitted using a pre-defined encryption method, constructing encrypted request data based on the encrypted data. This encrypted request data can be sent to the server, which can verify it. Based on the verification result, it can determine whether the data to be transmitted has been tampered with. If the data to be transmitted has not been tampered with, it can be determined that the data is secure, and subsequent storage or transmission operations can proceed. If the data to be transmitted has been tampered with, it can be determined that the data is insecure, and operations on the data to be transmitted can be terminated to ensure system security.
[0043] For example, the encryption method can be pre-set to encrypt the data using RAS or AES algorithms, with a priority level of 1. This means that the more sensitive information in the data to be transmitted, the higher the priority level of the verification data will be, specifically the client's latitude and longitude and the creation time of the transmission request. Upon receiving the client's transmission request, the system determines the data to be transmitted. Since the priority level of the data to be transmitted is determined to be 1, the verification data can be the client's latitude and longitude and the creation time of the transmission request. The client's latitude and longitude, the creation time of the transmission request, and the data to be transmitted can be encrypted, and encrypted request data can be constructed based on the encrypted data.
[0044] As an optional example, encrypted request data can be obtained by assigning encrypted data to the corresponding location in the transmission request. For instance, the client's latitude and longitude from the encrypted verification data can be assigned to a custom field in the HTTP request header, the request creation time (worktime) from the encrypted verification data can be copied to the timestamp field in the request data header, and the encrypted data to be transmitted can be assigned to the message body in the request data. It should be noted that this is merely an example and does not impose specific restrictions on the method of constructing encrypted request data.
[0045] In this application, a transmission request is received, wherein the transmission request is used to request the transmission of data to be transmitted to the server; the importance level of the data to be transmitted is determined; verification data corresponding to the importance level is determined, wherein the verification data is used to verify the data to be transmitted; the verification data and the data to be transmitted are encrypted to obtain encrypted request data, wherein the encrypted request data is used to enable the server to verify the verification data, and the security of the data to be transmitted is determined based on the obtained verification result. That is, in this application, based on the importance level of the data to be transmitted in the client, the verification data that needs to be encrypted is determined, encrypted request data is generated based on the verification data and the request is sent to the server. The server verifies the verification data in the encrypted request data, and based on the verification result, determines whether the data to be transmitted has been modified during transmission. Thus, the security of the data to be transmitted can be ensured by encrypting the data to be transmitted, and the modification of the data to be transmitted can be determined by verifying the verification data, thereby achieving the technical effect of improving the security of data transmission and solving the technical problem of low security during data transmission.
[0046] The embodiments of the present invention will now be described in detail with reference to the steps described above.
[0047] As an optional embodiment, step S106, determining the verification data corresponding to the importance level, includes: determining the verification data based on the size relationship between the target level and the importance level.
[0048] In this embodiment, the relative importance of the target level and the importance level can be determined, and verification data can be determined based on the relationship between the target level and the importance level. The target level can be a pre-set level according to actual conditions, such as level one, level two, etc. This is merely an example, and no specific limitations are made on the size and form of the target level.
[0049] For example, if the higher the target level of the data to be transmitted, the more important the data, then the target level can be set to level six. Verification data for importance levels greater than six would be the client's real location information and Internet Protocol (IP) address information. If the importance level of the data to be transmitted can be determined to be level eight, indicating a target level greater than the importance level, then the data to be transmitted can be determined to be relatively important, and the verification data would then be the client's real location information and IP address information.
[0050] For example, if the lower the target level of the data to be transmitted, the more important the data, then the target level can be set to level three. For importance levels lower than level three, the verification data is simply the setting time of the transmission request. If the importance level of the data to be transmitted is determined to be level two, the target level is lower than the importance level, and the data to be transmitted is not very important, then to improve data processing efficiency, the verification data can be determined to be only the creation time of the transmission request.
[0051] Because existing technologies only encrypt the data to be transmitted, they cannot determine whether the data has been modified during the encryption process. This can lead to the server receiving modified data and processing it subsequently, resulting in low security during data transmission. In this embodiment, verification data is set up, and the security of the data to be transmitted is determined based on this verification data, thereby improving the security of data transmission. Furthermore, considering data processing efficiency, this embodiment can determine the type and category of verification data based on the importance level of the data to be transmitted, thus achieving the technical effect of improving security during data transmission while ensuring data processing efficiency.
[0052] As an optional embodiment, the verification data is determined based on the relationship between the target level and the importance level, including: in response to the importance level being greater than the target level, the verification data is determined to include at least two of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0053] In this embodiment, the relationship between the target level and the importance level is determined. If the importance level is greater than the target level, it indicates that the importance of the data to be transmitted is high. Therefore, the verification data includes at least two of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0054] It should be noted that, in addition to the above, the content of the verification data can be added according to the actual situation. For example, the virtual server address information used by the client can be added. There are no specific restrictions here.
[0055] Optionally, the importance level of the data to be transmitted can be determined. If the importance level is greater than the target level, the verification data can be determined to include two or more of the following: the client's address data, the client's latitude and longitude data, and the creation time of the transmission request.
[0056] For example, if the importance level is predetermined to be greater than the target level, the verification data can be determined to include two or more of the following: the client's address data, the client's latitude and longitude data, and the creation time of the transmission request. Upon receiving the data to be transmitted corresponding to the transmission request, the importance level of the data to be transmitted is determined. If the importance level is determined to be greater than the target level, the client interface can display "Please select at least two verification data." Based on the client's selection, the verification data is determined to be the client's address data and the client's latitude and longitude data. When the verification data is determined to be the client's address data and the client's latitude and longitude data, a data retrieval request can be initiated to the client (e.g., requesting to retrieve the client's address data and the client's latitude and longitude data). In response to the client's permission to retrieve the data corresponding to the data retrieval request, the client's address data and the client's latitude and longitude data can be retrieved, thus obtaining the verification data.
[0057] As an optional embodiment, the verification data is determined based on the size relationship between the target level and the importance level, including: in response to the importance level not being greater than the target level, the verification data is determined to include any one of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0058] In this embodiment, the relationship between the target level and the importance level is determined. If the importance level is not greater than the target level, it can be said that the importance of the data to be transmitted is low. In this case, the verification data can be determined to include at least one of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0059] Optionally, the importance level of the data to be transmitted can be determined. If the importance level is not greater than the target level, the verification data can be determined to include: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0060] For example, if the importance level is pre-defined to be no greater than the target level, the verification data can be determined to include any one of the following: the client's address data, the client's latitude and longitude data, and the creation time of the transmission request. The client can accept the data to be transmitted corresponding to the transmission request, determine the importance level of the data to be transmitted, and if the importance level is determined to be no greater than the target level, then the client interface can display "Please select a verification data." Based on the client's selection, the verification data can be determined to be the client's address data. When the verification data is determined to be the client's address data, a data retrieval request can be initiated to the client (e.g., requesting to retrieve the client's address data). In response to the client's permission to retrieve the data corresponding to the data retrieval request, the client's address data can be retrieved, thus obtaining the verification data.
[0061] As an optional embodiment, step S108, which encrypts the verification data and the data to be transmitted, and obtains encrypted request data based on the encrypted verification data and the data to be transmitted, includes: obtaining a first key in the transmission request; converting the data composed of the verification data, the data to be transmitted, and the first key into a string; performing a message digest on the string to obtain message digest data; encrypting the message digest data to obtain a signature string; and constructing encrypted request data based on the signature string.
[0062] In this embodiment, a first key dynamically generated by the client when creating a transmission request can be obtained. The data packet consisting of the data to be transmitted, verification data, and the first key can be converted into a string. The string can be processed to obtain a message digest data. An encryption algorithm can be used to encrypt the message digest data to obtain a signature string, which can then be used to construct encrypted request data. The first key can be a symmetric encryption key (Advanced Encryption Standard Key, or AES Key) for secondary encryption. The string can be a lightweight data interchange format (JavaScript Object Notation, or JSON) string. The message digest data (reqMd5) can be data determined by a message digest algorithm, and the message digest data can be represented as a string. The signature string (Client Sign) can also be called verification data.
[0063] Optionally, when a client creates an HTTP request, a first key is dynamically generated. This first key can be used to encrypt the data to be transmitted. The data packet containing the data to be transmitted, verification data, and the first key can be converted into a string. This string can then be processed using the MD5 (Message-Digest Algorithm) to obtain a message digest. The message digest can then be encrypted using an asymmetric encryption algorithm public key (RSA public key) to obtain a signature string.
[0064] For example, a data packet containing the data to be transmitted and verification data can be constructed. For instance, the data packet could include "data to be transmitted (biz) + MAC address + latitude and longitude." The data packet plus the first key can be converted into a string. The string can be encrypted using the MD5 algorithm to generate a message digest, reqMd5. The digest string can be encrypted using an RSA public key to obtain a signature string (Client Sign). Encrypted request data can then be constructed based on the signature string.
[0065] As an optional embodiment, constructing encrypted request data based on the signature string includes: encrypting a first key based on a first public key to obtain a key string, and encrypting the data to be transmitted based on the first key to obtain an encrypted message; and combining the encrypted message, the signature string, and the key string to obtain encrypted request data.
[0066] In this embodiment, a first key can be encrypted using a first public key to obtain a key string. Furthermore, the first key and the data to be transmitted can be encrypted to obtain an encrypted message. The encrypted message, signature string, and key string can be combined to construct an encryption request. The first public key can be an asymmetric encryption algorithm public key. The key string (AESStr) can be used to transmit the encrypted first key to the server. The encrypted message, also known as an encryption request message (bizAes), can be used to transmit the encrypted data to be transmitted.
[0067] Optionally, when creating a transmission request, the client needs to dynamically generate a first key. Since the first key is generated dynamically through code, the risk of data leakage due to internal personnel disclosing fixed password values can be avoided. The first key can be used to encrypt the request data (data to be transmitted) to obtain an encrypted message. Furthermore, the AES key can be encrypted using an RSA public key to generate a key string, thus achieving the purpose of encrypting the AES key. Encrypted request data can be obtained by combining the encrypted message, the signature string, and the key string.
[0068] For example, an encrypted message can be assigned to the message of a transmission request, and a signature string and a key string can be assigned to the corresponding positions in the transmission request to obtain encrypted request data. For instance, the signature string can be assigned to the Authorization field in the HTTP request header, the key string to a custom field (such as the K_key field) in the HTTP request header, and the encrypted message can be assigned to the message in the HTTP request header to obtain encrypted request data.
[0069] In this embodiment, a transmission request is received, wherein the transmission request is used to request the transmission of data to be transmitted to the server; the importance level of the data to be transmitted is determined; verification data corresponding to the importance level is determined, wherein the verification data is used to verify the data to be transmitted; the verification data and the data to be transmitted are encrypted, and encrypted request data is obtained based on the encrypted verification data and the data to be transmitted, wherein the encrypted request data is used to enable the server to verify the verification data, and the security of the data to be transmitted is determined based on the obtained verification result. That is, in this application, the verification data that needs to be encrypted is determined according to the importance level of the data to be transmitted in the client, encrypted request data is generated based on the verification data and the request is sent to the server, the server verifies the verification data in the encrypted request data, and determines whether the data to be transmitted has been modified during the transmission based on the verification result. Thus, the security of the data to be transmitted can be ensured by encrypting the data to be transmitted, and the modification of the data to be transmitted can be determined by verifying the verification data, thereby achieving the technical effect of improving the security of the data transmission process and solving the technical problem of low security in the data transmission process.
[0070] This application also provides another embodiment of a data processing method from the server side, wherein the server can be a service responder. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be executed in a different order than that shown here.
[0071] Figure 2 This is a flowchart of another data processing method provided according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0072] Step S202: Obtain encrypted request data from the client.
[0073] Step S204: Decrypt the encrypted request data to obtain decrypted data.
[0074] Step S206: Based on the decrypted data, determine the verification result, wherein the verification result is used to characterize the validity of the encrypted request data.
[0075] Through the above steps, the server can obtain the encrypted request data sent by the client, decrypt the encrypted request data to obtain decrypted data, and determine the verification result based on the decrypted data, thereby determining the validity of the encrypted request data. If the encrypted request data is valid, in response to this, the server can store the data to be transmitted from the encrypted request data and transmit it to another client. The decrypted data, used to verify the validity of the data to be transmitted, can include verification data, the data to be transmitted, and the first key.
[0076] As an optional embodiment, step S206, determining the verification result based on the decrypted data, includes: obtaining the client's verification data in the database; determining the target verification data based on the verification data and the decrypted data, and determining the message digest data in the decrypted data; verifying the target verification data based on the message digest data to obtain the verification result.
[0077] In this embodiment, client verification information pre-stored in the server's database can be obtained. The data to be transmitted and the first key in the verification data and decryption data can be combined. Based on the client's encryption method for the encryption request data, the combined packet of the data to be transmitted and the first public key in the verification data and decryption data is encrypted to obtain the target verification data. Simultaneously, the message digest data in the signature string of the decryption data can be determined. The target verification data can be verified based on the message digest data to obtain the verification result. The target verification data can be the verification message digest data (Server Sign_Md).
[0078] Optionally, before data transmission, the two parties involved in the data interaction, namely the client and the server, can pre-agree on the encryption method and composition of the returned encrypted request data. They can also exchange a first public key before data transmission. When the server receives the encrypted request data from the client, it can decrypt the data based on the pre-defined encryption order. For example, the requester's (client's) data packet can be pre-agreed to consist of "business data + MAC address + latitude and longitude information + first key," and the receiver (server) uses the received first key to process the request data.
[0079] For example, the server can retrieve the MAC address and latitude / longitude information of authorized clients from the database. Based on this information, the server combines the MAC address, latitude / longitude information, the data to be transmitted in the decrypted data, and the first key to obtain the data to be verified (Server Sign). This data can then be processed using the MD5 algorithm to generate the target verification data. Simultaneously, the first key can be used to decrypt the signature string in the encrypted request data to obtain the message digest data. The target verification data can then be verified based on the message digest data to obtain the verification result.
[0080] As an optional embodiment, the target verification data is verified based on the message digest data to obtain a verification result, including: in response to the message digest data being the same as the target verification data, determining that the verification result is used to characterize the encrypted request data as valid data.
[0081] In this embodiment, it can be determined whether the message digest data and the target verification data are the same. If they are the same, it indicates that the encrypted request data has not been modified. Therefore, in response to the message digest data and the target verification data being the same, the verification result can be used to characterize the encrypted request data as valid data. Since the verification result characterizes the encrypted request data as valid data, it can be determined that the data to be transmitted is authentic, valid, and secure. Then, based on pre-set data processing logic, subsequent processing of the data to be transmitted can be performed, such as transmission or deletion. This is merely an example and does not impose specific limitations on the processing method of the data to be transmitted.
[0082] As an optional embodiment, determining the message digest data in the decrypted data includes: decrypting the signature string in the encryption request data based on the first key to obtain the message digest data.
[0083] In this embodiment, the server can accept a first key sent by the client, and use the first key to decrypt the key string in the encrypted request data to obtain a usable first public key. The encrypted message in the encrypted request data can then be decrypted using the first public key to obtain the data to be transmitted. Simultaneously, the signature string in the encrypted request data can be decrypted based on the first key to obtain message digest data.
[0084] In this embodiment, the server can obtain encrypted request data from the client; decrypt the encrypted request data to obtain decrypted data; determine the verification result based on the decrypted data; and, in response to the verification result indicating that the encrypted request data is valid, transmit the data to be transmitted from the encrypted request data. That is, in this embodiment, the server uses the decrypted data to verify the security of the data to be transmitted, thereby achieving the technical effect of improving the security during data transmission and solving the technical problem of low security during data transmission.
[0085] Example 2
[0086] The following describes in detail another optional implementation method.
[0087] Currently, in data exchange scenarios, data transmission is typically accomplished through dedicated lines and interactions with other partner platforms. However, in special scenarios, the internet and HTTP protocols are used. These methods introduce the visibility of sensitive information during data transmission. While transcoding can be used to avoid this, it is easily cracked. Using a single confidentiality method still leaves the issue of sensitive information visibility during transmission. Furthermore, HTTP data transmission is susceptible to eavesdropping, posing a risk of sensitive information leakage and resulting in low data security during transmission.
[0088] To address the technical problem of low data security during data transmission, this invention proposes an HTTP protocol encryption method. In this embodiment, based on the HTTP protocol, multiple encryption algorithms are employed, such as RSA and AES, thereby overcoming the limitations of AES encryption requiring maintenance, effectively preventing key leakage by internal personnel, and alleviating the server pressure on the RSA algorithm in large-capacity data scenarios. Simultaneously, multiple verification data are used for validation, effectively preventing unauthorized terminal access and significantly improving the security of data transmission.
[0089] The method will be further described below.
[0090] Before data transmission, the two parties involved in the data interaction, namely the client and the server, can pre-agree on the encryption method and composition of the returned encrypted request data. They can also exchange a first public key before data transmission. When the server receives the encrypted request data from the client, it can decrypt the data based on the pre-defined encryption order. Optionally, in this embodiment, the requester's (client's) data packet composition can be pre-agreed as business data + MAC address + latitude and longitude information + AES key. The receiver (server) uses the received AES key to process the request data. Before data transmission, the client can send the first public key to the server.
[0091] Figure 3 This is a flowchart illustrating a data processing procedure in a client according to an embodiment of this application, such as... Figure 3 As shown, the client's data processing procedure may include the following steps.
[0092] Step S301: Encrypt the message.
[0093] In this embodiment, when the client creates an HTTP request, it needs to dynamically generate a first key. This first key can be used to encrypt the data to be transmitted, resulting in an encrypted request message.
[0094] Optionally, when creating a transmission request, the client needs to dynamically generate a first key. Since the first key is generated dynamically through code, the risk of data leakage due to internal personnel disclosing fixed password values can be avoided. The first key is used to encrypt the request data (the data to be transmitted) to obtain an encrypted message. The length of the first key can be modified according to actual needs.
[0095] Step S302: Generate verification data.
[0096] In this embodiment, a data packet containing the data to be transmitted and the verification data, along with a data packet containing the first key, can be concatenated into a string. This string can then be processed using a message digest algorithm to obtain message digest data. The message digest data can then be encrypted using an asymmetric encryption algorithm public key to obtain a signature string.
[0097] For example, a data packet containing the data to be transmitted and verification data can be constructed. For instance, the data packet could include "data to be transmitted + MAC address + latitude and longitude". The data packet + first key can be converted into a string. The string can be encrypted using the MD5 algorithm to generate a message digest, reqMd5. The digest string can then be encrypted using an RSA public key to obtain a signature string.
[0098] Step S303: Encrypt the first key.
[0099] In this embodiment, during data transmission, the first key can be encrypted using an RSA public key to generate a key string.
[0100] Step S304: Construct encrypted request data and initiate a request.
[0101] In this embodiment, the first key, verification data, and encrypted message can be assigned values to construct encrypted request data. The client can then send the encrypted request data to the server.
[0102] For example, an encrypted message can be assigned to the message of a transmission request, and a signature string and a key string can be assigned to the corresponding positions in the transmission request to obtain encrypted request data. For instance, the signature string can be assigned to the authentication field in the HTTP request header, the key string to a custom field in the HTTP request header, and the encrypted message to the message in the HTTP request header to obtain encrypted request data.
[0103] Figure 4 This is a flowchart illustrating a data processing procedure in a server according to an embodiment of this application, such as... Figure 4 As shown, the data processing process on the server side may include the following steps.
[0104] Step S401: Obtain the first public key.
[0105] In this embodiment, the server can be the service responder. The server can accept the first key sent by the client, and use the first key to decrypt the key string in the encrypted request data to obtain the first public key that can be used.
[0106] Step S402: Obtain the data to be transmitted.
[0107] In this embodiment, the encrypted message in the encryption request data can be decrypted using the first public key to obtain the data to be transmitted.
[0108] Step S403: Verify the validity of the encrypted request data.
[0109] In this embodiment, the server can obtain the MAC address and latitude / longitude information of the authorized client from the database. Based on the MAC address, latitude / longitude information, data to be transmitted, and the first public key, the data to be verified is obtained. The MD5 algorithm can be used to process the data to be verified to generate the target verification data. Simultaneously, the first key can be used to decrypt the signature string in the encrypted request data to obtain the message digest data reqMd5. The ServerSign_Md and reqMd5 can be verified to be consistent. If they are consistent, it indicates that the encrypted request data has not been modified and is authentic and valid. Subsequent processing can be performed on the data to be transmitted based on pre-defined data processing logic, such as transmission or deletion. This is only an example and does not impose specific limitations on the processing methods of the data to be transmitted.
[0110] In this embodiment, by combining dynamically generated AES keys with RSA and MD5 encryption methods, an MD5 message digest is first generated for the data packet containing the data to be transmitted, MAC address, latitude and longitude information, and the first key combination. The MD5-encrypted data packet is then signed using an RSA key. This solves the problem of internal leakage of the AES key and prevents unauthorized terminals from accessing the network due to intermediate servers tampering with the RSA public key. Consequently, it is not easy to deduce the algorithm used in the current signature from the signature, thus improving data processing efficiency and security. This achieves the technical effect of improving the security of data transmission and solves the technical problem of low security in data transmission.
[0111] Example 3
[0112] This application also provides a data processing apparatus. It should be noted that the data processing apparatus in this application can be used to perform... Figure 1 The present application provides a data processing method. The following describes the data processing apparatus provided in the embodiments of the present application.
[0113] Figure 5 This is a schematic diagram of a data processing apparatus according to an embodiment of this application. Figure 5 As shown, the device may include: a receiving unit 502, a first determining unit 504, a second determining unit 506, and an encryption unit 508.
[0114] The receiving unit 502 is used to receive a transmission request, wherein the transmission request is used to request that the data to be transmitted be transmitted be sent to the server.
[0115] The first determining unit 504 is used to determine the importance level of the data to be transmitted.
[0116] The second determining unit 506 is used to determine the verification data corresponding to the importance level, wherein the verification data is used to verify the data to be transmitted.
[0117] The encryption unit 508 is used to encrypt the verification data and the data to be transmitted, and to obtain encryption request data based on the encrypted verification data and the data to be transmitted. The encryption request data is used to enable the server to verify the verification data and to determine the security of the data to be transmitted based on the obtained verification result.
[0118] Optionally, the second determining unit 506 further includes: a first determining module, used to determine verification data based on the size relationship between the target level and the importance level.
[0119] Optionally, the first determining module further includes: a first determining submodule, used to determine, in response to an importance level greater than the target level, that the verification data includes at least two of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0120] Optionally, the first determining module further includes: a second determining submodule, used to determine, in response to an importance level not greater than the target level, that the verification data includes any one of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
[0121] Optionally, the encryption unit 508 further includes: a first processing module, configured to obtain a first key from the transmission request; convert the data consisting of verification data, data to be transmitted, and the first key into a string; perform a message digest on the string to obtain message digest data; encrypt the message digest data to obtain a signature string; and construct encrypted request data based on the signature string.
[0122] Optionally, the first processing module further includes: a processing submodule, used to encrypt the first key based on the first public key to obtain a key string, and to encrypt the data to be transmitted based on the first key to obtain an encrypted message; and to combine the encrypted message, the signature string and the key string to obtain encrypted request data.
[0123] This application embodiment also provides another data processing device from the server side. It should be noted that the data processing device in this application embodiment can be used to execute... Figure 2 The present application provides a data processing method. The following describes the data processing apparatus provided in the embodiments of the present application.
[0124] Figure 6 This is a schematic diagram of another data processing apparatus according to an embodiment of this application. Figure 6 As shown, the device may include: an acquisition unit 602, a decryption unit 604, and a third determination unit 606.
[0125] Acquisition unit 602 is used to acquire encrypted request data from the client.
[0126] The decryption unit 604 is used to decrypt the encrypted request data to obtain the decrypted data.
[0127] The third determining unit 606 is used to determine the verification result based on the decrypted data, wherein the verification result is used to characterize the validity of the encrypted request data.
[0128] Optionally, the third determining unit 606 further includes: a second processing module, used to obtain client verification data from the database; determine target verification data based on the verification data and decryption data, and determine message digest data in the decryption data; verify the target verification data based on the message digest data to obtain a verification result.
[0129] Optionally, the second processing module further includes a third determining submodule, used to determine the verification result as valid data in response to the message digest data being the same as the target verification data.
[0130] Optionally, the second processing module further includes a decryption submodule, used to decrypt the signature string in the encrypted request data based on the first key to obtain message digest data.
[0131] The data processing apparatus provided in this application determines the verification data that needs to be encrypted based on the importance level of the data to be transmitted in the client, generates encryption request data based on the verification data, and sends the request to the server. The server verifies the verification data in the encryption request data and determines whether the data to be transmitted has been modified during transmission based on the verification result. Thus, it can both ensure the security of the data to be transmitted by encrypting it and determine whether the data to be transmitted has been modified by verifying the data, thereby achieving the technical effect of improving the security of data transmission and solving the technical problem of low security in data transmission.
[0132] The aforementioned data processing device may further include a processor and a memory. The aforementioned units are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0133] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and by adjusting kernel parameters, graceful shutdown of devices of the same type awaiting shutdown can be controlled.
[0134] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0135] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the aforementioned data processing method.
[0136] This invention provides a processor for running a program, wherein the program executes the aforementioned data processing method during runtime.
[0137] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the above-described data processing method.
[0138] Figure 7 This is a hardware structure block diagram of an electronic device (or mobile device) for a data processing method according to an embodiment of the present invention. Figure 7As shown, the electronic device may include one or more processors 702 (shown as 702a, 702b, ..., 702n in the figure) 702 (processor 702 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 704 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 7 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device may also include components that are more... Figure 7 The more or fewer components shown, or having the same Figure 7 The different configurations shown.
[0139] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0140] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0141] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0142] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0143] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0144] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0145] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0146] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0147] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0148] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0149] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0150] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A data processing method, characterized in that, include: Receive a transmission request, wherein the transmission request is used to request that the data to be transmitted be transmitted be sent to the server; Determine the importance level of the data to be transmitted; Determine the verification data corresponding to the importance level, wherein the verification data is used to verify the data to be transmitted; The verification data and the data to be transmitted are encrypted, and an encryption request data is obtained based on the encrypted verification data and the data to be transmitted. The encryption request data is used to enable the server to verify the verification data and determine the security of the data to be transmitted based on the obtained verification result. The process includes encrypting the verification data and the data to be transmitted, and obtaining encrypted request data based on the encrypted verification data and the data to be transmitted, including: Obtain the first key from the transmission request; The data consisting of the verification data, the data to be transmitted, and the first key is converted into a string; Perform a message digest on the string to obtain message digest data; The message digest data is encrypted to obtain a signature string; The encrypted request data is constructed based on the signature string.
2. The method according to claim 1, characterized in that, Determining the verification data corresponding to the importance level includes: The verification data is determined based on the relationship between the target level and the importance level.
3. The method according to claim 2, characterized in that, The verification data is determined based on the relationship between the target level and the importance level, including: In response to the fact that the importance level is greater than the target level, the verification data is determined to include at least two of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
4. The method according to claim 2, characterized in that, The verification data is determined based on the relationship between the target level and the importance level, including: In response to the fact that the importance level is not greater than the target level, the verification data is determined to include any one of the following: the address data of the client to be transmitted, the latitude and longitude data of the client, and the creation time of the transmission request.
5. The method according to claim 1, characterized in that, Based on the signature string, the encrypted request data is constructed, including: The first key is encrypted using the first public key to obtain a key string, and the data to be transmitted is encrypted using the first key to obtain an encrypted message. The encrypted message, the signature string, and the key string are combined to obtain the encrypted request data.
6. A data processing method, characterized in that, include: Obtain encrypted request data from the client; The encrypted request data is decrypted to obtain decrypted data; Based on the decrypted data, a verification result is determined, wherein the verification result is used to characterize the validity of the encrypted request data; The encrypted request data is obtained by the client through the following steps: obtaining the first key in the transmission request; converting the data consisting of the verification data, the data to be transmitted, and the first key into a string; performing a message digest on the string to obtain message digest data; encrypting the message digest data to obtain a signature string; and constructing encrypted request data based on the signature string. Determining the verification result based on the decrypted data includes: Retrieve the client's verification data from the database; Based on the verification data and the decryption data, the target verification data is determined, and the message digest data in the decryption data is determined. The target verification data is verified based on the information digest data to obtain the verification result.
7. The method according to claim 6, characterized in that, The target verification data is verified based on the information digest data to obtain the verification result, including: In response to the message digest data being identical to the target verification data, the verification result is determined to characterize the encrypted request data as valid data.
8. The method according to claim 6, characterized in that, Determining the message digest data in the decrypted data includes: The signature string in the encrypted request data is decrypted using the first key to obtain the message digest data.
9. A processor, characterized in that, The processor is used to run a program, wherein the program, when running, performs the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data storage method and device
CN110110551A
Data transmission method and device, electronic equipment and readable storage medium
CN113726768A