A data security management method
By obtaining the parameters of the cookie message, and encrypting data transmission using the TLS protocol, the problem of insufficient security of traditional encryption methods is solved and the security of data transmission is improved.
Patent Information
- Application Number
- CN202510034447.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-01-09
AI Technical Summary
Traditional encryption methods have insufficient security in the data transmission process between the client and the server, which is easy to be cracked.
By obtaining the parameters of the cookie message, determining the request connection weight, identification value and association value, generating a session key, and encrypting the data between the client and the server using the TLS protocol.
Improves the security of data transmission and prevents unauthorized third parties from decrypting and reading data during data transmission.
Smart Images

Figure CN119449495B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data management, and in particular relates to a data security management method. Background Art
[0002] The server usually refers to a computer program or device that provides services. It runs in a network environment and waits for and responds to requests from clients. The client refers to a computer program or device that initiates a request. It can be a personal computer, mobile device, or other type of computing device. Data transmission between the server and the client is a complex and critical process. With the rapid development of network communication technology, the amount of data transmission between the client and the server is increasing, which involves multiple links such as data sending and receiving. In the process of the client and the server having a conversation, in order to ensure the security of data transmission between the two parties during the conversation, encryption algorithms are generally used to encrypt the transmitted data. However, the security of traditional encryption methods is not high enough and is easy to be cracked. Summary of the invention
[0003] In order to solve the above problems, the present invention proposes a data security management method.
[0004] The technical solution of the present invention is: a data security management method comprises the following steps:
[0005] S1. When the client sends a connection request to the server, obtain the Cookie message and determine the parameters of the Cookie message;
[0006] S2. Determine the request connection weight, identification value and associated value of the Cookie message according to the parameters of the Cookie message, and determine to generate a session key;
[0007] S3. Use the session key as the encryption key to generate the TLS protocol, and use the TLS protocol to encrypt the data transmitted between the client and the server.
[0008] During a session, the client sends a request to the server. The server processes the request and returns the result to the client as a response. This request-response pattern is the basic interaction mode during a session. Cookie messages, as a client session technology, are used to save state information on the client. Combined with the TLS protocol, the TLS protocol is a protocol used to establish authenticated and encrypted links between networked computers. After the TLS protocol generates a session key, the client and server can begin to use the session key to encrypt and decrypt the data transmitted between them. In this way, even if the data is intercepted during transmission, it cannot be decrypted and read by unauthorized third parties.
[0009] Furthermore, in S1, the parameters of the Cookie message include a timeout period, a Name attribute, and a Value attribute.
[0010] Name attribute: The name of the cookie message, used to identify the cookie.
[0011] Value attribute: The value associated with the Cookie message, which can be any string.
[0012] Timeout: The validity period of the cookie message stored on the client. Once the cookie message timeout is set, it will be determined when to delete the cookie message based on this time.
[0013] Furthermore, S2 includes the following sub-steps:
[0014] S21. Determine the request connection weight of the Cookie message according to the timeout period of the Cookie message;
[0015] S22, determine the ASCII code value of each character in the Name attribute of the Cookie message;
[0016] S23. Calculate the identification value of the Cookie message according to the ASCII code value of each character in the Name attribute;
[0017] S24. Calculate the associated value of the Cookie message according to the Value attribute of the Cookie message;
[0018] S25. Generate a session key according to the request connection weight, identification value and associated value of the Cookie message.
[0019] The beneficial effect of the above further scheme is: in the present invention, the Name attribute and Value attribute of the Cookie message can be encoded, and the encoded string can be used to calculate the identification value and the associated value, which is also unique, and then the ratio of the timeout period to the network delay is used to generate a specific session key.
[0020] Furthermore, in S21, the calculation formula of the request connection weight T of the Cookie message is:
[0021] ; In the formula, t0 represents the timeout of the Cookie message, t1 represents the time when the server receives the connection request, t2 represents the time when the server sends the response, t3 represents the time when the client sends the connection request, and t4 represents the time when the client receives the response.
[0022] The process of the client sending a request to the server and receiving a response also involves the calculation of the request processing time.
[0023] Furthermore, in S23, the calculation formula of the identification value B of the Cookie message is:
[0024] Where b m Indicates the ASCII code value of the mth character in the Name attribute of the Cookie message, b m+1 Indicates the ASCII code value of the m+1th character in the Name attribute of the Cookie message. Indicates rounding up, and M indicates the number of characters in the Name attribute of the Cookie message.
[0025] The beneficial effect of the above further solution is that: in the present invention, the Name value can only contain ASCII alphanumeric characters (AZ, az, 0-9), which have specific code values in the ASCII code table. The code value of each character is used to determine the identification value of the entire Cookie message.
[0026] Further, S24 includes the following sub-steps:
[0027] S241. Perform UTF-8 encoding on each character of the Value attribute of the Cookie message to obtain a hexadecimal byte sequence corresponding to the Value attribute;
[0028] S242, generating a first check vector and a second check vector according to a hexadecimal byte sequence;
[0029] S243: Generate an associated value of the Cookie message according to the first verification vector and the second verification vector.
[0030] The beneficial effect of the above further scheme is: in the present invention, the Value attribute, as the value of the Cookie, together with the Name value, constitutes the core information of the Cookie message. UTF-8 is a variable-length character encoding that can represent almost all characters in the world. An important feature of UTF-8 is that it is compatible with ASCII encoding. Since the Unicode encoding of ASCII characters is between 0 and 127, their encoding in UTF-8 is exactly the same as the ASCII encoding, which makes UTF-8 able to easily interact with the existing ASCII encoding. The Value attribute is in the form of a string, which may contain Chinese and Japanese, etc., so the present invention performs UTF-8 encoding on it. The specific associated value is determined by the numbers and English characters of the hexadecimal byte sequence after UTF-8 encoding.
[0031] Further, in S242, the expression of the first check matrix X is:
[0032] ; In the formula, x1 represents the value of the first digit in the hexadecimal byte sequence, x i Represents the value of the i-th digit in the hexadecimal byte sequence, x I Represents the value of the Ith digit in a hexadecimal byte sequence, Indicates rounding up, max(·) indicates maximum value operation, min(·) indicates minimum value operation, and I indicates the number of digits in the hexadecimal byte sequence.
[0033] In S242, the expression of the second check matrix Y is:
[0034] ; In the formula, y1 represents the ASCII code value of the first English character in the hexadecimal byte sequence, y j Indicates the ASCII code value of the jth English character in the hexadecimal byte sequence, y J Represents the ASCII code value of the Jth English character in the hexadecimal byte sequence, where J represents the number of English characters in the hexadecimal byte sequence.
[0035] The beneficial effect of the above further scheme is: in the present invention, the hexadecimal system is represented by the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and the letters A, B, C, D, E, F (a, b, c, d, e, f). Therefore, the present invention splits and calculates the numbers and English characters of the hexadecimal byte sequence to obtain the first check matrix and the second check matrix respectively. The first check matrix is calculated using the size of the pure digital value. The ASCII code values of the uppercase English letters A to Z range from 65 to 90, and the ASCII code values of the lowercase English letters a to z range from 97 to 122, so when calculating the second check matrix, the ASCII code values corresponding to the English characters are used to generate two matrix elements.
[0036] Furthermore, in S243, the calculation formula of the association value Z of the Cookie message is:
[0037] ; Wherein, X represents the first check matrix, and Y represents the second check matrix.
[0038] Furthermore, in S25, the expression of the session key Q is:
[0039] ; In the formula, Z represents the association value of the Cookie message, B represents the identification value of the Cookie message, T represents the request connection weight of the Cookie message, max(·) represents the maximum value operation, and min(·) represents the minimum value operation.
[0040] The beneficial effects of the present invention are as follows: the present invention discloses a data security management method, which encodes and analyzes the attribute parameters contained in the Cookie message generated by the connection request to obtain a specific identification value and an associated value, and then analyzes and calculates the time parameters contained in the Cookie message to obtain a specific request connection weight, generates a specific session key for the TLS protocol through the identification value, the associated value and the request connection weight, and uses the TLS protocol to encrypt the transmission data between the client and the server to ensure the security of the data during the session and prevent the transmission data from being stolen. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Flow chart of the data security management method. DETAILED DESCRIPTION
[0042] The embodiments of the present invention will be further described below in conjunction with the accompanying drawings.
[0043] like Figure 1 As shown, the present invention provides a data security management method, comprising the following steps:
[0044] S1. When the client sends a connection request to the server, obtain the Cookie message and determine the parameters of the Cookie message;
[0045] S2. Determine the request connection weight, identification value and associated value of the Cookie message according to the parameters of the Cookie message, and determine to generate a session key;
[0046] S3. Use the session key as the encryption key to generate the TLS protocol, and use the TLS protocol to encrypt the data transmitted between the client and the server.
[0047] During a session, the client sends a request to the server. The server processes the request and returns the result to the client as a response. This request-response pattern is the basic interaction mode during a session. Cookie messages, as a client session technology, are used to save state information on the client. Combined with the TLS protocol, the TLS protocol is a protocol used to establish authenticated and encrypted links between networked computers. After the TLS protocol generates a session key, the client and server can begin to use the session key to encrypt and decrypt the data transmitted between them. In this way, even if the data is intercepted during transmission, it cannot be decrypted and read by unauthorized third parties.
[0048] In the embodiment of the present invention, in S1, the parameters of the Cookie message include a timeout period, a Name attribute, and a Value attribute.
[0049] Name attribute: The name of the cookie message, used to identify the cookie.
[0050] Value attribute: The value associated with the Cookie message, which can be any string.
[0051] Timeout: The validity period of the cookie message stored on the client. Once the cookie message timeout is set, it will be determined when to delete the cookie message based on this time.
[0052] In this embodiment of the present invention, S2 includes the following sub-steps:
[0053] S21. Determine the request connection weight of the Cookie message according to the timeout period of the Cookie message;
[0054] S22, determine the ASCII code value of each character in the Name attribute of the Cookie message;
[0055] S23. Calculate the identification value of the Cookie message according to the ASCII code value of each character in the Name attribute;
[0056] S24. Calculate the associated value of the Cookie message according to the Value attribute of the Cookie message;
[0057] S25. Generate a session key according to the request connection weight, identification value and associated value of the Cookie message.
[0058] In the present invention, both the Name attribute and the Value attribute of the Cookie message can be encoded, and the encoded string can be used to calculate the identification value and the associated value, which are also unique, and then the ratio of the timeout period to the network delay is used to generate a specific session key.
[0059] In the embodiment of the present invention, in S21, the calculation formula of the request connection weight T of the Cookie message is:
[0060] ; In the formula, t0 represents the timeout of the Cookie message, t1 represents the time when the server receives the connection request, t2 represents the time when the server sends the response, t3 represents the time when the client sends the connection request, and t4 represents the time when the client receives the response.
[0061] The process of the client sending a request to the server and receiving a response also involves the calculation of the request processing time.
[0062] In the embodiment of the present invention, in S23, the calculation formula of the identification value B of the Cookie message is:
[0063] Where b m Indicates the ASCII code value of the mth character in the Name attribute of the Cookie message, b m+1 Indicates the ASCII code value of the m+1th character in the Name attribute of the Cookie message. Indicates rounding up, and M indicates the number of characters in the Name attribute of the Cookie message.
[0064] In the present invention, the Name value can only contain ASCII alphanumeric characters (AZ, az, 0-9), which have specific code values in the ASCII code table. The code value of each character is used to determine the identification value of the entire Cookie message.
[0065] In this embodiment of the present invention, S24 includes the following sub-steps:
[0066] S241. Perform UTF-8 encoding on each character of the Value attribute of the Cookie message to obtain a hexadecimal byte sequence corresponding to the Value attribute;
[0067] S242, generating a first check vector and a second check vector according to a hexadecimal byte sequence;
[0068] S243: Generate an associated value of the Cookie message according to the first verification vector and the second verification vector.
[0069] In the present invention, the Value attribute, as the value of the Cookie, together with the Name value, constitutes the core information of the Cookie message. UTF-8 is a variable-length character encoding that can represent almost all characters in the world. An important feature of UTF-8 is that it is compatible with ASCII encoding. Since the Unicode encoding of ASCII characters is between 0 and 127, their encoding in UTF-8 is exactly the same as the ASCII encoding, which makes UTF-8 able to interact with existing ASCII encoding easily. The Value attribute is in the form of a string, which may contain Chinese and Japanese, etc., so the present invention performs UTF-8 encoding on it. The specific associated value is determined by the numbers and English characters of the hexadecimal byte sequence after UTF-8 encoding.
[0070] In the embodiment of the present invention, in S242, the expression of the first check matrix X is:
[0071] ; In the formula, x1 represents the value of the first digit in the hexadecimal byte sequence, x i Represents the value of the i-th digit in the hexadecimal byte sequence, x IRepresents the value of the Ith digit in a hexadecimal byte sequence, Indicates rounding up, max(·) indicates maximum value operation, min(·) indicates minimum value operation, and I indicates the number of digits in the hexadecimal byte sequence.
[0072] In S242, the expression of the second check matrix Y is:
[0073] ; In the formula, y1 represents the ASCII code value of the first English character in the hexadecimal byte sequence, y j Indicates the ASCII code value of the jth English character in the hexadecimal byte sequence, y J Represents the ASCII code value of the Jth English character in the hexadecimal byte sequence, where J represents the number of English characters in the hexadecimal byte sequence.
[0074] In the present invention, hexadecimal is represented by the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and the letters A, B, C, D, E, F (a, b, c, d, e, f). Therefore, the present invention splits and calculates the numbers and English characters of the hexadecimal byte sequence to obtain the first check matrix and the second check matrix respectively. The first check matrix is calculated using the size of the pure digital value. The ASCII code values of the uppercase English letters A to Z range from 65 to 90, and the ASCII code values of the lowercase English letters a to z range from 97 to 122. Therefore, when calculating the second check matrix, the ASCII code values corresponding to the English characters are used to generate two matrix elements.
[0075] In the embodiment of the present invention, in S243, the calculation formula of the association value Z of the Cookie message is:
[0076] ; Wherein, X represents the first check matrix, and Y represents the second check matrix.
[0077] In the embodiment of the present invention, in S25, the expression of the session key Q is:
[0078] ; In the formula, Z represents the association value of the Cookie message, B represents the identification value of the Cookie message, T represents the request connection weight of the Cookie message, max(·) represents the maximum value operation, and min(·) represents the minimum value operation.
[0079] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A data security management method, characterized in that: The following steps are involved: S1. When the client sends a connection request to the server, obtain the Cookie message and determine the parameters of the Cookie message; S2. Determine the request connection weight, identification value and associated value of the Cookie message according to the parameters of the Cookie message, and determine to generate a session key; S3, using the session key as the encryption key to generate the TLS protocol, and using the TLS protocol to encrypt the data transmitted between the client and the server; S2 includes the following sub-steps: S21. Determine the request connection weight of the Cookie message according to the timeout period of the Cookie message; S22, determine the ASCII code value of each character in the Name attribute of the Cookie message; S23. Calculate the identification value of the Cookie message according to the ASCII code value of each character in the Name attribute; S24. Calculate the associated value of the Cookie message according to the Value attribute of the Cookie message; S25. Generate a session key according to the request connection weight, identification value and associated value of the Cookie message; In S21, the calculation formula of the request connection weight T of the Cookie message is: ; Where t0 represents the timeout of the Cookie message, t1 represents the time when the server receives the connection request, t2 represents the time when the server sends the response, t3 represents the time when the client sends the connection request, and t4 represents the time when the client receives the response; In S23, the calculation formula of the identification value B of the Cookie message is: Where b m Indicates the ASCII code value of the mth character in the Name attribute of the Cookie message, b m+1 Indicates the ASCII code value of the m+1th character in the Name attribute of the Cookie message. Indicates rounding up, and M indicates the number of characters in the Name attribute of the Cookie message; S24 includes the following sub-steps: S241. Perform UTF-8 encoding on each character of the Value attribute of the Cookie message to obtain a hexadecimal byte sequence corresponding to the Value attribute; S242, generating a first check vector and a second check vector according to a hexadecimal byte sequence; S243. Generate an associated value of the Cookie message according to the first verification vector and the second verification vector; In S242, the expression of the first check matrix X is: ; In the formula, x1 represents the value of the first digit in the hexadecimal byte sequence, x i Represents the value of the i-th digit in the hexadecimal byte sequence, x I represents the value of the I-th digit in the hexadecimal byte sequence, max(·) represents the maximum value operation, min(·) represents the minimum value operation, and I represents the number of digits in the hexadecimal byte sequence; In S242, the expression of the second check matrix Y is: ; In the formula, y1 represents the ASCII code value of the first English character in the hexadecimal byte sequence, y j Indicates the ASCII code value of the jth English character in the hexadecimal byte sequence, y J Represents the ASCII code value of the Jth English character in the hexadecimal byte sequence, where J represents the number of English characters in the hexadecimal byte sequence; In S243, the calculation formula of the association value Z of the Cookie message is: ; In S25, the expression of the session key Q is: .
2. The data security management method according to claim 1, characterized in that: In S1, the parameters of the Cookie message include a timeout period, a Name attribute, and a Value attribute.
Citation Information
Patent Citations
Multi-identity authentication method and device based on Cookie and DR identity cryptosystem
CN113726523A
Encryption techniques for cookie security
US20200311309A1