A data security transmission method and system based on data encryption
Patent Information
- Application Number
- CN202611180679.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]目前现有的方案未引入公钥基础设施或数字证书等身份认证机制,也未设计公钥与客户端身份的绑定及验证流程,导致服务器无法确认收到的RSA公钥确实来源于合法客户端,攻击者可在传输过程中拦截并替换客户端的公钥,进而截获DES密钥并解密全部通信内容
[0028]1、本发明通过服务器验证设备指纹通过后生成由服务器私钥签名的设备指纹验证凭证,并将该凭证的哈希值作为会话根密钥的派生因子,使会话根密钥的派生以凭证的有效性为前提。未经设备指纹验证即无法获得有效凭证,进而无法派生正确的会话密钥;同时将凭证有效期纳入密钥更新触发条件,凭证过期后即使达到时间或数据量阈值也无法派生新密钥,必须重新执行设备指纹认证,从而将设备身份的验证结果与密钥派生过程进行绑定并贯穿密钥全生命周期,解决了现有技术中密钥派生与身份认证相互独立、无法确保密钥来源可信的问题。
Smart Images

Figure CN122891340A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of network communication technology, and specifically relates to a data security transmission method and system based on data encryption. Background Technology
[0002] In the field of network communication, especially in scenarios involving data interaction between in-vehicle terminals, mobile devices, and remote servers, the security of data transmission is paramount. With the continuous upgrading of network attack methods, security threats such as data eavesdropping, tampering, and identity forgery during transmission are becoming increasingly serious. To ensure the confidentiality of data during transmission, it is usually necessary to establish a secure data transmission channel between the communicating parties and employ encryption technology to protect the message content.
[0003] In the existing scheme, the server dynamically generates a DES key, encrypts the DES key using the RSA public key provided by the client, and then transmits it to the client; the client uses its own RSA private key to decrypt and obtain the DES key; both communicating parties use the DES key to encrypt the transmitted message, and compress the message using the ZLIB algorithm before encryption.
[0004] Current solutions lack public key infrastructure (PKI) or digital certificate authentication mechanisms, and do not design a binding and verification process between public keys and client identities. This makes it impossible for servers to verify that the received RSA public key truly originates from a legitimate client. Attackers can intercept and replace the client's public key during transmission, thereby obtaining the DES key and decrypting all communication content. Furthermore, the lack of any integrity verification information appended to the encrypted ciphertext means the receiving end cannot determine whether the data has been tampered with during transmission. After replacing the public key, attackers can not only eavesdrop on communication content but also perform targeted modifications to the ciphertext without the receiver's knowledge.
[0005] To address the above problems, this invention proposes a data security transmission method and system based on data encryption. Summary of the Invention
[0006] To address the aforementioned problems in the prior art, the present invention aims to provide a data security transmission method and system based on data encryption.
[0007] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows:
[0008] A data security transmission method based on data encryption includes:
[0009] The client collects the physical feature information of the device to generate a device fingerprint, and generates a first key pair and a first random number. The device fingerprint, the first random number and the first public key in the first key pair are sent to the server.
[0010] The server authenticates the client based on the device fingerprint. After successful authentication, the server uses its private key to sign the device fingerprint to generate a device fingerprint verification credential, which is then sent to the client.
[0011] The server generates a second random number, encrypts the second random number using the first public key, and sends it to the client. The client decrypts the second random number using the first private key in the first key pair.
[0012] After the client verifies the validity of the credentials, it combines the hash value of the credentials with the first random number and the second random number to derive the session root key. Both parties then derive the communication key based on the session root key.
[0013] The server uses a communication key to encrypt the message and generate authentication information for integrity verification, which is then sent to the client. The client verifies the authentication information using the communication key and then decrypts and restores the message.
[0014] During communication, the key update trigger conditions are monitored. When the first type of trigger condition is met, the server and the client derive a new communication key based on the current session root key by updating the derivation parameters. When the second type of trigger condition is met, the client re-executes device fingerprint authentication to obtain new credentials and re-derives the session key and communication key.
[0015] Preferably, the server authenticates the client based on the device fingerprint, including: the server comparing the received device fingerprint with a locally stored list of authorized devices; if the match is successful, the client is confirmed as an authorized device; if the match fails, an unauthorized device error code is returned to the client and communication is terminated.
[0016] Preferably, the device fingerprint is signed using the server's private key to generate a device fingerprint verification credential, including: the server uses the device fingerprint, verification timestamp, and validity period as credential fields, and uses the server's private key to digitally sign the credential fields to generate a digital signature value, and the validity period of the credential is set to a preset duration starting from the verification timestamp.
[0017] Preferably, before the client sends the device fingerprint, the first random number, and the first public key to the server, the method further includes: the client concatenating the device fingerprint, the first random number, and the first public key to calculate a hash value, and sending the hash value along with the device fingerprint, the first random number, and the first public key to the server; after receiving the hash value, the server recalculates the hash value using the same concatenation method and compares it with the received hash value; if they match, it confirms that the transmitted data has not been tampered with.
[0018] Preferably, after the client verifies the validity of the credential, it combines the hash value of the credential with the first random number and the second random number to derive the session root key. This includes: the client checking whether the credential is within its validity period and verifying that the credential was issued by the server. After the verification is successful, the client concatenates the hash value of the credential, the first random number, and the second random number in a preset combination order to generate the session root key; the server generates the same session root key in the same combination order.
[0019] Preferably, the two parties derive a communication key based on the session root key, including: the two parties use the hash value of the credential and the first random number as salt values, and derive the session root key through a key derivation function. The derivation result is allocated bit by bit as a symmetric encryption key and a message authentication key. The communication key includes the symmetric encryption key and the message authentication key.
[0020] Preferably, the server uses a communication key to encrypt the message and generate authentication information for integrity verification, including: the server uses a symmetric encryption key to encrypt the message to be transmitted to generate ciphertext data, and uses a message authentication key to perform message authentication code calculation on the concatenated whole containing the initialization vector and ciphertext data to generate authentication information.
[0021] Preferably, the client decrypts and restores the message after verifying the authentication information based on the communication key, including: the client recalculates the authentication code by concatenating the received initialization vector and ciphertext data using the message authentication key, compares the recalculated authentication code with the received authentication information, and if they match, decrypts and restores the message using the symmetric encryption key.
[0022] Preferably, the first type of triggering condition includes the elapsed time reaching a time period threshold or the encrypted data volume reaching a data volume period threshold; the second type of triggering condition includes the expiration or imminent expiration of the credential's validity period; when the first type of triggering condition is met, the derivation parameter is updated to an incremental derivation round number, and both parties re-derive a new communication key based on the same session root key using the incremental derivation round number; when the second type of triggering condition is met, the server sends a re-authentication instruction to the client, and the client re-executes device fingerprint authentication to obtain a new credential and re-derives the session key and communication key.
[0023] This invention also discloses a data security transmission system based on data encryption, comprising:
[0024] The session key negotiation and derivation module is used for the client to collect device physical feature information, generate a device fingerprint, and generate a first key pair and a first random number. The client then sends the device fingerprint, the first random number, and the first public key to the server. The server authenticates the client based on the device fingerprint. After successful authentication, the server signs the device fingerprint using its private key to generate a device fingerprint verification credential, which is then sent to the client. The server generates a second random number, encrypts it using the first public key, and sends it to the client. The client decrypts the second random number using its first private key. After the client verifies the validity of the credential, it combines the hash value of the credential with the first and second random numbers to derive the session root key. Both parties then derive the communication key based on the session root key.
[0025] The data encryption transmission and integrity verification module is used by the server to encrypt the message using the communication key and generate authentication information for integrity verification, which is then sent to the client. The client verifies the authentication information using the communication key and then decrypts and restores the message.
[0026] The key lifecycle management module is used to monitor key update trigger conditions during communication. When the first type of trigger condition is met, the server and the client derive a new communication key based on the current session root key by updating the derivation parameters. When the second type of trigger condition is met, the client re-executes device fingerprint authentication to obtain new credentials and re-derives the session key and communication key.
[0027] Beneficial effects
[0028] 1. This invention generates a device fingerprint verification credential signed by the server's private key after the server verifies the device fingerprint. The hash value of this credential is used as a derivation factor for the session root key, ensuring that the derivation of the session root key is contingent on the validity of the credential. Without device fingerprint verification, a valid credential cannot be obtained, and therefore, the correct session key cannot be derived. Furthermore, the credential validity period is incorporated into the key update trigger condition. Even if a time or data volume threshold is reached after the credential expires, a new key cannot be derived, and device fingerprint authentication must be re-executed. This binds the device identity verification result to the key derivation process and extends it throughout the key's entire lifecycle, solving the problem in existing technologies where key derivation and identity authentication are independent and the reliability of the key source cannot be guaranteed.
[0029] 2. This invention enables the receiver to verify whether the public key has been tampered with during transmission by attaching a hash checksum generated based on the public key's own content. Simultaneously, it verifies the legitimate holder of the public key through a private key holding certificate. This achieves lightweight and trusted exchange of public keys between communicating parties without introducing a third-party CA certificate. Furthermore, by attaching an HMAC-based message authentication code to the encrypted ciphertext, the receiver can verify data integrity before decryption. Thus, it simultaneously addresses the security deficiencies of existing solutions in the two key dimensions of identity authentication and data integrity, effectively resisting man-in-the-middle attacks and data tampering attacks.
[0030] 3. This invention triggers key updates by setting two conditions: a time period threshold and a data volume period threshold. It derives a new key from the same session root key using an incremental derivation round method. The entire update process does not involve RSA asymmetric encryption and decryption operations and does not require additional handshake rounds. At the same time, it incorporates the validity period of the credential into the update trigger condition, thereby reducing the communication overhead of key updates in long-connection scenarios and solving the problem of security risk accumulation and high key update costs caused by long-term use of a single key. Attached Figure Description
[0031] Figure 1 This is a flowchart of the method of the present invention;
[0032] Figure 2 This is a system module diagram of the present invention. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are merely for explaining the invention and are not intended to limit the scope of protection of the invention.
[0034] Example 1
[0035] Please see Figure 1 As shown, this embodiment provides a data security transmission method based on data encryption, which includes the following steps:
[0036] S1. The client collects the device fingerprint and generates the first key pair and the first hash value;
[0037] The client collects the physical characteristics information of its device, which is used to uniquely identify the hardware identity of the device. This physical characteristics information includes at least two or all of the device's MAC address, CPU serial number, hard disk serial number, and network card hardware ID.
[0038] After the physical feature information is collected, the client concatenates the collected multiple physical feature information into the original string of the device fingerprint according to a preset normalization rule. The specific normalization rule is as follows:
[0039] All physical characteristic information is converted to lowercase strings, all spaces and delimiters are removed, and then concatenated in a fixed order of MAC address, CPU serial number, hard disk serial number, and network card hardware ID, with adjacent items separated by a preset delimiter.
[0040] If a certain physical characteristic information fails to be obtained or does not exist due to system limitations or equipment differences, an empty string is used to replace that position, but the position of the separator remains unchanged.
[0041] Through the above normalization process, the client obtains a normalized original device fingerprint string. Based on this, the client uses the SHA-256 hash algorithm to perform hash calculation on the original device fingerprint string, generating a 256-bit device fingerprint digest, which serves as a digital representation of the device identity.
[0042] Furthermore, the client generates a first key pair, which includes a first RSA public key and a first RSA private key, both of which have a key length of not less than 1024 bits to ensure basic asymmetric encryption strength; at the same time, it generates a first random number with a length of not less than 128 bits, which will be used as one of the participation factors in the derivation of subsequent session keys.
[0043] The client concatenates the device fingerprint digest, the first random number, and the first RSA public key into a single unit according to a preset order. It then uses the SHA-256 hash algorithm to calculate the first hash value from the concatenated result. This hash value is used by the server to verify the integrity of the transmitted data.
[0044] The first RSA public key, the first hash value, the device fingerprint digest, and the first random number are encapsulated in a preset data format and sent to the server together. The data format includes a data packet header and data fields arranged in sequence, with the fields separated by a predetermined length marker to ensure correct parsing by the server.
[0045] S2. The server performs dual verification of the client's identity using both the device fingerprint and the public key, and generates a device fingerprint verification credential.
[0046] After receiving the first RSA public key, first hash value, device fingerprint digest, and first random number sent by the client, the server verifies whether the data has been tampered with during transmission. Specifically:
[0047] The server recalculates the verification hash value of the received device fingerprint digest and the first RSA public key according to the exact same concatenation order and SHA-256 hash algorithm as the client, and compares the verification hash value with the received first hash value bit by bit;
[0048] If any bit is inconsistent, it indicates that the data may have been tampered with during transmission, the verification fails, the server immediately returns an error code to the client and terminates the communication; if all bits are completely consistent, it confirms that the device fingerprint digest and the first RSA public key have not been tampered with during transmission.
[0049] After the verification passes, the server further verifies the legitimacy of the client's device identity, specifically:
[0050] The server searches a locally stored list of authorized devices for a record that matches the received device fingerprint digest. This list of authorized devices is pre-entered by the system administrator when the device joins the network. Each record contains the device fingerprint digest of the authorized device and its corresponding device permission level. The server has also created a hash index for the device fingerprint digests in the list to speed up the search.
[0051] If no matching record is found in the list of authorized devices, the server returns an unauthorized device error code to the client and terminates the current communication.
[0052] If a match is successful, the current client device is confirmed to be an authorized device, and the server records the corresponding permission level of the device for subsequent access control purposes.
[0053] After the device fingerprint verification is successful, the server generates a second key pair, which includes a second RSA public key and a second RSA private key, both of which have a key length of no less than 1024 bits.
[0054] The server uses a second RSA private key to digitally sign the device fingerprint digest, generating a device fingerprint verification credential. This credential contains the following fields: device fingerprint digest, verification timestamp, validity period, and the digital signature value of the second RSA private key, where the validity period is set to a preset duration starting from the verification timestamp. Simultaneously, the server calculates the hash value of this device fingerprint verification credential, generates a credential hash digest, and saves it locally for use in subsequent session key derivation.
[0055] After completing the above operations, the server sends the device fingerprint verification credential to the client, which receives and saves the credential. This credential will become one of the necessary input conditions for subsequent session key derivation, thus binding the device identity verification result with the key derivation process.
[0056] In addition, if the device fingerprint of a client device changes due to hardware replacement (such as network card replacement or hard drive replacement), the client needs to apply to the server for an update of the device fingerprint summary record in the authorized device list through a preset re-registration process. This re-registration process can only take effect after being approved offline by the administrator or verified through an authenticated security channel, in order to prevent unauthorized device fingerprint changes.
[0057] S3. The server generates a second random number and returns the ciphertext of the second random number and the second hash value;
[0058] After completing device fingerprint verification and generating credentials, the server generates a second random number with a length of at least 128 bits. To ensure this random number is not intercepted during transmission to the client, the server uses the received first RSA public key to encrypt the second random number using the RSA_PKCS1_V1_5 padding method, generating a second random number ciphertext. Simultaneously, to ensure the integrity of the second RSA public key during transmission, the server concatenates the second random number and the second RSA public key in a preset order, and then uses the SHA-256 hash algorithm to generate a second hash value. The server then encapsulates the second RSA public key, the second hash value, and the second random number ciphertext according to a preset data format and sends them to the client.
[0059] S4. The client verifies the validity of the second RSA public key;
[0060] After receiving the second RSA public key, second hash value, and second random number ciphertext from the server, the client first uses the generated first RSA private key to decrypt the second random number ciphertext according to the RSA_PKCS1_V1_5 padding method to obtain the second random number. This second random number should be consistent with the second random number generated by the server and can be used as one of the shared factors for subsequent key derivation. Simultaneously, to ensure that the second RSA public key has not been tampered with during transmission, the client recalculates the check hash value of the received second RSA public key using the same concatenation order and SHA-256 hash algorithm as the server, and compares this check hash value bit by bit with the received second hash value. If any bit is inconsistent, the verification fails, the client returns an error code to the server, and terminates the communication.
[0061] S5. Derive session root key and communication key based on device fingerprint verification credentials and double random numbers;
[0062] After the legitimacy of the second RSA public key is verified, the client performs a validity check on the received and stored device fingerprint verification credential, specifically:
[0063] The client checks whether the current time is still within the time range specified by the verification timestamp and validity period, and uses the received second RSA public key to verify the digital signature value in the credential to confirm that the credential was indeed issued by the server and has not been tampered with.
[0064] If the credential has expired or the verification fails, the client returns an invalid credential error code to the server and re-executes the aforementioned device fingerprint authentication process to obtain a new valid credential, thereby ensuring that the device authentication result is always valid.
[0065] After successful credential verification, the client calculates the hash value of the device fingerprint verification credential and generates a credential hash digest. Subsequently, the client concatenates the credential hash digest, the generated first random number, and the decrypted second random number into a session root key, according to a preset combination order of the credential hash digest, the first random number, and the second random number.
[0066] Meanwhile, the server concatenates the locally stored credential hash digest, the received first random number, and the generated second random number in the same order to generate the same session root key. Since both parties use identical data for concatenation, the generated session root key is also identical, thus completing the symmetric key negotiation without the need for additional key transmission.
[0067] Based on this, the client and server respectively derive keys using the PBKDF2 key derivation function based on HMAC-SHA256, using the session root key. The salt value is set as a combination of the credential hash digest and the first random number, and the initial number of derivation rounds is set to 10,000. Through this derivation process, both parties obtain the AES symmetric key and the HMAC key, respectively. Specifically:
[0068] The output length of the PBKDF2 key derivation function is determined by the total length of the desired derived key. Taking a 128-bit AES symmetric key and a 256-bit HMAC key as an example, the total derived key length is 384 bits. The derivation result is then sequentially allocated: the first 128 bits for the AES symmetric key and the last 256 bits for the HMAC key. The AES symmetric key can be either 128 or 256 bits long, and the HMAC key is 256 bits long; both parties obtain identical AES and HMAC keys.
[0069] It should be noted that since the derivation of the session root key is based on the successful verification of the device fingerprint credentials, a valid credential cannot be obtained without the aforementioned device fingerprint verification, and thus the session key cannot be correctly derived. A clear causal dependency is formed between the device fingerprint verification process and the session key derivation process, which makes the device authentication result directly determine the generation of the subsequent communication key.
[0070] S6. Negotiate and determine the key update cycle parameters;
[0071] In order to enable autonomous key updates during communication and reduce the security risks caused by long-term use of a single key, the server determines key update cycle parameters. The key update cycle parameters include at least one of a time cycle threshold and a data volume cycle threshold, wherein the time cycle threshold is set to 1 hour and the data volume cycle threshold is set to 1GB.
[0072] The server sends the key update cycle parameter to the client. Upon receiving the parameter, the client returns an acknowledgment response, and both parties complete the negotiation of the update cycle. After the negotiation is complete, the server and the client respectively save a counter for the elapsed duration of the current key and a counter for the amount of encrypted data, both initially set to zero.
[0073] During subsequent communication, the server sends the updated count information along with the data packet after each encrypted data transmission to the client, and the client updates its local counter value accordingly. Since there may be clock discrepancies between the client and the server, the elapsed time counter is accumulated based on the data packet transmission timestamp and does not depend on the consistency of the local clocks of both parties. After receiving the count information sent by the server, the client directly updates its local elapsed time counter, thereby eliminating the impact of clock discrepancies.
[0074] S7. The server compresses and encrypts the message and generates a message authentication code;
[0075] When data transmission is required, the server uses the derived AES symmetric key and employs AES-CBC encryption mode to encrypt the original message to be transmitted after compression by the ZLIB algorithm, generating ciphertext data. The initialization vector used for encryption is randomly generated by the server and has a length of 128 bits.
[0076] When the original message length is less than 256 bytes, the server directly encrypts the data without compression because compression cannot effectively reduce the data size and will consume additional computing resources.
[0077] After the ciphertext data is generated, the server concatenates the initialization vector and the ciphertext data into a single unit. Then, using the derived HMAC key, it performs an HMAC-SHA256 hash operation on this concatenated unit to generate a 256-bit message authentication code. This message authentication code enables the receiving end to verify the integrity of the ciphertext data. The server then encapsulates the initialization vector, ciphertext data, and message authentication code according to a preset data format and sends them together to the client.
[0078] S8. The client verifies message integrity and decrypts and restores the original message;
[0079] After receiving the initialization vector, ciphertext data, and message authentication code from the server, the client uses the derived HMAC key to recalculate the verification code by combining the received initialization vector and ciphertext data using the same HMAC-SHA256 hash operation method as the server, and then compares the verification code bit by bit with the received message authentication code.
[0080] If any bit is inconsistent, the integrity verification fails, indicating that the ciphertext data may have been tampered with during transmission. The client discards the data and returns an error code to the server to request retransmission. If all bits are completely consistent, the ciphertext data is confirmed to be intact and has not been tampered with.
[0081] After the integrity verification is successful, the client uses the derived AES symmetric key and the received initialization vector to decrypt the ciphertext data in AES-CBC decryption mode to obtain the compressed original message, which is then decompressed by ZLIB to restore the original message, thus completing a secure data transmission.
[0082] S9. Trigger lightweight in-situ key update when update conditions are met, and force re-authentication when credentials expire;
[0083] During the communication process, the server continuously monitors three conditions:
[0084] Check whether the elapsed time counter has reached the time period threshold, whether the encrypted data volume counter has reached the data volume period threshold, and whether the device fingerprint verification certificate is about to expire.
[0085] The voucher is about to expire when the difference between the current time and the expiry date of the voucher is less than the preset buffer time, which is set to 5 minutes.
[0086] The key update process is triggered when any one of the above three conditions is met, but the update method performed will vary depending on the triggering condition.
[0087] When the trigger condition is that the elapsed duration counter reaches a time period threshold or the encrypted data volume counter reaches a data volume period threshold, the server performs a lightweight in-situ key update. The server inputs the generated session root key into the key derivation function, which is the same as the PBKDF2 key derivation function used in the aforementioned session key derivation process, but the number of derivation rounds is increased by a preset increment, thus deriving a new AES symmetric key and a new HMAC key different from the current key. The preset increment value is set to 1000 rounds. The server sends a key update indication message to the client, which includes the current number of derivation rounds. Upon receiving this indication message, the client performs derivation using the same session root key, derivation function, and number of derivation rounds as the server, obtaining the same new AES symmetric key and a new HMAC key, and returns a key update confirmation message to the server. Both parties then switch to using the new key for subsequent communication, simultaneously resetting the elapsed duration counter and the encrypted data volume counter to zero, and immediately clearing the old key from memory. The entire update process does not involve RSA asymmetric encryption and decryption operations and requires no additional handshake rounds, significantly reducing the communication overhead of key updates in long-connection scenarios.
[0088] The situation differs when the trigger condition is that the device fingerprint verification credential is about to expire. Since credential expiration means the device identity is about to become invalid, the server does not perform the aforementioned lightweight in-situ key update. Instead, it sends a credential expiration and re-authentication instruction to the client. Upon receiving this instruction, the client pauses current communication, re-executes the aforementioned device fingerprint authentication process to obtain a new valid credential, and then re-executes the session key derivation process to derive a new session root key and communication key before continuing subsequent communication. This creates a loop dependency between the key update process and the device fingerprint authentication process. Even if a time or data volume threshold is reached after credential expiration, a new key cannot be derived, and the device identity must be re-verified. This forces the device identity to be continuously verified throughout the key's lifecycle, ensuring that device identity verification is a constant part of key management.
[0089] In addition, if there are data packets that have not yet been transmitted when the key update is triggered, the server waits for the current data packet to be sent and for the client to confirm successful receipt before initiating the key update process. This ensures that the sent data can be successfully decrypted by the client with the old key, and avoids data malfunction due to premature key switching.
[0090] S10. Clear all keys and sensitive information after the session ends;
[0091] After the communication session ends, the client and server respectively clear the device fingerprint digest, device fingerprint verification certificate, session root key, AES symmetric key and HMAC key used in this communication from memory, and the key materials involved in this session will not be used in the next communication to ensure forward security of the keys.
[0092] Example 2
[0093] Please see Figure 2 As shown, this embodiment provides a data security transmission system based on data encryption, including the following modules:
[0094] Session key negotiation and derived modules;
[0095] This module consists of a key decryption unit, a credential verification unit, and a first session key derivation unit on the client side, and a second random number generation unit, an encryption unit, and a second session key derivation unit on the server side. The server generates a second random number, encrypts it with the first RSA public key, and sends it to the client. The client decrypts the second random number using the first RSA private key and performs a hash verification on the second RSA public key. After verifying the validity of the device fingerprint credential, the client calculates the hash value of the credential and concatenates it with the first and second random numbers to generate the session root key. The server generates its local session root key in the same way. Both parties derive the same AES symmetric key and HMAC key using the PBKDF2 key derivation function based on the session root key.
[0096] Data encryption transmission and integrity verification module;
[0097] This module consists of a server-side encryption execution unit and a message authentication code generation unit, and a client-side integrity verification unit and data decryption unit. The server uses an AES symmetric key to encrypt the compressed original message, generating ciphertext data. It then uses an HMAC key to hash the concatenated initialization vector and ciphertext data to generate a message authentication code, which is sent to the client. The client recalculates the authentication code using the HMAC key and compares it with the received message authentication code to verify the integrity of the ciphertext. Upon successful verification, the client decrypts the message using the AES symmetric key and obtains the original message. This module also supports negotiation of key update cycle parameters. The server determines the time cycle threshold and data volume cycle threshold, which take effect upon client confirmation.
[0098] Key lifecycle management module;
[0099] This module consists of a key update triggering unit, a lightweight update execution unit, and a re-authentication scheduling unit on the server side, and a key update response unit and a data clearing unit on the client side.
[0100] The server continuously monitors three conditions: elapsed time, amount of encrypted data, and validity period of device fingerprint credentials. When the time or data volume threshold is reached, a lightweight in-situ key update is triggered. After incrementing the derivation round number, a new key is obtained, and both parties switch to use it.
[0101] When a credential is about to expire, the server does not perform a key derivation update. Instead, it requires the client to re-perform device fingerprint authentication to obtain a new credential and re-derive the session key. After the session ends, both parties clear all key materials used in this communication from memory.
[0102] The above description is merely a preferred embodiment of this application and is not intended to limit 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 protection scope of this application.
Claims
1. A data security transmission method based on data encryption, characterized in that, include: The client collects the physical feature information of the device to generate a device fingerprint, and generates a first key pair and a first random number. The device fingerprint, the first random number and the first public key in the first key pair are sent to the server. The server authenticates the client based on the device fingerprint. After successful authentication, the server uses its private key to sign the device fingerprint to generate a device fingerprint verification credential, which is then sent to the client. The server generates a second random number, encrypts the second random number using the first public key, and sends it to the client. The client decrypts the second random number using the first private key in the first key pair. After the client verifies the validity of the credentials, it combines the hash value of the credentials with the first random number and the second random number to derive the session root key. Both parties then derive the communication key based on the session root key. The server uses a communication key to encrypt the message and generate authentication information for integrity verification, which is then sent to the client. The client verifies the authentication information using the communication key and then decrypts and restores the message. During communication, the key update trigger conditions are monitored. When the first type of trigger condition is met, the server and the client derive a new communication key based on the current session root key by updating the derivation parameters. When the second type of trigger condition is met, the client re-executes device fingerprint authentication to obtain new credentials and re-derives the session key and communication key.
2. The data security transmission method based on data encryption according to claim 1, characterized in that, The server authenticates the client based on the device fingerprint, including: The server compares the received device fingerprint with the locally stored list of authorized devices; If a match is successful, the client is confirmed to be an authorized device; if a match fails, an unauthorized device error code is returned to the client and communication is terminated.
3. The data security transmission method based on data encryption according to claim 1, characterized in that, The device fingerprint is signed using the server's private key to generate a device fingerprint verification credential. This includes: the server using the device fingerprint, verification timestamp, and validity period as credential fields, and using the server's private key to digitally sign the credential fields to generate a digital signature value. The validity period of the credential is set to a preset duration starting from the verification timestamp.
4. The data security transmission method based on data encryption according to claim 1, characterized in that, Before the client sends the device fingerprint, the first random number, and the first public key to the server, the process also includes: the client concatenating the device fingerprint, the first random number, and the first public key to calculate a hash value, and sending the hash value along with the device fingerprint, the first random number, and the first public key to the server; upon receiving the hash value, the server recalculates the hash value using the same concatenation method and compares it with the received hash value; if they match, the server confirms that the transmitted data has not been tampered with.
5. A data security transmission method based on data encryption according to claim 1, characterized in that, After the client verifies the validity of the credential, it combines the hash value of the credential with the first random number and the second random number to derive the session root key. This includes: the client checking whether the credential is valid and verifying that the credential was issued by the server. After the verification is successful, the client concatenates the hash value of the credential, the first random number, and the second random number in a preset combination order to generate the session root key; the server generates the same session root key in the same combination order.
6. The data security transmission method based on data encryption according to claim 1, characterized in that, Both parties derive a communication key based on the session root key, including: both parties use the hash value of the credentials and the first random number as salt values, and derive the session root key through a key derivation function. The derivation result is allocated bit by bit into a symmetric encryption key and a message authentication key. The communication key includes the symmetric encryption key and the message authentication key.
7. A data security transmission method based on data encryption according to claim 1, characterized in that, The server uses a communication key to encrypt messages and generate authentication information for integrity verification. This includes: the server using a symmetric encryption key to encrypt the message to be transmitted to generate ciphertext data, and using a message authentication key to perform message authentication code calculation on the concatenated whole containing the initialization vector and ciphertext data to generate authentication information.
8. A data security transmission method based on data encryption according to claim 1, characterized in that, After verifying the authentication information using the communication key, the client decrypts and restores the message, including: the client recalculates the authentication code by combining the received initialization vector and the ciphertext data using the message authentication key, compares the recalculated authentication code with the received authentication information, and if they match, decrypts and restores the message using the symmetric encryption key.
9. A data security transmission method based on data encryption according to claim 1, characterized in that, The first type of triggering condition includes the time elapsed reaching the time period threshold or the amount of encrypted data reaching the data volume period threshold; the second type of triggering condition includes the expiration or imminent expiration of the validity period of the voucher. When the first type of triggering condition is met, the derivation parameter is updated to an incrementing derivation round number, and both parties re-derive a new communication key based on the same session root key using the incremented derivation round number; When the second type of triggering condition is met, the server sends a re-authentication instruction to the client, and the client re-executes device fingerprint authentication to obtain new credentials and re-derives the session key and communication key.
10. A data security transmission system based on data encryption, characterized in that, include: The session key negotiation and derivation module is used to collect device physical feature information from the client to generate a device fingerprint and generate a first key pair and a first random number, and send the device fingerprint, the first random number and the first public key to the server. The server authenticates the client based on the device fingerprint. After successful authentication, the server signs the device fingerprint using its private key to generate a device fingerprint verification credential, which is then sent to the client. The server generates a second random number and encrypts it using the first public key before sending it to the client. The client decrypts the second random number using the first private key. After the client verifies the validity of the credential, it combines the hash value of the credential with the first and second random numbers to derive a session root key. Both parties then derive a communication key based on the session root key. The data encryption transmission and integrity verification module is used by the server to encrypt the message using the communication key and generate authentication information for integrity verification, which is then sent to the client. The client verifies the authentication information using the communication key and then decrypts and restores the message. The key lifecycle management module is used to monitor key update trigger conditions during communication. When the first type of trigger condition is met, the server and the client derive a new communication key based on the current session root key by updating the derivation parameters. When the second type of trigger condition is met, the client re-executes device fingerprint authentication to obtain new credentials and re-derives the session key and communication key.