Data transmission method, device, computer equipment and storage medium
By encrypting and decrypting data using session keys in physical link transmission, the problem of malicious programs eavesdropping or tampering is solved, and the security and reliability of data transmission is improved.
Patent Information
- Application Number
- CN202010685585.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-16
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-07-16
AI Technical Summary
In the prior art, when data is transmitted through physical links, there is a risk of malicious programs eavesdropping or tampering, resulting in poor data transmission security.
In physical link transmission, a session key is established between devices, and the data is encrypted and decrypted to ensure the confidentiality of the data during transmission.
Effectively prevent data eavesdropping and tampering, improving the security and reliability of physical link transmission.
Smart Images

Figure CN114006692B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a data transmission method, apparatus, computer equipment, and storage medium. Background Art
[0002] A physical link refers to a communication link that is directly connected between one device and another device through a physical transmission medium, without any other switching devices in between. Taking the first device and the second device as an example, a physical link is established between the first device and the second device. The first device encapsulates the data and transmits the encapsulated data to the second device through the physical link. The second device decapsulates the received data to obtain the data before encapsulation, thereby completing the data transmission.
[0003] However, during the above data transmission process, malicious programs may eavesdrop on or tamper with the data in the physical link, so the security of data transmission through the physical link is poor. Summary of the invention
[0004] The embodiments of the present application provide a data transmission method, apparatus, computer equipment and storage medium, which can transmit data securely through a physical link. The technical solution is as follows:
[0005] In one aspect, a data transmission method is provided, the method comprising:
[0006] Passing first data to a first security layer of the first device through a first service layer of the first device;
[0007] Determine a session key between the first device and the second device through the first security layer, a physical link is established between the first transport layer of the first device and the second transport layer of the second device, the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus USB link;
[0008] Encrypting the first data by using the session key through the first security layer to obtain second data, and transmitting the second data to the first transport layer;
[0009] The second data is sent to the second transport layer through the physical link, and the second device is used to transfer the second data to the second security layer of the second device through the second transport layer, and the second data is decrypted using the session key through the second security layer to obtain the first data.
[0010] In another aspect, a data transmission method is provided, the method comprising:
[0011] receiving second data sent by the first device through a physical link between a first transport layer of the first device and a second transport layer of the second device, wherein a physical link is established between the first transport layer and the second transport layer, wherein the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link, wherein the second data is transmitted to the first transport layer by a first security layer of the first device, and the first security layer is used to encrypt the first data using a session key to obtain the second data;
[0012] transmitting the second data to a second security layer of the second device through the second transport layer;
[0013] determining, by the second security layer, the session key between the second device and the first device;
[0014] The second data is decrypted using the session key through the second security layer to obtain the first data.
[0015] In another aspect, a data transmission device is provided, the device comprising:
[0016] A data transmission module, configured to transmit first data to a first security layer of the first device through a first service layer of the first device;
[0017] a key determination module, configured to determine a session key between the first device and the second device, wherein a physical link is established between a first transport layer of the first device and a second transport layer of the second device, wherein the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link;
[0018] an encryption module, configured to encrypt the first data by using the session key through the first security layer to obtain second data, and transmit the second data to the first transport layer;
[0019] The data sending module is used to send the second data to the second transmission layer through the physical link. The second device is used to transfer the second data to the second security layer of the second device through the second transmission layer. The second data is decrypted using the session key through the second security layer to obtain the first data.
[0020] Optionally, the device further comprises:
[0021] a request sending module, configured to send an authentication request to the second device through the physical link, and the second device is configured to return a first random number through the physical link in response to the authentication request;
[0022] a random number interaction module, configured to receive the first random number returned by the second device through the physical link, and send a second random number to the second device; the second device is further configured to receive the second random number and return a target encryption algorithm through the physical link; the second device is further configured to process the first random number and the second random number according to the target encryption algorithm through the second security layer to obtain the session key;
[0023] A key acquisition module is used to receive the target encryption algorithm returned by the second device through the physical link; transmit the target encryption algorithm to the first security layer through the first transport layer; and process the first random number and the second random number according to the target encryption algorithm through the first security layer to obtain the session key.
[0024] Optionally, the random number interaction module includes:
[0025] A random number interaction unit is used to receive the first random number returned by the second device through the physical link, and send the second random number and at least one encryption algorithm to the second device; the second device is also used to determine the target encryption algorithm from the at least one encryption algorithm through the second security layer.
[0026] Optionally, the authentication request carries first protocol version information of the first device, and the random number interaction unit is used to:
[0027] receiving, through the physical link, the first random number and the second protocol version information returned by the second device;
[0028] Passing the first random number and the second protocol version information to the first security layer through the first transport layer;
[0029] Determine, through the first security layer, at least one encryption algorithm supported by the first device and the second device according to the first protocol version information and the second protocol version information, and pass the second random number and the at least one encryption algorithm to the first transport layer;
[0030] The second random number and the at least one encryption algorithm are sent to the second device through the physical link.
[0031] Optionally, the random number interaction module includes:
[0032] a random number receiving unit, configured to receive, through the physical link, the first random number and the first certificate returned by the second device, wherein the first certificate is used to indicate the identity of the second device; and transmit the first random number and the first certificate to the first security layer through the first transport layer;
[0033] A random number sending unit is used to pass the second random number and the second certificate to the first transport layer if the first certificate is successfully verified through the first security layer, and the second certificate is used to indicate the identity of the first device; send the second random number and the second certificate to the second device through the physical link, and the second device is used to pass the second security layer, and if the second certificate is successfully verified, then return the target encryption algorithm to the first device.
[0034] In another aspect, a data transmission device is provided, the device comprising:
[0035] a data receiving module, configured to receive second data sent by the first device through a physical link between a first transmission layer of the first device and a second transmission layer of the second device, wherein a physical link is established between the first transmission layer and the second transmission layer, wherein the physical link refers to a communication link established through a physical transmission medium, wherein the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link, wherein the second data is transmitted to the first transmission layer by a first security layer of the first device, and wherein the first security layer is configured to encrypt the first data using a session key to obtain the second data;
[0036] a data transmission module, configured to transmit the second data to the second security layer of the second device through the second transmission layer;
[0037] a key determination module, configured to determine the session key between the second device and the first device through the second security layer;
[0038] A decryption module is used to decrypt the second data using the session key through the second security layer to obtain the first data.
[0039] Optionally, the device further comprises:
[0040] The data transmission module is further used to transmit the first data to the second service layer of the second device through the second security layer;
[0041] A data processing module is used to process the first data through the second business layer.
[0042] Optionally, the device further comprises:
[0043] a random number sending module, configured to send a first random number to the first device through the physical link in response to the authentication request sent by the first device, and the first device is configured to return a second random number;
[0044] an encryption algorithm sending module, configured to receive the second random number returned by the first device through the physical link, and send a target encryption algorithm to the first device, wherein the first device is further configured to process the first random number and the second random number through the first security layer according to the target encryption algorithm to obtain the session key;
[0045] A key acquisition module is used to process the first random number and the second random number through the second security layer according to the target encryption algorithm to obtain the session key.
[0046] Optionally, the encryption algorithm sending module includes:
[0047] A first random number receiving unit is configured to receive the second random number and at least one encryption algorithm returned by the first device through the physical link; and transmit the second random number and the at least one encryption algorithm to the second security layer through the second transport layer;
[0048] an encryption algorithm determining unit, configured to determine a target encryption algorithm from the at least one encryption algorithm through the second security layer, and transmit the target encryption algorithm to the second transport layer;
[0049] An encryption algorithm sending unit is used to send the target encryption algorithm to the first device through the physical link.
[0050] Optionally, the authentication request carries first protocol version information of the first device, and the random number sending module includes:
[0051] The first random number sending unit is used to send the first random number and the second protocol version information of the second device to the first device through the physical link in response to the authentication request sent by the first device, and the first device is used to determine at least one encryption algorithm supported by the first device and the second device according to the first protocol version information and the second protocol version information through the first security layer.
[0052] Optionally, the random number sending module includes:
[0053] a second random number sending unit, configured to send the first random number and a first certificate to the first device through the physical link in response to the authentication request sent by the first device, wherein the first certificate is used to indicate the identity of the second device, and the first device is used to pass the first security layer and verify the first certificate, and then return the second random number and the second certificate to the second device, wherein the second certificate is used to indicate the identity of the first device;
[0054] The encryption algorithm sending module comprises:
[0055] A second random number receiving unit is configured to receive the second random number and the second certificate returned by the first device through the physical link; and transmit the second random number and the second certificate to the second security layer through the second transport layer;
[0056] The encryption algorithm sending unit is also used to pass the target encryption algorithm to the second transport layer if the second certificate is verified through the second security layer; and send the target encryption algorithm to the first device through the physical link.
[0057] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the data transmission method described in the above aspects.
[0058] On the other hand, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed in the data transmission method described in the above aspects.
[0059] On the other hand, a computer program product or a computer program is provided, wherein the computer program product or the computer program comprises a computer program code, wherein the computer program code is stored in a computer-readable storage medium, wherein a processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the data transmission method as described in the above aspects.
[0060] The embodiment of the present application provides a scheme for realizing data encryption transmission on a physical link, which can establish a physical link between two devices, and the two devices hold a session key. When either device wants to transmit data, it first uses the session key to encrypt the data, and then transmits the encrypted data through the physical link, and the other device uses the session key to decrypt the encrypted data. Through the above method, the data transmitted in the physical link is encrypted data, which is not easy to be eavesdropped or tampered with, ensuring the security and reliability of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0062] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application.
[0063] Figure 2 It is a schematic diagram of transmitting data through a physical link provided by the relevant technology.
[0064] Figure 3 It is a schematic diagram of transmitting data through a physical link provided by an embodiment of the present application.
[0065] Figure 4 It is a flow chart of a data transmission method provided in an embodiment of the present application.
[0066] Figure 5 This is a flowchart of another data transmission method provided in an embodiment of the present application.
[0067] Figure 6 This is a flowchart of another data transmission method provided in an embodiment of the present application.
[0068] Figure 7 This is a flowchart of an authentication process provided by an embodiment of the present application.
[0069] Figure 8 It is a flow chart of an authentication process of a cash register and a payment device provided in an embodiment of the present application.
[0070] Fig. 9 This is a flowchart of another data transmission method provided in an embodiment of the present application.
[0071] Fig.10 This is a flow chart of a cash register sending data to a payment device provided in an embodiment of the present application.
[0072] Fig.11 This is a flow chart of a payment device sending data to a cash register provided in an embodiment of the present application.
[0073] Fig.12 It is a schematic diagram of another data transmission method provided in an embodiment of the present application.
[0074] Fig.13 It is a structural diagram of a data transmission device provided in an embodiment of the present application.
[0075] Fig.14 It is a structural schematic diagram of another data transmission device provided in an embodiment of the present application.
[0076] Fig.15 It is a structural schematic diagram of another data transmission device provided in an embodiment of the present application.
[0077] Fig.16 It is a structural schematic diagram of another data transmission device provided in an embodiment of the present application.
[0078] Fig.17 It is a structural diagram of a terminal provided in an embodiment of the present application.
[0079] Fig.18 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0081] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of this application, a first device can be referred to as a second device, and similarly, a second device can be referred to as a first device.
[0082] Here, at least one refers to one or more than one. For example, at least one encryption algorithm can be one encryption algorithm, two encryption algorithms, three encryption algorithms, or any integer greater than or equal to one.
[0083] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, see Figure 1, the implementation environment includes: a first device 101 and a second device 102. A physical link is established between the first device 101 and the second device 102. The physical link refers to a communication link established through a physical transmission medium, including at least one of a Bluetooth link, a serial port link, a network cable link, or a USB (Universal Serial Bus) link. The first device 101 and the second device 102 send and receive data to each other through the physical link, so that the first device 101 and the second device 102 have the ability of two-way communication, thereby establishing a two-way communication system.
[0084] In one possible implementation, the first device 101 is a terminal or a server, and the second device 102 is a terminal or a server. Optionally, the terminal is a face-swiping payment device, a code scanning payment device, a cash register, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker or a smart watch, etc., but is not limited thereto. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0085] Figure 2 This is a schematic diagram of data transmission through a physical link provided by the relevant technology, see Figure 2 In the related art, the first device 201 includes a first service layer 211 and a first transmission layer 221, and the first service layer 211 is connected to the first transmission layer 221. The second device 202 includes a second service layer 212 and a second transmission layer 222, and the second service layer 212 is connected to the second transmission layer 222. A physical link is established between the first transmission layer 221 and the second transmission layer 222, and the first device 201 and the second device 202 communicate through the physical link. The first device 201 encapsulates data through the first service layer 211 and passes it to the first transmission layer 212. The first transmission layer 212 transmits the encapsulated data to the second transmission layer 222 through the physical link. The second transmission layer 222 passes the encapsulated data to the second service layer 212, and the second service layer 212 decapsulates the received data to obtain the data before encapsulation, thereby completing the data transmission. In the above data transmission process, malicious programs may eavesdrop or tamper with the data in the physical link, so the security of transmitting data through the physical link is poor.
[0086] Figure 3 is a schematic diagram of transmitting data through a physical link provided by an embodiment of the present application, see Figure 3, the first device 301 includes a first business layer 311, a first security layer 321 and a first transport layer 331, the first business layer 311 is connected to the first security layer 321, and the first security layer 321 is connected to the first transport layer 331. The second device 302 includes a second business layer 312, a second security layer 322 and a second transport layer 332, the second business layer 312 is connected to the second security layer 322, and the second security layer 322 is connected to the second transport layer 332. Among them, a physical link is established between the first transport layer 331 and the second transport layer 332, and the first device 301 and the second device 302 communicate through the physical link between the first transport layer 331 and the second transport layer 332. Optionally, in an embodiment of the present application, data is encrypted by the security layer, the encrypted data is encapsulated, and the encapsulated data is passed to the transport layer. In the embodiment of the present application, identity authentication, session key generation, and data encryption and decryption between devices are completed through the security layers of the two devices, and the encrypted data is transmitted in the physical link, which can prevent malicious programs from eavesdropping or tampering with the data in the physical link, thereby ensuring the confidentiality and reliability of data transmission.
[0087] The embodiments of the present application can be applied to any scenario where any two devices communicate through a physical link, for example, in the scenario of online payment:
[0088] The first device is a cash register for merchants, and the second device is a payment device for consumers, such as a QR code scanning payment device, a face recognition payment device, etc. A physical link is established between the cash register and the payment device. The cash register determines the session key between the cash register and the payment device, uses the session key to encrypt the order information during the consumption process, and sends the encrypted order information to the payment device through the physical link. The payment device uses the session key to decrypt the encrypted order information to obtain the decrypted order information, thereby processing and displaying the order information, and completing the payment operation according to the order information.
[0089] Figure 4 is a flow chart of a data transmission method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is a first device, see Figure 4 , the method comprising:
[0090] 401. Deliver first data to a first security layer of a first device through a first business layer of a first device.
[0091] The first service layer of the first device obtains the first data, and transmits the first data to the first security layer of the first device. Optionally, the first data is service data generated in the first service layer.
[0092] 402. Determine a session key between the first device and the second device through the first security layer.
[0093] A physical link is established between the first device and the second device, and the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link. Optionally, the physical link is a communication link directly established between the first device and the second device, without any other switching device in between.
[0094] The first device and the second device can perform bidirectional data transmission via the physical link, wherein the transmission via the physical link is different from the data transmission via the Internet.
[0095] First, since the physical link is a communication link established through a physical transmission medium, data can be directly transmitted between two devices through the physical link without using a communication protocol for controlling transmission. Data transmission through the Internet requires the support of a communication protocol, such as the TCP / IP (Transmission Control Protocol / Internet Protocol) or HTTP (HyperText Transfer Protocol).
[0096] Secondly, since the physical link is a communication link directly established between the first device and the second device, and there is no other switching device in between, data can be directly transmitted between the first device and the second device without the assistance of other devices for data forwarding; when data is transmitted through the Internet, it needs to be forwarded through devices such as gateways or routers to complete the data transmission.
[0097] In order to ensure the security of data transmission between the first device and the second device via the physical link, the first device may use a session key to encrypt the data to be transmitted. Therefore, before transmitting data with the second device, the first device first determines the session key between the first device and the second device.
[0098] The session key is a key between the first device and the second device. When the first device and the second device transmit data, the session key can be used to encrypt or decrypt the transmitted data. The first device and the second device both hold a session key for transmitting data with each other. Optionally, the session key is a symmetric key. The session key held by the first device is the same as the session key held by the second device. The same session key can be used to encrypt and decrypt data.
[0099] 403. Encrypt the first data using the session key through the first security layer to obtain second data, and transmit the second data to the first transport layer.
[0100] The first device determines a session key between itself and the second device, and first data to be sent to the second device, and encrypts the first data using the session key to obtain encrypted second data.
[0101] Among them, encryption refers to the use of technical means to change the original data to obtain the corresponding encrypted data, and the content of the original data cannot be directly known based on the encrypted data. Optionally, the encrypted data is garbled data or data without practical meaning. Therefore, even if the encrypted data is intercepted by a malicious program, the malicious program cannot obtain the original data from the encrypted data, thus ensuring the security of the original data.
[0102] 404. Send second data to the second transport layer through the physical link.
[0103] After the first device completes the encryption of the first data, it sends the encrypted second data to the second device through the physical link between the first device and the second device. When the second device receives the second data, it uses the session key between the first device and the first device to decrypt the second data and obtain the first data, thereby completing the process of the first device sending the first data to the second device and ensuring the security of the first data.
[0104] The embodiment of the present application provides a scheme for realizing data encryption transmission on a physical link, which can establish a physical link between two devices, and the two devices hold a session key. When either device wants to transmit data, it first uses the session key to encrypt the data, and then transmits the encrypted data through the physical link, and the other device uses the session key to decrypt the encrypted data. Through the above method, the data transmitted in the physical link is encrypted data, which is not easy to be eavesdropped or tampered with, ensuring the security and reliability of data transmission.
[0105] Figure 5 is a flow chart of another data transmission method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is a second device, see Figure 5 , the method comprising:
[0106] 501. Receive second data sent by a first device through a physical link between a first transmission layer of the first device and a second transmission layer of the second device.
[0107] A physical link is established between the first device and the second device. The physical link refers to a communication link established through a physical transmission medium. The physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link. The physical link is the same as the physical link in the above step 401, and will not be described in detail here.
[0108] The first device and the second device can perform bidirectional data transmission through the physical link, and after the first device sends the second data to the second device through the physical link, the second device can receive the second data through the physical link. The second data is obtained by the first device encrypting the first data using the session key between the first device and the second device.
[0109] Among them, encryption refers to the use of technical means to change the original data to obtain the corresponding encrypted data, and the content of the original data cannot be directly known based on the encrypted data. Optionally, the encrypted data is garbled data or data without practical meaning. Therefore, even if the encrypted data is intercepted by a malicious program, the malicious program cannot obtain the original data from the encrypted data, thus ensuring the security of the original data.
[0110] The session key is a key between the first device and the second device. When the first device and the second device transmit data, the session key can be used to encrypt or decrypt the transmitted data. The first device and the second device both hold a session key for transmitting data with each other. Optionally, the session key is a symmetric key. The session key held by the first device is the same as the session key held by the second device. The same session key can be used to encrypt and decrypt data.
[0111] 502. Deliver second data to a second security layer of a second device through a second transport layer.
[0112] 503. Determine a session key between the second device and the first device through the second security layer.
[0113] When the second device obtains the second data, it needs to decrypt the second data to obtain the first data before encryption, so the second device determines the session key between the second device and the first device.
[0114] 504. Decrypt the second data using the session key through the second security layer to obtain the first data.
[0115] When the second device determines the session key between itself and the first device, it uses the session key to decrypt the second data to obtain the first data, and the second device can subsequently process the first data.
[0116] The embodiment of the present application provides a scheme for realizing data encryption transmission on a physical link, which can establish a physical link between two devices, and the two devices hold a session key. When either device wants to transmit data, it first uses the session key to encrypt the data, and then transmits the encrypted data through the physical link, and the other device uses the session key to decrypt the encrypted data. Through the above method, the data transmitted in the physical link is encrypted data, which is not easy to be eavesdropped or tampered with, ensuring the security and reliability of data transmission.
[0117] Figure 6 is a flowchart of another data transmission method provided in an embodiment of the present application. The interaction subjects in the embodiment of the present application are the first device and the second device. Figure 6 , the method comprising:
[0118] 601. The first device sends an authentication request to the second device.
[0119] A physical link is established between the first device and the second device. The physical link refers to a communication link established through a physical transmission medium. The physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus USB link. Optionally, the physical link is a physical communication link of other types, which is not limited in the embodiment of the present application. The physical link is the same as the physical link in the above step 401, and will not be repeated here.
[0120] The first device and the second device transmit data through a physical link. Since data is transmitted directly through a physical link, the transmitted data may be eavesdropped or tampered with by malicious programs, so the security of data transmission is poor. In order to ensure the confidentiality and reliability of data, before the first device and the second device transmit data, they obtain the session key between the first device and the second device through mutual authentication, and then use the session key to encrypt and decrypt the data to ensure that the transmitted data will not be eavesdropped or tampered with, that is, to establish a secure data transmission channel. Therefore, first, the first device sends an authentication request to the second device, thereby starting the authentication process between the first device and the second device.
[0121] In one possible implementation, the authentication request carries the first protocol version information of the first device. The first protocol version information refers to the version information of the security protocol used by the first device, and the security protocol is used to ensure the confidentiality and data integrity of the communication between the two devices. Optionally, the version information includes the version number of the security protocol. Optionally, the security protocol is the TLS protocol (Transport Layer Security) or the SSL protocol (Secure Sockets Layer). Among them, the TLS protocol includes a record layer protocol and a transport layer protocol. The record layer protocol is used to determine the encapsulation format of the transport layer data, and the transport layer security protocol is used for identity authentication, key exchange, key generation, or encryption and decryption of data, etc.
[0122] 602. The second device sends a first random number to the first device in response to the authentication request sent by the first device.
[0123] The second device randomly generates a first random number in response to the authentication request sent by the first device, and sends the first random number to the first device, where the first random number is used to generate a session key between the first device and the second device.
[0124] In a possible implementation, the authentication request carries the first protocol version information of the first device. In response to the authentication request sent by the first device, the second device sends the first random number and the second protocol version information of the second device to the first device.
[0125] The second device receives the authentication request of the first device, and determines that the authentication request carries the first protocol version information of the first device. The second device then determines the second protocol version information of the second device, randomly generates a first random number, and sends the first random number and the second protocol version information to the first device. The second protocol version information is the version information of the security protocol in the second device. The security protocol in the second device is similar to the security protocol in the first device, but the versions of the security protocol in the second device and the security protocol in the first device may be the same or different. Therefore, the first device and the second device exchange the version information of the security protocol during the authentication process, thereby obtaining the version information of the security protocol of the other party.
[0126] In another possible implementation, the second device sends the first random number and the first certificate to the first device in response to the authentication request sent by the first device.
[0127] The second device receives the authentication request of the first device, obtains the first certificate of the second device, randomly generates a first random number, and sends the first random number and the first certificate to the first device. The first certificate is used to indicate the identity of the second device. Optionally, the first certificate is a CA (Certificate Authority) certificate of the first device, wherein the CA certificate includes the identity information of the second device and the CA signature, the identity information is used to prove the identity of the second device, and the CA signature is used to ensure the authenticity of the identity information. Optionally, the first certificate is other types of digital certificates, which are not limited in the embodiments of the present application.
[0128] In another possible implementation, the authentication request carries the first protocol version information of the first device. In response to the authentication request sent by the first device, the second device sends the first random number, the second protocol version information and the first certificate to the first device.
[0129] The second device receives the authentication request of the first device and determines that the authentication request carries the first protocol version information in the first device. The second device then determines the second protocol version information in the second device, obtains the first certificate of the second device, randomly generates a first random number, and sends the first protocol version information, the first certificate and the first random number to the first device.
[0130] 603. The first device receives the first random number returned by the second device, and sends a second random number to the second device.
[0131] When the first device receives the first random number returned by the second device, it randomly generates a second random number and sends the second random number to the second device. The second random number is also used to generate a session key between the first device and the second device.
[0132] In a possible implementation, the first device receives a first random number returned by the second device, and sends a second random number and at least one encryption algorithm to the second device.
[0133] The first device receives the first random number returned by the second device, randomly generates a second random number, determines at least one encryption algorithm, and sends the second random number and the at least one encryption algorithm to the second device. The encryption algorithm is used to generate a session key, and is used to encrypt and decrypt data using the generated session key.
[0134] Optionally, the authentication request carries the first protocol version information of the first device, and the second device also returns the second protocol version information to the first device. After the first device receives the first random number and the second protocol version information returned by the second device, the first device determines at least one encryption algorithm supported by the first device and the second device based on the first protocol version information and the second protocol version information, and sends the second random number and at least one encryption algorithm to the second device.
[0135] Among them, the encryption algorithm is used to generate a session key, and both the first device and the second device need to generate a session key, so the encryption algorithm should be an encryption algorithm supported by the first device and the second device, then the first device can determine at least one encryption algorithm supported by the first device according to the first protocol version information, and determine at least one encryption algorithm supported by the second device according to the second protocol version information, thereby determining at least one encryption algorithm supported by both the first device and the second device from multiple encryption algorithms. Optionally, the first device also determines at least one encryption algorithm supported by the first device according to the attribute information of the first device itself.
[0136] In another possible implementation, the first device receives the first random number and the first certificate returned by the second device, and if the first certificate is verified, sends the second random number and the second certificate to the second device.
[0137] After the second device receives the authentication request from the first device, it also returns the first certificate of the second device. The first device receives the first certificate, verifies the first certificate to verify the identity of the second device, and when it is determined that the first certificate is verified, it proves that the identity of the second device is authentic and reliable. Then the first device obtains the second certificate of the first device, randomly generates a second random number, and sends the second random number and the second certificate to the second device. The second certificate is used to indicate the identity of the first device. The second certificate is similar to the first certificate in step 602 above, and will not be repeated here.
[0138] Optionally, the first device uses an asymmetric encryption algorithm to verify the first certificate of the second device. Optionally, a certificate authority is used to assist in completing the identity authentication process using an asymmetric encryption algorithm. Among them, the certificate authority sends its public key to the first device and the second device. The second device sends the public key and identity information of the second device to the certificate authority, and the certificate authority uses its own private key to encrypt the public key and identity information of the second device to obtain the first certificate of the second device. After the second device sends the first certificate to the first device, the first device uses the public key of the certificate authority to decrypt the first certificate, obtain the public key and identity information of the second device, and thus verify the identity information. Optionally, the first device can interact with the second device using the public key of the second device.
[0139] In another possible implementation, the first device receives the first random number and the first certificate returned by the second device, verifies the first certificate, and sends the second random number, at least one encryption algorithm, and the second certificate to the second device.
[0140] The first device receives the first random number and the first certificate, verifies the first certificate to verify the identity of the second device, and when it is determined that the first certificate verification is passed, it proves that the identity of the second device is authentic and reliable. The first device then obtains the second certificate of the first device, determines at least one encryption algorithm, and randomly generates a second random number, and sends the second random number, at least one encryption algorithm and the second certificate to the second device.
[0141] 604. The second device receives the second random number returned by the first device, and sends a target encryption algorithm to the first device.
[0142] When the second device receives the second random number returned by the first device, it determines the target encryption algorithm and sends the target encryption algorithm to the first device. The target encryption algorithm is used to generate a session key between the first device and the second device. Optionally, the target encryption algorithm is a dynamic key algorithm, an AES (Advanced Encryption Standard) encryption algorithm or a 3DES (Triple Data Encryption Standard) encryption algorithm, or other types of encryption algorithms, which are not limited in the embodiments of the present application.
[0143] In one possible implementation, the second device receives the second random number and at least one encryption algorithm returned by the first device, determines a target encryption algorithm from the at least one encryption algorithm, and sends the target encryption algorithm to the first device.
[0144] The first device sends at least one encryption algorithm to the second device, and the at least one encryption algorithm is an encryption algorithm supported by the first device and the second device as determined by the first device, and the second device determines a target encryption algorithm from the at least one encryption algorithm, and subsequently generates a session key by using the target encryption algorithm. Optionally, the second device determines a target encryption algorithm supported by the second device from the at least one encryption algorithm according to the attribute information of the second device itself.
[0145] In another possible implementation, the second device receives the second random number and the second certificate returned by the first device, and sends the target encryption algorithm to the first device if the second certificate is verified.
[0146] The second device receives the second certificate and verifies the second certificate to verify the identity of the first device. When it is determined that the second certificate is verified, it proves that the identity of the first device is authentic and reliable. Then the second device determines the target encryption algorithm and sends the target encryption algorithm to the first device. Optionally, the second device uses an asymmetric encryption algorithm to verify the second certificate of the first device.
[0147] By executing the above steps 601-604, the data exchange between the first device and the second device is completed. At this time, the first device obtains the first random number, the second random number and the target encryption algorithm, and the second device also obtains the first random number, the second random number and the target encryption algorithm.
[0148] 605. The second device processes the first random number and the second random number according to the target encryption algorithm to obtain a session key.
[0149] The target encryption algorithm includes a method for encrypting random numbers to generate a session key. Therefore, after the second device determines the target encryption algorithm, the first random number and the second random number, it encrypts the first random number and the second random number according to the target encryption algorithm to obtain the session key between the first device and the second device. The session key is used to encrypt or decrypt data.
[0150] It should be noted that the embodiment of the present application is only described by taking the example of obtaining the session key according to the target encryption algorithm, the first random number and the second random number. In another embodiment, other methods are used to obtain the session key between the first device and the second device.
[0151] 606. The first device receives the target encryption algorithm returned by the second device, and processes the first random number and the second random number according to the target encryption algorithm to obtain a session key.
[0152] After the first device determines the target encryption algorithm, the first random number and the second random number, it encrypts the first random number and the second random number according to the target encryption algorithm to obtain a session key between the first device and the second device.
[0153] Among them, by executing the above steps 601-605, the process of identity authentication and key generation between the first device and the second device is completed, and the process of identity authentication and key generation is also called the handshake phase. After the first device and the second device complete the handshake, the first device and the second device can use the session key to encrypt or decrypt data to ensure the security of communication.
[0154] In one possible implementation, see above Figure 3The first device includes a first business layer, a first security layer, and a first transport layer. The first business layer is connected to the first security layer, and the first security layer is connected to the first transport layer. The second device includes a second business layer, a second security layer, and a second transport layer. The second business layer is connected to the second security layer, and the second security layer is connected to the second transport layer. A physical link is established between the first transport layer and the second transport layer, and the first device and the second device communicate through the physical link between the first transport layer and the second transport layer.
[0155] The business layer is used to process business data, parse and process data obtained from the security layer, and complete business functions. The security layer is used to parse and process data obtained from the transport layer, and is also used to perform identity authentication, key exchange, key generation and other processes, and encrypt the data of the business layer based on the session key and then pass it to the transport layer, or decrypt the data of the transport layer based on the session key and then pass it to the business layer. The transport layer is used to receive data transmitted from the physical link, and pass the processed data to the security layer through processes such as data parsing, verification and deduplication, and assemble, send and resend the data passed from the security layer, and transmit the processed data through the physical link.
[0156] Among them, the first security layer and the second security layer are used to implement authentication between devices, exchange session keys, and encrypt and decrypt data, and the first transport layer and the second transport layer are used to transmit data through physical links. The security layer is only used to perform encryption and decryption of data, and does not focus on the sending and receiving of data. The transport layer is used to perform the sending and receiving of data, and does not focus on the encryption and decryption of data. The security layer encrypts the data passed from the business layer, or the security layer decrypts the received data and passes it to the business layer, thereby providing security for the business data of the business layer.
[0157] See Figure 7 , the above steps 601-606 are replaced by the following steps 701-706:
[0158] 701. A first device generates an authentication request through a first security layer, the first security layer passes the authentication request to a first transport layer, and the first transport layer sends the authentication request to a second transport layer of a second device through a physical link.
[0159] Optionally, the authentication request carries first protocol version information of the first device.
[0160] 702. The second device receives the authentication request through a physical link, and the second transport layer passes the authentication request to the second security layer. The second security layer generates a first random number in response to the authentication request and passes the first random number to the second transport layer. The second transport layer sends the first random number to the first transport layer of the first device through the physical link.
[0161] Optionally, the authentication request carries the first protocol version information of the first device. In response to the authentication request, the second security layer generates a first random number, obtains the second protocol version information of the second device, and passes the first random number and the second protocol version information to the second transport layer, and the second transport layer sends the first random number and the second protocol version information to the first transport layer of the first device through a physical link.
[0162] Optionally, the second security layer generates a first random number in response to the authentication request, obtains a first certificate, and passes the first random number and the first certificate to the second transport layer, and the second transport layer sends the first random number and the first certificate to the first transport layer of the first device via a physical link.
[0163] 703. The first device receives the first random number through a physical link, the first transport layer passes the first random number to the first security layer, the first security layer receives the first random number, generates a second random number, the first security layer passes the second random number to the first transport layer, and the first transport layer sends the second random number to the second transport layer of the second device through the physical link.
[0164] Optionally, the first security layer receives a first random number, generates a second random number, obtains at least one encryption algorithm, the first security layer passes the second random number and the at least one encryption algorithm to the first transport layer, and the first transport layer sends the second random number and the at least one encryption algorithm to the second transport layer of the second device via a physical link.
[0165] Optionally, the authentication request carries the first protocol version information of the first device. The second device also returns the second protocol version information to the first device, and the first device receives the first random number and the second protocol version information through a physical link, and the first transport layer passes the first random number and the second protocol version information to the first security layer. After the first security layer receives the first random number and the second protocol version information, it determines at least one encryption algorithm supported by the first device and the second device according to the first protocol version information and the second protocol version information.
[0166] Optionally, the first device receives a first random number and a first certificate through a physical link, and the first transport layer passes the first random number and the first certificate to the first security layer. The first security layer receives the first random number and the first certificate, verifies the first certificate, and determines that the first certificate verification is successful, then generates a second random number, obtains the second certificate of the first device, and the first security layer passes the second random number and the second certificate to the first transport layer. The first transport layer sends the second random number and the second certificate to the second transport layer of the second device through the physical link.
[0167] 704. The second device receives the second random number through the physical link, and the second transport layer passes the second random number to the second security layer. The second security layer receives the second random number, determines the target encryption algorithm, and the second security layer passes the target encryption algorithm to the second transport layer. The second transport layer sends the target encryption algorithm to the first transport layer of the first device through the physical link.
[0168] Optionally, the second device receives a second random number and at least one encryption algorithm through a physical link, and the second transport layer passes the second random number and at least one encryption algorithm to the second security layer. The second security layer receives the second random number and at least one encryption algorithm, and determines a target encryption algorithm from the at least one encryption algorithm.
[0169] Optionally, the second device receives the second random number and the second certificate through a physical link, and the second transport layer passes the second random number and the second certificate to the second security layer. The second security layer receives the second random number and the second certificate, verifies the second certificate, and determines that the second certificate verification is successful. Then, the target encryption algorithm is determined, and the second security layer passes the target encryption algorithm to the second transport layer. The second transport layer sends the target encryption algorithm to the first transport layer of the first device through the physical link.
[0170] 705. The second device processes the first random number and the second random number through the second security layer and according to the target encryption algorithm to obtain a session key.
[0171] 706. The first device receives the target encryption algorithm through the physical link, and the first transport layer transmits the target encryption algorithm to the first security layer. When the first security layer receives the target encryption algorithm, it processes the first random number and the second random number according to the target encryption algorithm to obtain a session key.
[0172] It should be noted that the embodiment of the present application only takes the example of the first device sending an authentication request to the second device to complete the authentication process. In another embodiment, the second device sends an authentication request to the first device to complete the authentication process.
[0173] For example, the first device is a cash register and the second device is a payment device. Figure 8 This is a flowchart of the authentication process of a cash register and a payment device provided in an embodiment of the present application. Figure 8 , the certification process includes:
[0174] 801. The cash register sends the protocol version information of the cash register to the payment device;
[0175] 802. The payment device returns the protocol version information of the payment device, the certificate of the payment device and the random number of the payment device to the cash register;
[0176] 803. The cash register verifies whether the certificate of the payment device is legal. If it is determined that the certificate of the payment device is legal, step 804 is executed.
[0177] 804. The cash register sends the cash register certificate and the cash register random number to the payment device;
[0178] 805. The payment device verifies whether the certificate of the cash register is legal. If the certificate of the cash register is legal, step 806 is executed.
[0179] 806. The cash register sends at least one supported encryption algorithm to the payment device;
[0180] 807. The payment device selects a target encryption algorithm and sends the target encryption algorithm to the cash register;
[0181] 808. The cash register generates a session key according to the target encryption algorithm, the random number of the cash register and the random number of the payment device;
[0182] 809. The payment device generates a session key according to the target encryption algorithm, the random number of the cash register and the random number of the payment device.
[0183] By executing the above steps 801-809, the payment device and the cash register both obtain the session key between the payment device and the cash register. Subsequently, the payment device and the cash register can communicate based on the session key to ensure the confidentiality and reliability of the communication.
[0184] 607. The first device determines a session key between the first device and the second device.
[0185] When the first device and the second device both obtain the session key between the first device and the second device, in order to ensure the security of data transmission between the first device and the second device through the physical link, the first device can use the session key to encrypt the data to be transmitted. Therefore, before the first device and the second device perform data transmission, the first device first determines the session key between the first device and the second device.
[0186] It should be noted that the embodiment of the present application only takes the data transmission between the first device and the second device as an example to illustrate the process of exchanging session keys between the first device and the second device. Optionally, the first device stores session keys between the first device and multiple devices, and the multiple devices include the second device. Therefore, the first device determines the session key between the first device and the second device from the multiple session keys.
[0187] 608. The first device uses the session key to encrypt the first data to obtain second data.
[0188] After the first device determines the session key between itself and the second device and the first data to be sent to the second device, the first device uses the session key to encrypt the first data to obtain encrypted second data.
[0189] Among them, since the second data is obtained by encrypting the first data, the content of the first data cannot be directly known according to the second data. Optionally, the second data is garbled data or data without practical meaning. Therefore, even if the second data is intercepted by a malicious program, the malicious program cannot obtain the first data from the second data, thereby ensuring the security of the first data.
[0190] Optionally, the target encryption algorithm also includes a method of encrypting data using a session key. The first device determines the target encryption algorithm for generating the session key, and encrypts the first data using the session key according to the target encryption algorithm to obtain encrypted second data.
[0191] 609. The first device sends second data to the second device through the physical link.
[0192] After the first device completes encryption of the first data, it sends the encrypted second data to the second device via the physical link between the first device and the second device.
[0193] 610. The second device receives second data sent by the first device through a physical link.
[0194] 611. The second device determines a session key between the second device and the first device.
[0195] Since the second data is the data obtained by encrypting the first data by the first device, the data that the first device actually transmits to the second device is the first data, and the second data is only generated to protect the security of the first data, so the second device needs to decrypt the second data to obtain the first data. Therefore, the second device first determines the session key between the second device and the first device.
[0196] It should be noted that the embodiment of the present application only takes the data transmission between the first device and the second device as an example to illustrate the process of exchanging session keys between the first device and the second device. Optionally, the second device stores session keys between the second device and multiple devices, the multiple devices including the first device, so the second device determines the session key between the second device and the first device from the multiple session keys.
[0197] 612. The second device uses the session key to decrypt the second data to obtain the first data.
[0198] After the second device determines the session key between itself and the first device, it uses the session key to decrypt the second data to obtain the decrypted first data.
[0199] Optionally, the target encryption algorithm also includes a method for decrypting data using a session key. The second device determines the target encryption algorithm that generates the session key, and decrypts the second data using the session key according to the target encryption algorithm to obtain the decrypted first data.
[0200] In a possible implementation, the first device includes a first service layer, a first security layer, and a first transmission layer. The second device includes a second service layer, a second security layer, and a second transmission layer. Then the above steps 607-612 are replaced by the following steps 901-909. Fig. 9 , the steps include:
[0201] 901. A first device transmits first data to a first security layer of a first device through a first service layer of the first device.
[0202] 902. The first device determines a session key between the first device and the second device through the first security layer, and encrypts the first data using the session key to obtain second data.
[0203] 903. The first device transmits second data to the first transport layer of the first device through the first security layer;
[0204] 904. The first device sends second data to the second transport layer through a physical link between the first transport layer and the second transport layer of the second device.
[0205] 905. The second device receives second data sent by the first transport layer through a physical link between the second transport layer of the second device and the first transport layer of the first device;
[0206] 906. The second device transmits the second data to the second security layer of the second device through the second transport layer;
[0207] 907. The second device determines the session key between the second device and the first device through the second security layer, and uses the session key to decrypt the second data to obtain the first data.
[0208] 908. The second device transmits the first data to the second business layer of the second device through the second security layer;
[0209] 909. The second device processes the first data through the second service layer.
[0210] For example, the first device is a cash register and the second device is a payment device. After the cash register and the payment device complete authentication, data transmission can be performed using a session key. Fig.10 This is a flow chart of a cash register sending data to a payment device provided in an embodiment of the present application, see Fig.10 , the data sending process is as follows:
[0211] 1001. The first business layer of the cash register passes the data to the first security layer;
[0212] 1002. The first security layer of the cash register encrypts the data using the session key;
[0213] 1003. The first security layer of the cash register transmits the encrypted data to the first transport layer;
[0214] 1004. The first transmission layer of the cash register sends the encrypted data to the second transmission layer of the payment device;
[0215] 1005. The second transport layer of the payment device transmits the encrypted data to the second security layer;
[0216] 1006. The second security layer of the payment device decrypts the data using the session key;
[0217] 1007. The second security layer of the payment device transmits the decrypted data to the second business layer;
[0218] 1008. The second business layer of the payment device processes the decrypted data.
[0219] Fig.11 This is a flow chart of a payment device sending data to a cash register provided by an embodiment of the present application. Fig.11 , the data sending process is as follows:
[0220] 1101. The second business layer of the payment device transmits the data to the second security layer;
[0221] 1102. The second security layer of the payment device encrypts the data using the session key;
[0222] 1103. The second security layer of the payment device transmits the encrypted data to the second transport layer;
[0223] 1104. The second transmission layer of the payment device sends the encrypted data to the first transmission layer of the cash register;
[0224] 1105. The first transmission layer of the cash register transmits the encrypted data to the first security layer;
[0225] 1106. The first security layer of the cash register decrypts the data using the session key;
[0226] 1107. The first security layer of the cash register passes the decrypted data to the first business layer;
[0227] 1108. The first business layer of the cash register processes the decrypted data.
[0228] Fig.12 is a schematic diagram of another data transmission method provided in an embodiment of the present application, see Fig.12 , the process of authentication and data transmission between the first device and the second device is as follows:
[0229] 1201. The first device sends the protocol version information of the first device to the second device;
[0230] 1202. The second device returns the protocol version information of the second device, the certificate of the second device, and the random number of the second device;
[0231] 1203. The first device verifies whether the certificate of the second device is legal. If it is determined that the certificate of the second device is legal, step 1204 is executed.
[0232] 1204. The first device sends a certificate of the first device and a random number of the first device to the second tongue;
[0233] 1205. The second device verifies whether the certificate of the first device is legal. If it is determined that the certificate of the first device is legal, step 1206 is executed.
[0234] 1206. The first device sends at least one supported encryption algorithm to the second device;
[0235] 1207. The second device selects a target encryption algorithm and sends the target encryption algorithm to the first device;
[0236] 1208. The first device generates a session key according to a target encryption algorithm, a random number of the first device, and a random number of the second device;
[0237] 1209. The second device generates a session key according to the target encryption algorithm, the random number of the first device, and the random number of the second device;
[0238] 1210. The first device encrypts data using the session key, and transmits the encrypted data to the second device;
[0239] 1211. The second device encrypts data using the session key, and transmits the encrypted data to the first device.
[0240] The embodiment of the present application provides a scheme for realizing data encryption transmission on a physical link, which can establish a physical link between two devices, and the two devices hold a session key. When either device wants to transmit data, it first uses the session key to encrypt the data, and then transmits the encrypted data through the physical link, and the other device uses the session key to decrypt the encrypted data. Through the above method, the data transmitted in the physical link is encrypted data, which is not easy to be eavesdropped or tampered with, ensuring the security and reliability of data transmission.
[0241] In addition, the two devices exchange certificates and verify the certificates of the other device. Only when both certificates are verified will the authentication process be continued to generate the session key. The above authentication process can prevent malicious programs from impersonating devices to steal session keys, thereby preventing malicious programs from using session keys to eavesdrop or tamper with data, further ensuring the security and reliability of data transmission.
[0242] In addition, the two devices exchange protocol version information to negotiate a target encryption algorithm supported by both parties, which can avoid the situation where a session key cannot be generated due to the use of an encryption algorithm that is not supported by one of the devices.
[0243] Fig.13 is a structural diagram of a data transmission device provided in an embodiment of the present application. Fig.13 , the device comprises:
[0244] The data transmission module 1301 is used to transmit the first data to the first security layer of the first device through the first service layer of the first device;
[0245] The key determination module 1302 is used to determine the session key between the first device and the second device through the first security layer, wherein a physical link is established between the first transport layer of the first device and the second transport layer of the second device, wherein the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus USB link;
[0246] The encryption module 1303 is used to encrypt the first data by using the session key through the first security layer to obtain the second data, and transmit the second data to the first transport layer;
[0247] The data sending module 1304 is used to send the second data to the second transmission layer through the physical link. The second device is used to transfer the second data to the second security layer of the second device through the second transmission layer. The second data is decrypted using the session key through the second security layer to obtain the first data.
[0248] The apparatus provided in the embodiment of the present application can establish a physical link between two devices, and the two devices hold a session key. When either device wants to transmit data, it first uses the session key to encrypt the data, and then transmits the encrypted data through the physical link, and the other device uses the session key to decrypt the encrypted data. The data transmitted in the physical link is encrypted data, which is not easy to be eavesdropped or tampered with, ensuring the security and reliability of data transmission.
[0249] Alternatively, see Fig.14 , the device further comprises:
[0250] The request sending module 1305 is used to send an authentication request to the second device through the physical link, and the second device is used to return a first random number through the physical link in response to the authentication request;
[0251] The random number interaction module 1306 is used to receive the first random number returned by the second device through the physical link, and send the second random number to the second device. The second device is also used to receive the second random number and return the target encryption algorithm through the physical link. The second device is also used to process the first random number and the second random number according to the target encryption algorithm through the second security layer to obtain a session key.
[0252] The key acquisition module 1307 is used to receive the target encryption algorithm returned by the second device through a physical link; transmit the target encryption algorithm to the first security layer through the first transport layer; and process the first random number and the second random number according to the target encryption algorithm through the first security layer to obtain a session key.
[0253] Alternatively, see Fig.14 , the random number interaction module 1306 includes:
[0254] The random number interaction unit 1316 is used to receive the first random number returned by the second device through a physical link, and send a second random number and at least one encryption algorithm to the second device; the second device is also used to determine a target encryption algorithm from at least one encryption algorithm through a second security layer.
[0255] Alternatively, see Fig.14 The authentication request carries the first protocol version information of the first device, and the random number interaction unit 1316 is used to:
[0256] Receiving, via the physical link, a first random number and second protocol version information returned by the second device;
[0257] Passing the first random number and the second protocol version information to the first security layer through the first transport layer;
[0258] Determine, through the first security layer, at least one encryption algorithm supported by the first device and the second device according to the first protocol version information and the second protocol version information, and transmit the second random number and the at least one encryption algorithm to the first transport layer;
[0259] A second random number and at least one encryption algorithm are sent to a second device via a physical link.
[0260] Alternatively, see Fig.14 , the random number interaction module 1306 includes:
[0261] The random number receiving unit 1326 is used to receive the first random number and the first certificate returned by the second device through the physical link, where the first certificate is used to indicate the identity of the second device; and transmit the first random number and the first certificate to the first security layer through the first transport layer;
[0262] The random number sending unit 1336 is used to pass the second random number and the second certificate to the first transport layer if the first certificate is verified through the first security layer, and the second certificate is used to indicate the identity of the first device; send the second random number and the second certificate to the second device through the physical link, and the second device is used to pass the second security layer, and if the second certificate is verified through the second security layer, then return the target encryption algorithm to the first device.
[0263] It should be noted that: the data transmission device provided in the above embodiment only uses the division of the above functional modules as an example when transmitting data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the first device is divided into different functional modules to complete all or part of the functions described above. In addition, the data transmission device provided in the above embodiment belongs to the same concept as the data transmission method embodiment. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0264] Fig.15 is a structural diagram of a data transmission device provided in an embodiment of the present application. Fig.15 , the device comprises:
[0265] The data receiving module 1501 is used to receive the second data sent by the first device through a physical link between the first transmission layer of the first device and the second transmission layer of the second device. A physical link is established between the first transmission layer and the second transmission layer. The physical link refers to a communication link established through a physical transmission medium. The physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus USB link. The second data is transmitted to the first transmission layer by the first security layer of the first device. The first security layer is used to encrypt the first data using a session key to obtain the second data;
[0266] The data transmission module 1502 is used to transmit the second data to the second security layer of the second device through the second transmission layer;
[0267] A key determination module 1503, configured to determine a session key between the second device and the first device through a second security layer;
[0268] The decryption module 1504 is used to decrypt the second data by using the session key through the second security layer to obtain the first data.
[0269] The apparatus provided in the embodiment of the present application can establish a physical link between two devices, and the two devices hold a session key. When either device wants to transmit data, it first uses the session key to encrypt the data, and then transmits the encrypted data through the physical link, and the other device uses the session key to decrypt the encrypted data. The data transmitted in the physical link is encrypted data, which is not easy to be eavesdropped or tampered with, ensuring the security and reliability of data transmission.
[0270] Alternatively, see Fig.16 , the device further comprises:
[0271] The data transmission module 1502 is further configured to transmit the first data to the second service layer of the second device through the second security layer;
[0272] The data processing module 1505 is used to process the first data through the second business layer.
[0273] Alternatively, see Fig.16 , the device further comprises:
[0274] The random number sending module 1506 is used to send a first random number to the first device through a physical link in response to the authentication request sent by the first device, and the first device is used to return a second random number;
[0275] The encryption algorithm sending module 1507 is used to receive the second random number returned by the first device through the physical link, and send the target encryption algorithm to the first device. The first device is also used to process the first random number and the second random number according to the target encryption algorithm through the first security layer to obtain a session key;
[0276] The key acquisition module 1508 is used to process the first random number and the second random number through the second security layer according to the target encryption algorithm to obtain the session key.
[0277] Alternatively, see Fig.16 , the encryption algorithm sending module 1507 includes:
[0278] The first random number receiving unit 1517 is used to receive the second random number and at least one encryption algorithm returned by the first device through the physical link; and transmit the second random number and at least one encryption algorithm to the second security layer through the second transport layer;
[0279] The encryption algorithm determination unit 1527 is used to determine a target encryption algorithm from at least one encryption algorithm through the second security layer, and transmit the target encryption algorithm to the second transport layer;
[0280] The encryption algorithm sending unit 1537 is used to send the target encryption algorithm to the first device through the physical link.
[0281] Alternatively, see Fig.16 , the authentication request carries the first protocol version information of the first device, and the random number sending module 1506 includes:
[0282] The first random number sending unit 1516 is used to send the first random number and the second protocol version information of the second device to the first device through a physical link in response to the authentication request sent by the first device, and the first device is used to determine at least one encryption algorithm supported by the first device and the second device according to the first protocol version information and the second protocol version information through the first security layer.
[0283] Alternatively, see Fig.16 , the random number sending module 1506 includes:
[0284] The second random number sending unit 1526 is used to send a first random number and a first certificate to the first device through a physical link in response to the authentication request sent by the first device, where the first certificate is used to indicate the identity of the second device, and the first device is used to verify the first certificate through the first security layer, and then return a second random number and a second certificate to the second device, where the second certificate is used to indicate the identity of the first device;
[0285] The encryption algorithm sending module 1507 includes:
[0286] The second random number receiving unit 1547 is used to receive the second random number and the second certificate returned by the first device through the physical link; and transmit the second random number and the second certificate to the second security layer through the second transport layer;
[0287] The encryption algorithm sending unit 1537 is also used to pass the target encryption algorithm to the second transport layer if the second certificate is verified through the second security layer; and send the target encryption algorithm to the first device through the physical link.
[0288] It should be noted that: the data transmission device provided in the above embodiment only uses the division of the above functional modules as an example when transmitting data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the second device is divided into different functional modules to complete all or part of the functions described above. In addition, the data transmission device provided in the above embodiment belongs to the same concept as the data transmission method embodiment. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0289] Fig.17 The schematic diagram of the structure of a terminal 1700 provided by an exemplary embodiment of the present application is shown. The terminal 1700 can be used to execute the steps executed by the first device or the second device in the above data transmission method.
[0290] Typically, the terminal 1700 includes a processor 1701 and a memory 1702 .
[0291] The processor 1701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1701 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1701 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0292] The memory 1702 may include one or more computer-readable storage media, which may be non-transitory. The memory 1702 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1702 is used to store at least one program code, which is used by the processor 1701 to implement the data transmission method provided in the method embodiment of the present application.
[0293] In some embodiments, the terminal 1700 may further optionally include: a peripheral device interface 1703 and at least one peripheral device. The processor 1701, the memory 1702 and the peripheral device interface 1703 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1703 via a bus, a signal line or a circuit board. Optionally, the peripheral device includes: at least one of a radio frequency circuit 1704, a display screen 1705, a camera assembly 1706, an audio circuit 1707, a positioning assembly 1708 and a power supply 1709.
[0294] The peripheral device interface 1703 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1701 and the memory 1702. In some embodiments, the processor 1701, the memory 1702, and the peripheral device interface 1703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1701, the memory 1702, and the peripheral device interface 1703 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0295] The radio frequency circuit 1704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1704 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1704 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 1704 can communicate with other devices through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1704 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0296] The display screen 1705 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1705 is a touch display screen, the display screen 1705 also has the ability to collect touch signals on the surface or above the surface of the display screen 1705. The touch signal can be input to the processor 1701 as a control signal for processing. At this time, the display screen 1705 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1705 can be one, set on the front panel of the terminal 1700; in other embodiments, the display screen 1705 can be at least two, respectively set on different surfaces of the terminal 1700 or in a folding design; in other embodiments, the display screen 1705 can be a flexible display screen, set on a curved surface or a folding surface of the terminal 1700. Even, the display screen 1705 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1705 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0297] The camera assembly 1706 is used to capture images or videos. Optionally, the camera assembly 1706 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal 1700, and the rear camera is arranged on the back of the terminal 1700. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1706 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0298] The audio circuit 1707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1701 for processing, or input them into the radio frequency circuit 1704 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1700. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1701 or the radio frequency circuit 1704 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1707 may also include a headphone jack.
[0299] Positioning component 1708 is used to locate the current geographical location of terminal 1700 to implement navigation or LBS (Location Based Service). Positioning component 1708 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0300] The power supply 1709 is used to power various components in the terminal 1700. The power supply 1709 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1709 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0301] In some embodiments, the terminal 1700 further includes one or more sensors 1710 , including but not limited to: an acceleration sensor 1711 , a gyroscope sensor 1712 , a pressure sensor 1713 , a fingerprint sensor 1714 , an optical sensor 1715 , and a proximity sensor 1716 .
[0302] The acceleration sensor 1711 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 1700. For example, the acceleration sensor 1711 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1701 can control the display screen 1705 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1711. The acceleration sensor 1711 can also be used for collecting game or user motion data.
[0303] The gyro sensor 1712 can detect the body direction and rotation angle of the terminal 1700, and the gyro sensor 1712 can cooperate with the acceleration sensor 1711 to collect the user's 3D actions on the terminal 1700. The processor 1701 can implement the following functions based on the data collected by the gyro sensor 1712: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0304] The pressure sensor 1713 can be set on the side frame of the terminal 1700 and / or the lower layer of the display screen 1705. When the pressure sensor 1713 is set on the side frame of the terminal 1700, the user's holding signal of the terminal 1700 can be detected, and the processor 1701 performs left and right hand recognition or shortcut operations according to the holding signal collected by the pressure sensor 1713. When the pressure sensor 1713 is set on the lower layer of the display screen 1705, the processor 1701 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 1705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0305] The fingerprint sensor 1714 is used to collect the user's fingerprint, and the processor 1701 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 1714, or the fingerprint sensor 1714 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 1701 authorizes the user to have relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 1714 can be set on the front, back, or side of the terminal 1700. When a physical button or a manufacturer logo is set on the terminal 1700, the fingerprint sensor 1714 can be integrated with the physical button or the manufacturer logo.
[0306] The optical sensor 1715 is used to collect the ambient light intensity. In one embodiment, the processor 1701 can control the display brightness of the display screen 1705 according to the ambient light intensity collected by the optical sensor 1715. Optionally, when the ambient light intensity is high, the display brightness of the display screen 1705 is increased; when the ambient light intensity is low, the display brightness of the display screen 1705 is decreased. In another embodiment, the processor 1701 can also dynamically adjust the shooting parameters of the camera assembly 1706 according to the ambient light intensity collected by the optical sensor 1715.
[0307] The proximity sensor 1716, also called a distance sensor, is usually arranged on the front panel of the terminal 1700. The proximity sensor 1716 is used to collect the distance between the user and the front of the terminal 1700. In one embodiment, when the proximity sensor 1716 detects that the distance between the user and the front of the terminal 1700 is gradually decreasing, the processor 1701 controls the display screen 1705 to switch from the screen-on state to the screen-off state; when the proximity sensor 1716 detects that the distance between the user and the front of the terminal 1700 is gradually increasing, the processor 1701 controls the display screen 1705 to switch from the screen-off state to the screen-on state.
[0308] Those skilled in the art will understand that Fig.17 The structure shown in the figure does not constitute a limitation on the terminal 1700, and the terminal 1700 may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.
[0309] Fig.18 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1800 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1801 and one or more memories 1802, wherein the memory 1802 stores at least one program code, and the at least one program code is loaded and executed by the processor 1801 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.
[0310] The server 1800 can be used to execute the steps performed by the first device or the second device in the above data transmission method.
[0311] An embodiment of the present application further provides a computer device, which includes a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the data transmission method of the above embodiment.
[0312] An embodiment of the present application further provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the data transmission method of the above embodiment.
[0313] An embodiment of the present application also provides a computer program product or a computer program, which includes a computer program code. The computer program code is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the data transmission method as described in the above embodiment.
[0314] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0315] The above description is only an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: The method comprises: Passing first data to a first security layer of the first device through a first service layer of the first device; Determine a session key between the first device and the second device through the first security layer, a physical link is established between the first transport layer of the first device and the second transport layer of the second device, the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus USB link; Encrypting the first data by using the session key through the first security layer to obtain second data, and transmitting the second data to the first transport layer; The second data is sent to the second transport layer through the physical link, and the second device is used to transfer the second data to the second security layer of the second device through the second transport layer, and the second data is decrypted using the session key through the second security layer to obtain the first data.
2. The method according to claim 1, characterized in that Before determining the session key between the first device and the second device through the first security layer, the method further includes: sending an authentication request to the second device through the physical link, wherein the second device is configured to return a first random number through the physical link in response to the authentication request; receiving, through the physical link, the first random number returned by the second device, and sending a second random number to the second device, the second device being further configured to receive the second random number and return a target encryption algorithm through the physical link, and the second device being further configured to process the first random number and the second random number according to the target encryption algorithm through the second security layer to obtain the session key; Receiving, via the physical link, the target encryption algorithm returned by the second device; Passing the target encryption algorithm to the first security layer through the first transport layer; The first random number and the second random number are processed through the first security layer according to the target encryption algorithm to obtain the session key.
3. The method according to claim 2, characterized in that The receiving, through the physical link, the first random number returned by the second device, and sending a second random number to the second device comprises: The first random number returned by the second device is received through the physical link, and the second random number and at least one encryption algorithm are sent to the second device; the second device is also used to determine the target encryption algorithm from the at least one encryption algorithm through the second security layer.
4. The method according to claim 3, characterized in that The authentication request carries the first protocol version information of the first device, the receiving, through the physical link, the first random number returned by the second device, and the sending the second random number and at least one encryption algorithm to the second device, comprises: receiving, through the physical link, the first random number and the second protocol version information returned by the second device; Passing the first random number and the second protocol version information to the first security layer through the first transport layer; Determine, through the first security layer, at least one encryption algorithm supported by the first device and the second device according to the first protocol version information and the second protocol version information, and pass the second random number and the at least one encryption algorithm to the first transport layer; The second random number and the at least one encryption algorithm are sent to the second device through the physical link.
5. The method according to claim 2, characterized in that: The receiving, through the physical link, the first random number returned by the second device, and sending a second random number to the second device comprises: receiving, through the physical link, the first random number and the first certificate returned by the second device, where the first certificate is used to indicate the identity of the second device; Passing the first random number and the first certificate to the first security layer through the first transport layer; If the first certificate is verified successfully through the first security layer, the second random number and the second certificate are transmitted to the first transport layer, where the second certificate is used to indicate the identity of the first device; The second random number and the second certificate are sent to the second device through the physical link. The second device is used to pass the second security layer and verify the second certificate, and then return the target encryption algorithm to the first device.
6. A data transmission method, characterized in that: The method comprises: receiving second data sent by the first device through a physical link between a first transport layer of the first device and a second transport layer of the second device, wherein a physical link is established between the first transport layer and the second transport layer, wherein the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link, wherein the second data is transmitted to the first transport layer by a first security layer of the first device, and the first security layer is used to encrypt the first data using a session key to obtain the second data; delivering the second data to a second security layer of the second device through the second transport layer; determining, by the second security layer, the session key between the second device and the first device; The second data is decrypted using the session key through the second security layer to obtain the first data.
7. The method according to claim 6, characterized in that After decrypting the second data by the second security layer using the session key to obtain the first data, the method further includes: delivering the first data to a second service layer of the second device through the second security layer; The first data is processed through the second business layer.
8. The method according to claim 6, characterized in that Before determining the session key between the second device and the first device through the second security layer, the method further includes: In response to the authentication request sent by the first device, sending a first random number to the first device through the physical link, and the first device is used to return a second random number; receiving, through the physical link, the second random number returned by the first device, and sending a target encryption algorithm to the first device, wherein the first device is further configured to process the first random number and the second random number through the first security layer according to the target encryption algorithm to obtain the session key; The first random number and the second random number are processed through the second security layer according to the target encryption algorithm to obtain the session key.
9. The method according to claim 8, characterized in that The receiving, through the physical link, the second random number returned by the first device, and sending a target encryption algorithm to the first device includes: receiving, through the physical link, the second random number and at least one encryption algorithm returned by the first device; passing the second random number and the at least one encryption algorithm to the second security layer through the second transport layer; Determining a target encryption algorithm from the at least one encryption algorithm through the second security layer, and transmitting the target encryption algorithm to the second transport layer; The target encryption algorithm is sent to the first device via the physical link.
10. The method according to claim 8, characterized in that The authentication request carries first protocol version information of the first device, and the sending of a first random number to the first device through the physical link in response to the authentication request sent by the first device includes: In response to the authentication request sent by the first device, the first random number and the second protocol version information of the second device are sent to the first device through the physical link, and the first device is used to determine at least one encryption algorithm supported by the first device and the second device according to the first protocol version information and the second protocol version information through the first security layer.
11. The method according to claim 8, characterized in that The step of sending a first random number to the first device through the physical link in response to the authentication request sent by the first device includes: In response to the authentication request sent by the first device, sending the first random number and the first certificate to the first device through the physical link, where the first certificate is used to indicate the identity of the second device, and the first device is used to pass the first security layer and verify the first certificate, and then return the second random number and the second certificate to the second device, where the second certificate is used to indicate the identity of the first device; The receiving, through the physical link, the second random number returned by the first device, and sending a target encryption algorithm to the first device includes: Receiving, through the physical link, the second random number and the second certificate returned by the first device; passing the second random number and the second certificate to the second security layer through the second transport layer; If the second certificate is verified through the second security layer, the target encryption algorithm is passed to the second transport layer; The target encryption algorithm is sent to the first device via the physical link.
12. A data transmission device, characterized in that: The device comprises: A data transmission module, configured to transmit first data to a first security layer of the first device through a first service layer of the first device; a key determination module, configured to determine a session key between the first device and the second device, wherein a physical link is established between a first transport layer of the first device and a second transport layer of the second device, wherein the physical link refers to a communication link established through a physical transmission medium, and the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link; an encryption module, configured to encrypt the first data by using the session key through the first security layer to obtain second data, and transmit the second data to the first transport layer; The data sending module is used to send the second data to the second transmission layer through the physical link. The second device is used to transfer the second data to the second security layer of the second device through the second transmission layer. The second data is decrypted using the session key through the second security layer to obtain the first data.
13. A data transmission device, characterized in that: The device comprises: a data receiving module, configured to receive second data sent by the first device through a physical link between a first transmission layer of the first device and a second transmission layer of the second device, wherein a physical link is established between the first transmission layer and the second transmission layer, wherein the physical link refers to a communication link established through a physical transmission medium, wherein the physical link includes at least one of a Bluetooth link, a serial port link, a network cable link, or a universal serial bus (USB) link, wherein the second data is transmitted to the first transmission layer by a first security layer of the first device, and wherein the first security layer is configured to encrypt the first data using a session key to obtain the second data; a data transmission module, configured to transmit the second data to the second security layer of the second device through the second transmission layer; a key determination module, configured to determine the session key between the second device and the first device through the second security layer; A decryption module is used to decrypt the second data using the session key through the second security layer to obtain the first data.
14. A device, characterized in that The device includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the data transmission method as described in any one of claims 1 to 5, or to implement the data transmission method as described in any one of claims 6 to 11.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the data transmission method as described in any one of claims 1 to 5, or to implement the data transmission method as described in any one of claims 6 to 11.
Citation Information
Patent Citations
Access cloud architecture oriented physical layer security confidentiality keeping device and access cloud architecture oriented physical layer security confidentiality keeping method
CN108419235A
Data transmission method and device and storage medium
CN110266480A
Method, system, terminal equipment and access network apparatus for generating key information
WO2013166908A1
