CN115396226A - Data transmission method, device and storage medium - Google Patents

Data transmission method, device and storage medium Download PDF

Info

Publication number
CN115396226A
CN115396226A CN202211057072.0A CN202211057072A CN115396226A CN 115396226 A CN115396226 A CN 115396226A CN 202211057072 A CN202211057072 A CN 202211057072A CN 115396226 A CN115396226 A CN 115396226A
Authority
CN
China
Prior art keywords
encryption mode
server
terminal
encryption
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211057072.0A
Other languages
Chinese (zh)
Inventor
刘刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Eswin Computing Technology Co Ltd
Haining Eswin IC Design Co Ltd
Original Assignee
Beijing Eswin Computing Technology Co Ltd
Haining Eswin IC Design Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Eswin Computing Technology Co Ltd, Haining Eswin IC Design Co Ltd filed Critical Beijing Eswin Computing Technology Co Ltd
Priority to CN202211057072.0A priority Critical patent/CN115396226A/en
Publication of CN115396226A publication Critical patent/CN115396226A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a data transmission method, a data transmission device and a storage medium, and relates to the technical field of networks. And sending an acquisition instruction to the server through the terminal, and receiving an encryption mode list returned by the server, so that the terminal can obtain each encryption mode supported by the server. Then, returning encryption indication information to the server through the terminal based on the encryption mode list so as to feed back a target encryption mode selected by the terminal from the encryption mode list to the server; and the server encrypts plaintext data based on the target encryption mode to obtain encrypted data. And the terminal receives the encrypted data transmitted by the server, and the terminal can decrypt the encrypted data based on the target encryption mode to obtain plaintext data. The data transmission method can improve the compatibility of the data transmission method.

Description

Data transmission method, device and storage medium
Technical Field
The application relates to the technical field of networks, in particular to a data transmission method, a data transmission device and a storage medium.
Background
With the development of network technology, the requirement for network security is higher and higher. When data is transmitted through a network, the transmitted data is usually encrypted.
In the related art, when a sending end transmits data, a fixed encryption algorithm is used for encrypting the data to be transmitted, and then the encrypted data are transmitted. Therefore, only the receiving end configured with the fixed encryption algorithm supports receiving the data of the transmitting end, which results in poor compatibility of the data transmission method in the related art.
Disclosure of Invention
The application provides a data transmission method, a data transmission device and a storage medium, which can solve the problem of poor compatibility of the data transmission method in the related technology. The technical scheme is as follows:
in one aspect, a data transmission method is provided, where the method is applied to a terminal, and the method includes:
sending an acquisition instruction to a server, wherein the acquisition instruction is used for acquiring an encryption mode supported by the server;
receiving an encryption mode list returned by the server;
returning encryption indication information to the server based on the encryption mode list, wherein the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
receiving encrypted data transmitted by the server, wherein the encrypted data is data obtained by encrypting plaintext data by the server based on the target encryption mode;
and decrypting the encrypted data based on the target encryption mode to obtain plaintext data.
In one possible implementation, the encryption mode list includes at least a mode identification of at least one encryption mode supported by the server;
the returning of the encryption indication information to the server based on the encryption mode list comprises:
selecting a target encryption mode matched with the transmission configuration information from the encryption mode list based on the transmission configuration information of the terminal, wherein the transmission configuration information at least comprises a mode identification of at least one encryption mode supported by the terminal;
and returning encryption indication information to the server based on the target encryption mode.
In a possible implementation manner, the encryption mode list further includes attribute information of each encryption mode supported by the server in at least one dimension; the transmission configuration information further comprises at least one transmission condition for measuring the data transmission performance;
the selecting, from the encryption mode list, a target encryption mode matching the transmission configuration information based on the transmission configuration information of the terminal includes:
and screening out a target encryption mode with the attribute information meeting the corresponding transmission condition from the encryption mode list based on the at least one transmission condition and the attribute information of each encryption mode in at least one dimension.
In one possible implementation, the method further includes:
when response information returned by the server based on the encryption indication information is received, analyzing the response information to obtain key zone bit information;
if the key zone bit information indicates that a key is sent to a server, sending a data transmission request carrying a target key corresponding to the target encryption mode to the server, wherein the data transmission request is used for requesting to transmit data encrypted based on the target key mode;
the decrypting the encrypted data based on the target encryption mode to obtain plaintext data includes:
and decrypting the encrypted data based on the target key corresponding to the target encryption mode to obtain plaintext data.
In another aspect, a data transmission method is provided, where the method is applied to a server, and the method includes:
receiving an acquisition instruction sent by a terminal, wherein the acquisition instruction is used for acquiring an encryption mode supported by a server;
sending an encryption mode list to the terminal based on the acquisition instruction;
receiving encryption indication information returned by the terminal based on the encryption mode list, wherein the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
and encrypting plaintext data based on the target encryption mode to obtain encrypted data, and sending the encrypted data to the terminal.
In one possible implementation, the encryption mode list includes a mode identification of at least one encryption mode supported by the server; alternatively, the first and second electrodes may be,
the encryption mode list comprises mode identification of at least one encryption mode supported by the server and attribute information of each encryption mode in at least one dimension.
In one possible implementation manner, the encrypting plaintext data based on the target encryption mode to obtain encrypted data includes:
when encryption indication information sent by the terminal is received, response information is returned to the terminal, and the response information carries key zone bit information used for indicating whether a key is returned to a server or not;
if the key zone bit information indicates to send a key to a server, analyzing a data transmission request returned by the terminal based on the response information to obtain a target key;
and encrypting the plaintext data based on the target encryption mode and the target key to obtain the encrypted data.
In another aspect, a data transmission apparatus is provided, where the apparatus is applied to a terminal, and the apparatus includes:
the system comprises an acquisition instruction sending module, an acquisition instruction receiving module and an encryption module, wherein the acquisition instruction sending module is used for sending an acquisition instruction to a server, and the acquisition instruction is used for acquiring an encryption mode supported by the server;
the list receiving module is used for receiving the encryption mode list returned by the server;
an indication information sending module, configured to return encryption indication information to the server based on the encryption mode list, where the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
the encrypted data receiving module is used for receiving encrypted data transmitted by the server, wherein the encrypted data is data obtained by encrypting plaintext data by the server based on the target encryption mode;
and the decryption module is used for decrypting the encrypted data based on the target encryption mode to obtain plaintext data.
In one possible implementation, the encryption mode list includes at least a mode identification of at least one encryption mode supported by the server;
the indication information sending module is configured to:
selecting a target encryption mode matched with the transmission configuration information from the encryption mode list based on the transmission configuration information of the terminal, wherein the transmission configuration information at least comprises a mode identification of at least one encryption mode supported by the terminal;
and returning encryption indication information to the server based on the target encryption mode.
In a possible implementation manner, the encryption mode list further includes attribute information of each encryption mode supported by the server in at least one dimension; the transmission configuration information further comprises at least one transmission condition for measuring data transmission performance;
the indication information sending module is specifically configured to screen out, from the encryption mode list, a target encryption mode whose attribute information meets the corresponding transmission condition based on the at least one transmission condition and attribute information of each encryption mode in at least one dimension.
In one possible implementation, the apparatus further includes:
the analysis module is used for analyzing the response information to obtain key zone bit information when receiving the response information returned by the server based on the encryption indication information;
a transmission request sending module, configured to send, to a server, a data transmission request carrying a target key corresponding to the target encryption mode if the key flag bit information indicates to send the key to the server, where the data transmission request is used to request transmission of data encrypted based on the target key mode;
and the decryption module is used for decrypting the encrypted data based on the target key corresponding to the target encryption mode to obtain plaintext data.
In another aspect, a data transmission apparatus is provided, where the apparatus is applied to a server, and the apparatus includes:
the instruction receiving module is used for receiving an acquisition instruction sent by a terminal, wherein the acquisition instruction is used for acquiring an encryption mode supported by a server;
the list sending module is used for sending an encryption mode list to the terminal based on the acquisition instruction;
an indication information receiving module, configured to receive encryption indication information returned by the terminal based on the encryption mode list, where the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
and the encryption module is used for encrypting plaintext data based on the target encryption mode to obtain encrypted data and sending the encrypted data to the terminal.
In one possible implementation, the encryption mode list includes a mode identification of at least one encryption mode supported by the server; alternatively, the first and second electrodes may be,
the encryption mode list comprises mode identification of at least one encryption mode supported by the server and attribute information of each encryption mode in at least one dimension.
In one possible implementation, the encryption module is configured to:
when encryption indication information sent by the terminal is received, response information is returned to the terminal, and the response information carries key zone bit information used for indicating whether a key is returned to a server or not;
if the key flag bit information indicates to send a key to a server, analyzing a data transmission request returned by the terminal based on the response information to obtain a target key;
and encrypting the plaintext data based on the target encryption mode and the target key to obtain the encrypted data.
In another aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the data transmission method.
In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the above-mentioned data transmission method.
In another aspect, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the data transmission method described above.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
according to the data transmission method, the terminal sends the acquisition instruction to the server and receives the encryption mode list returned by the server, so that the terminal can obtain each encryption mode supported by the server. Then, returning encryption indication information to the server through the terminal based on the encryption mode list so as to feed back a target encryption mode selected by the terminal from the encryption mode list to the server; and the terminal receives the encrypted data transmitted by the server, and decrypts the encrypted data based on the target encryption mode to obtain plaintext data. Because the terminal and the server are adapted to the target encryption mode compatible with both the terminal and the server through the interaction of the data such as the acquisition instruction, the encryption mode list, the encryption indication information and the like, the terminal can decrypt the data transmitted by the server according to the existing or self-supported encryption mode.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart illustrating a method for implementing data transmission according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a system architecture in a data transmission method according to an embodiment of the present application;
fig. 4 is a schematic interaction flow diagram of a data transmission method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application.
It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises" and "comprising" as used in embodiments of the present application mean that the respective features can be implemented as presented features, information, data, steps, operations, but do not exclude other features, information, data, steps, operations, etc., as supported by the technical field.
Fig. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present application. The execution subject of the method may be a terminal. As shown in fig. 1, the method comprises the following steps 101-105.
Step 101, the terminal sends an acquisition instruction to the server.
Wherein, the obtaining instruction is used for obtaining the encryption mode supported by the server.
In the present application, data transmission may be performed between the server and the terminal, for example, the server transmits data such as a video stream and an audio stream to the terminal. The data transmission method can realize data transmission in the encryption mode supported by dynamic adaptation between the server and the terminal.
Illustratively, an encryption mode may be an encryption algorithm, an encryption process, or an encryption scheme including a plurality of encryption algorithms. If the encryption mode is an encryption process or an encryption mode including a plurality of encryption algorithms, at least one encryption mode may be negotiated in advance between the server and the terminal.
And 102, the terminal receives the encryption mode list returned by the server.
In a possible example, the encryption mode list comprises at least a mode identification of at least one encryption mode supported by the server. The mode ID may be an algorithm ID or a mode ID of an encryption mode negotiated in advance by the server and the terminal.
In yet another possible example, the encryption mode list further includes attribute information of each encryption mode supported by the server in at least one dimension. The at least one dimension may include, but is not limited to: encryption efficiency, security, corresponding default device system, etc. The attribute information of the at least one dimension may include, but is not limited to: the encryption efficiency and the safety factor of each encryption mode supported by the server, and the corresponding default equipment system are iOS or Windows and the like.
And 103, the terminal returns encryption indication information to the server based on the encryption mode list.
Wherein the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list. In this step, the encryption indication information may carry a mode identifier of a target encryption mode, and the terminal may select a target encryption mode supported by the terminal from the encryption mode list and return the encryption indication information to the server based on the mode identifier of the target encryption mode.
In one possible implementation, the encryption mode list includes at least a mode identification of at least one encryption mode supported by the server; the terminal may also select a supported encryption mode based on the transmission configuration information. Illustratively, this step 103 may include the following steps 1031-1032.
Step 1031, the terminal selects a target encryption mode matching the transmission configuration information from the encryption mode list based on the transmission configuration information of the terminal.
Wherein the transmission configuration information at least comprises a mode identification of at least one encryption mode supported by the terminal. For example, the user may pre-configure each encryption mode ID supported by the terminal. For each mode identifier included in the transmission configuration information, the terminal may traverse through whether the mode identifier in the transmission configuration information is included in the encryption mode list, and if so, take the encryption mode corresponding to the mode identifier as the target encryption mode.
Step 1032, the terminal returns the encryption indication information to the server based on the target encryption mode.
Illustratively, the terminal may generate the encryption indication information according to the mode identifier of the target encryption mode.
In yet another possible implementation manner, the encryption mode list further includes attribute information of each encryption mode supported by the server in at least one dimension; the transmission configuration information further comprises at least one transmission condition for measuring the data transmission performance; illustratively, this step 1031 may include the following step a:
and step A, the terminal screens out a target encryption mode with the attribute information meeting the corresponding transmission condition from the encryption mode list based on the at least one transmission condition and the attribute information of each encryption mode in at least one dimension.
The user can also configure the transmission condition in the transmission configuration information in advance, and the terminal can also screen the target encryption mode meeting the condition from the encryption mode list based on the attribute information of the encryption mode and the matching condition between the transmission conditions.
For example, the transmission configuration information may include transmission conditions for measuring data transmission performance in at least one dimension, which may include, but is not limited to: encryption efficiency, security, corresponding default device system. For example, the transmission conditions included in the transmission configuration information include, but are not limited to: the safety factor is not lower than a first threshold value, the encryption efficiency is not lower than a second threshold value, and the corresponding default equipment system is a designated system.
Illustratively, if the transmission conditions include a security factor not lower than a first threshold and an encryption efficiency not lower than a second threshold. The logic for the terminal to filter the target encryption mode may comprise: screening out a first encryption mode with the attribute value of the security dimension not lower than a first threshold value from the encryption mode list according to the first threshold value in the transmission configuration information; screening out a second encryption mode with the attribute value of the encryption efficiency dimension not lower than a second threshold value from the encryption mode list according to the second threshold value in the transmission configuration information; and comparing and finding out an overlapped encryption mode in the first encryption mode and the second encryption mode, namely, the encryption mode which meets the condition that the safety factor is not lower than the first threshold value and the encryption efficiency is not lower than the second threshold value, and taking the overlapped encryption mode as a target encryption mode.
And 104, the terminal receives the encrypted data transmitted by the server.
And the encrypted data is data obtained by encrypting plaintext data by the server based on the target encryption mode.
In a possible implementation manner, after the terminal performs step 103, the terminal may further determine whether to return the target key to the server based on the response information of the server. If the terminal transmits the target key to the server, the encrypted data is data obtained by encrypting based on the target encryption mode and the target key. Illustratively, before step 104, the terminal may further perform the following steps S1-S2:
and S1, when response information returned by the server based on the encryption indication information is received, the terminal analyzes the response information to obtain key zone bit information.
The key flag bit information is used to indicate whether to send the key to the server.
When the server receives the encryption indication information of the terminal, the server may return response information. The response information includes key flag bit information, for example, the response information may be a response message, and if the flag bit of the response message takes a value of 1, it indicates that the key is sent to the server; and if the flag bit value of the response message is 0, the key is not sent to the server.
And S2, if the key zone bit information indicates to send the key to the server, the terminal sends a data transmission request carrying a target key corresponding to the target encryption mode to the server.
And the data transmission request is used for requesting to transmit the data encrypted based on the target key mode. The terminal may generate the data transmission request based on a target key.
And if the key zone bit information indicates that the key is not sent to the server, the terminal sends a data transmission request without the key to the server.
And 105, the terminal decrypts the encrypted data based on the target encryption mode to obtain plaintext data.
In one possible implementation manner, if the terminal sends the target key by the server by performing steps S1-S2, in step 105, the terminal may decrypt the encrypted data based on the target key corresponding to the target encryption mode to obtain plaintext data.
For example, the target key may be a key corresponding to a symmetric encryption algorithm or an asymmetric encryption algorithm, and if the target encryption mode includes a symmetric encryption algorithm, the target key may be either an encryption key or a decryption key. If the target encryption mode comprises an asymmetric encryption algorithm, the terminal returns a data transmission request carrying a first target key to the server, wherein the first target key can be an encryption key; the terminal may decrypt the encrypted data using a second target key, where the second target key may be a decryption key corresponding to the encryption key.
According to the data transmission method, the terminal sends the acquisition instruction to the server and receives the encryption mode list returned by the server, so that the terminal can obtain each encryption mode supported by the server. Then, returning encryption indication information to the server through the terminal based on the encryption mode list so as to feed back a target encryption mode selected by the terminal from the encryption mode list to the server; and the terminal receives the encrypted data transmitted by the server, and decrypts the encrypted data based on the target encryption mode to obtain plaintext data. Because the terminal and the server are adapted to the target encryption mode compatible with both the terminal and the server through the interaction of the data such as the acquisition instruction, the encryption mode list, the encryption indication information and the like, the terminal can decrypt the data transmitted by the server according to the existing or self-supported encryption mode.
Fig. 2 is a schematic flowchart of a data transmission method according to an embodiment of the present application. The execution subject of the method may be a server. As shown in fig. 2, the method comprises the following steps 201-205.
Step 201, the server receives an acquisition instruction sent by the terminal, where the acquisition instruction is used to acquire an encryption mode supported by the server.
Step 202, the server sends the encryption mode list to the terminal based on the acquisition instruction.
In a possible example, the encryption mode list comprises a mode identification of at least one encryption mode supported by the server. In yet another possible example, the encryption mode list includes a mode identification of at least one encryption mode supported by the server and attribute information of each encryption mode in at least one dimension.
Step 203, the server receives the encryption indication information returned by the terminal based on the encryption mode list.
The encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list. In this step, the server may analyze the encryption indication information to obtain a mode ID of the target encryption mode.
And step 204, encrypting the plaintext data by the server based on the target encryption mode to obtain encrypted data.
The server can encrypt the plaintext data to be transmitted by using an encryption algorithm, an encryption flow, an encryption mode and the like corresponding to the target encryption mode to obtain encrypted data.
In a possible implementation manner, after the server performs step 203, response information may also be returned to the terminal based on the encryption indication information. Accordingly, this step 204 may include the following steps 2041-2043.
Step 2041, when receiving the encryption instruction information sent by the terminal, the server returns response information to the terminal.
And the response information carries key flag bit information used for indicating whether to return the key to the server or not. The key flag bit information is used for indicating whether to send the key to the server.
For example, if the terminal and the server negotiate a key corresponding to the target encryption mode in advance, or the server stores a key corresponding to the target encryption mode negotiated in advance, the key flag bit information may indicate that the terminal does not send the key to the server. If the server does not store the key corresponding to the target encryption mode, or the server does not store the acquisition mode of the key corresponding to the target encryption mode, the key flag bit information can instruct the terminal to send the key to the server.
Step 2042, if the key flag bit information indicates to send a key to the server, the server analyzes the data transmission request returned by the terminal based on the response information to obtain a target key.
Step 2043, the server encrypts the plaintext data based on the target encryption mode and the target key to obtain the encrypted data.
If the key flag bit information indicates that the key is not sent to the server, the server can encrypt plaintext data based on the target encryption mode to obtain encrypted data.
Step 205, the server sends the encrypted data to the terminal.
In a possible scenario, in the data transmission process between the terminal and the server in the manner of the present application, the server and the terminal may quit transmission according to respective policies, for example, if the user triggers the terminal to quit the operation of watching a video, the terminal quits transmission. For another example, if a video file to be transmitted in the server is currently deleted, the server may currently quit transmission.
It should be noted that, in some possible application scenarios, the server may be a background server of the application program. The terminal is provided with an application program, and data interaction can be carried out between the terminal and the server based on the application program. Illustratively, as shown in fig. 3, the system architecture diagram includes a terminal and a server, and the server is compatible with a plurality of encryption methods and stores data to be transmitted. The terminal can also support one or more decryption methods, and any connection mode such as hardware connection, wired connection, wireless connection and the like is established between the terminal and the server. The terminal and the server can be configured with adaptation modules, and the server and the terminal can respectively perform data transmission based on the respective adaptation modules to realize dynamically adapting the encryption modes supported by the two. For example, the terminal may support a decryption mode including an AES decryption algorithm, an RSA decryption algorithm, etc., and the server may support an encryption mode including an AES encryption algorithm, an RSA encryption algorithm, etc. After the terminal and the server confirm the target encryption mode adopted by the current transmission based on the adaptation module, the server encrypts a Resource file (Resource) to be transmitted by adopting an encryption algorithm corresponding to the target encryption mode and transmits the Resource file to the terminal. And the terminal decrypts the encrypted resource file through a decryption algorithm corresponding to the target encryption mode so as to restore the original resource file.
It should be noted that, in the present application, a server may be an independent physical server, or a server cluster or distributed system formed by a plurality of physical servers, or a cloud server or a server cluster that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, and big data and artificial intelligence platforms. In this application, the terminal may be a smart phone, a tablet computer, a notebook computer, a digital broadcast receiver, a desktop computer, a vehicle-mounted terminal (for example, a vehicle-mounted navigation terminal, a vehicle-mounted computer, etc.), a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and may also be determined based on the requirements of the actual application scenario, which is not limited herein.
The data transmission flow of the present application will be described with reference to the interaction flow shown in fig. 4. As shown in fig. 4, the process of interacting between the server and the terminal to transmit data is as follows:
1. the server is in a waiting connection state, the terminal initiates connection in a connection mode such as hardware, wired, wireless and the like, and a data interaction channel is established between the server and the terminal.
2. The terminal applies for the encryption mode list to the server through the acquisition instruction, and the server returns the encryption mode list supported by the server to the terminal.
3. The terminal selects one encryption mode according to the self encryption characteristic and confirms the encryption mode to the server. For example, the terminal returns encryption indication information to the server to inform the server of the ID of the target encryption mode supported.
4. And after the terminal confirms the target encryption mode, the terminal applies for encrypted data to the server, and the server encrypts and transmits the data to be transmitted through the target encryption mode.
5. And after receiving the encrypted data, the terminal decrypts the encrypted data and processes the corresponding data.
6. Both the terminal and the server can quit transmission according to respective strategies.
According to the data transmission method, the terminal can obtain each encryption mode supported by the server through the encryption mode list returned to the terminal when the server receives the acquisition instruction of the terminal. Then, receiving secret instruction information returned by the terminal based on the encryption mode list through the server, so that the server can obtain a target encryption mode selected by the terminal; and, the server encrypts data according to the target encryption mode and transmits the encrypted data to the terminal. And the terminal decrypts the encrypted data based on the target encryption mode to obtain plaintext data. Because the terminal and the server are adapted to the target encryption mode compatible with both the terminal and the server through the interaction of the data such as the acquisition instruction, the encryption mode list, the encryption indication information and the like, the terminal can decrypt the data transmitted by the server according to the existing or self-supported encryption mode.
Fig. 5 is a schematic structural diagram of a data transmission device according to an embodiment of the present application. The apparatus is applied to a terminal, and as shown in fig. 5, the apparatus includes:
an obtaining instruction sending module 501, configured to send an obtaining instruction to a server, where the obtaining instruction is used to obtain an encryption mode supported by the server;
a list receiving module 502, configured to receive an encryption mode list returned by the server;
an indication information sending module 503, configured to return encryption indication information to the server based on the encryption mode list, where the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
an encrypted data receiving module 504, configured to receive encrypted data transmitted by the server, where the encrypted data is data obtained by encrypting plaintext data by the server based on the target encryption mode;
and a decryption module 505, configured to decrypt the encrypted data based on the target encryption mode to obtain plaintext data.
In one possible implementation, the encryption mode list includes at least a mode identification of at least one encryption mode supported by the server;
the indication information sending module 503 is configured to:
selecting a target encryption mode matched with the transmission configuration information from the encryption mode list based on the transmission configuration information of the terminal, wherein the transmission configuration information at least comprises a mode identification of at least one encryption mode supported by the terminal;
and returning encryption indication information to the server based on the target encryption mode.
In a possible implementation manner, the encryption mode list further includes attribute information of each encryption mode supported by the server in at least one dimension; the transmission configuration information further comprises at least one transmission condition for measuring the data transmission performance;
the indication information sending module 503 is specifically configured to screen out, from the encryption mode list, a target encryption mode whose attribute information meets the corresponding transmission condition based on the at least one transmission condition and the attribute information of each encryption mode in at least one dimension.
In one possible implementation, the apparatus further includes:
the analysis module is used for analyzing the response information to obtain key zone bit information when receiving the response information returned by the server based on the encryption indication information;
a transmission request sending module, configured to send, to a server, a data transmission request carrying a target key corresponding to the target encryption mode if the key flag bit information indicates to send the key to the server, where the data transmission request is used to request transmission of data encrypted based on the target key mode;
the decryption module 505 is configured to decrypt the encrypted data based on the target key corresponding to the target encryption mode to obtain plaintext data.
According to the data transmission method, the terminal sends the acquisition instruction to the server and receives the encryption mode list returned by the server, so that the terminal can obtain each encryption mode supported by the server. Then, returning encryption indication information to the server through the terminal based on the encryption mode list so as to feed back a target encryption mode selected by the terminal from the encryption mode list to the server; and the terminal receives the encrypted data transmitted by the server, and decrypts the encrypted data based on the target encryption mode to obtain plaintext data. Because the terminal and the server are adapted to the target encryption mode compatible with both the terminal and the server through the interaction of the data such as the acquisition instruction, the encryption mode list, the encryption indication information and the like, the terminal can decrypt the data transmitted by the server according to the existing or self-supported encryption mode.
Fig. 6 is a schematic structural diagram of a data transmission device according to an embodiment of the present application. The apparatus is applied to a server, and as shown in fig. 6, the apparatus includes:
an instruction receiving module 601, configured to receive an acquisition instruction sent by a terminal, where the acquisition instruction is used to acquire an encryption mode supported by a server;
a list sending module 602, configured to send an encryption mode list to the terminal based on the obtaining instruction;
an indication information receiving module 603, configured to receive encryption indication information returned by the terminal based on the encryption mode list, where the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
the encrypting module 604 is configured to encrypt plaintext data based on the target encryption mode to obtain encrypted data, and send the encrypted data to the terminal.
In one possible implementation, the encryption mode list includes a mode identification of at least one encryption mode supported by the server; alternatively, the first and second electrodes may be,
the encryption mode list comprises mode identification of at least one encryption mode supported by the server and attribute information of each encryption mode in at least one dimension.
In one possible implementation, the encryption module 604 is configured to:
when receiving encryption indication information sent by the terminal, returning response information to the terminal, wherein the response information carries key flag bit information used for indicating whether to return a key to a server or not;
if the key zone bit information indicates to send a key to the server, analyzing a data transmission request returned by the terminal based on the response information to obtain a target key;
and encrypting the plaintext data based on the target encryption mode and the target key to obtain the encrypted data.
According to the data transmission method, the terminal can obtain each encryption mode supported by the server through the encryption mode list returned to the terminal when the server receives the acquisition instruction of the terminal. Then, receiving secret indication information returned by the terminal based on the encryption mode list through the server, so that the server can obtain a target encryption mode selected by the terminal; and, the server encrypts data according to the target encryption mode and transmits the encrypted data to the terminal. And the terminal decrypts the encrypted data based on the target encryption mode to obtain plaintext data. Because the terminal and the server are adapted to the target encryption mode compatible with both the terminal and the server through the interaction of the data such as the acquisition instruction, the encryption mode list, the encryption indication information and the like, the terminal can decrypt the data transmitted by the server according to the existing or self-supported encryption mode.
The apparatus of the embodiment of the present application may execute the method provided by the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus of the embodiments of the present application correspond to the steps in the method of the embodiments of the present application, and for the detailed functional description of the modules of the apparatus, reference may be specifically made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
Fig. 7 is a schematic structural diagram of a computer device provided in an embodiment of the present application. As shown in fig. 7, the computer apparatus includes: the memorizer, processor and computer program stored in the memorizer, the processor executes the above-mentioned computer program to realize the steps of the data transmission method, compared with the related art, can realize:
according to the data transmission method, the terminal sends the acquisition instruction to the server and receives the encryption mode list returned by the server, so that the terminal can obtain each encryption mode supported by the server. Then, returning encryption indication information to the server through the terminal based on the encryption mode list so as to feed back a target encryption mode selected by the terminal from the encryption mode list to the server; and the terminal receives the encrypted data transmitted by the server, and decrypts the encrypted data based on the target encryption mode to obtain plaintext data. Because the terminal and the server are adapted to the target encryption mode compatible with both the terminal and the server through the interaction of the data such as the acquisition instruction, the encryption mode list, the encryption indication information and the like, the terminal can decrypt the data transmitted by the server according to the existing or self-supported encryption mode.
In an alternative embodiment, a computer device is provided, as shown in FIG. 7, the computer device 700 shown in FIG. 7 comprising: a processor 701 and a memory 703. Wherein the processor 701 is coupled to the memory 703, such as via a bus 702. Optionally, the computer device 700 may further include a transceiver 704, and the transceiver 704 may be used for data interaction between the computer device and other computer devices, such as transmission of data and/or reception of data, and the like. It should be noted that the transceiver 704 is not limited to one in practical applications, and the structure of the computer device 700 is not limited to the embodiment of the present application.
The Processor 701 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein. The processor 701 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
Bus 702 may include a path that transfers information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 702 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but that does not indicate only one bus or one type of bus.
The Memory 703 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact disk Read Only Memory) or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, and is not limited herein.
The memory 703 is used for storing computer programs for executing the embodiments of the present application, and is controlled by the processor 701 to execute. The processor 701 is adapted to execute a computer program stored in the memory 703 to implement the steps shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: a server, a terminal or a cloud computing center device, etc.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments may be implemented.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises" and "comprising" as used in embodiments of the present application mean that the respective features can be implemented as presented features, information, data, steps, operations, but do not exclude other features, information, data, steps, operations, etc., as supported by the technical field.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and claims of this application and in the preceding drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than illustrated or otherwise described herein.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as needed, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The foregoing is only an optional implementation manner of a part of implementation scenarios in this application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of this application are also within the protection scope of the embodiments of this application without departing from the technical idea of this application.

Claims (10)

1. A data transmission method is applied to a terminal, and the method comprises the following steps:
sending an acquisition instruction to a server, wherein the acquisition instruction is used for acquiring an encryption mode supported by the server;
receiving an encryption mode list returned by the server;
returning encryption indication information to the server based on the encryption mode list, wherein the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
receiving encrypted data transmitted by the server, wherein the encrypted data is data obtained by encrypting plaintext data by the server based on the target encryption mode;
and decrypting the encrypted data based on the target encryption mode to obtain plaintext data.
2. The method according to claim 1, wherein the encryption mode list comprises at least a mode identification of at least one encryption mode supported by the server;
the returning of the encryption indication information to the server based on the encryption mode list comprises:
selecting a target encryption mode matched with the transmission configuration information from the encryption mode list based on the transmission configuration information of the terminal, wherein the transmission configuration information at least comprises a mode identification of at least one encryption mode supported by the terminal;
and returning encryption indication information to the server based on the target encryption mode.
3. The method of claim 2, wherein the encryption mode list further comprises attribute information of each encryption mode supported by the server in at least one dimension; the transmission configuration information further comprises at least one transmission condition for measuring the data transmission performance;
the selecting, from the encryption mode list, a target encryption mode matching the transmission configuration information based on the transmission configuration information of the terminal includes:
and screening out a target encryption mode with the attribute information meeting the corresponding transmission condition from the encryption mode list based on the at least one transmission condition and the attribute information of each encryption mode in at least one dimension.
4. The method of claim 1, further comprising:
when response information returned by the server based on the encryption indication information is received, analyzing the response information to obtain key zone bit information;
if the key flag bit information indicates that a key is sent to a server, sending a data transmission request carrying a target key corresponding to the target encryption mode to the server, wherein the data transmission request is used for requesting to transmit data encrypted based on the target key mode;
the decrypting the encrypted data based on the target encryption mode to obtain plaintext data includes:
and decrypting the encrypted data based on the target key corresponding to the target encryption mode to obtain plaintext data.
5. A data transmission method is applied to a server, and the method comprises the following steps:
receiving an acquisition instruction sent by a terminal, wherein the acquisition instruction is used for acquiring an encryption mode supported by a server;
sending an encryption mode list to the terminal based on the acquisition instruction;
receiving encryption indication information returned by the terminal based on the encryption mode list, wherein the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
and encrypting plaintext data based on the target encryption mode to obtain encrypted data, and sending the encrypted data to the terminal.
6. The method of claim 5,
the encryption mode list comprises a mode identification of at least one encryption mode supported by the server; alternatively, the first and second electrodes may be,
the encryption mode list comprises mode identification of at least one encryption mode supported by the server and attribute information of each encryption mode in at least one dimension.
7. The method of claim 5, wherein encrypting plaintext data based on the target encryption mode to obtain encrypted data comprises:
when encryption indication information sent by the terminal is received, response information is returned to the terminal, and the response information carries key flag bit information used for indicating whether a key is returned to a server or not;
if the key zone bit information indicates to send a key to a server, analyzing a data transmission request returned by the terminal based on the response information to obtain a target key;
and encrypting the plaintext data based on the target encryption mode and the target secret key to obtain the encrypted data.
8. A data transmission apparatus, wherein the apparatus is applied to a terminal, the apparatus comprising:
the system comprises an acquisition instruction sending module, an acquisition instruction receiving module and an encryption module, wherein the acquisition instruction sending module is used for sending an acquisition instruction to a server, and the acquisition instruction is used for acquiring an encryption mode supported by the server;
the list receiving module is used for receiving the encryption mode list returned by the server;
an indication information sending module, configured to return encryption indication information to the server based on the encryption mode list, where the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
the encrypted data receiving module is used for receiving encrypted data transmitted by the server, wherein the encrypted data is data obtained by encrypting plaintext data by the server based on the target encryption mode;
and the decryption module is used for decrypting the encrypted data based on the target encryption mode to obtain plaintext data.
9. A data transmission apparatus, wherein the apparatus is applied to a server, the apparatus comprising:
the instruction receiving module is used for receiving an acquisition instruction sent by a terminal, wherein the acquisition instruction is used for acquiring an encryption mode supported by a server;
the list sending module is used for sending an encryption mode list to the terminal based on the acquisition instruction;
an indication information receiving module, configured to receive encryption indication information returned by the terminal based on the encryption mode list, where the encryption indication information indicates a target encryption mode selected by the terminal from the encryption mode list;
and the encryption module is used for encrypting plaintext data based on the target encryption mode to obtain encrypted data and sending the encrypted data to the terminal.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202211057072.0A 2022-08-31 2022-08-31 Data transmission method, device and storage medium Pending CN115396226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211057072.0A CN115396226A (en) 2022-08-31 2022-08-31 Data transmission method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211057072.0A CN115396226A (en) 2022-08-31 2022-08-31 Data transmission method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115396226A true CN115396226A (en) 2022-11-25

Family

ID=84124052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211057072.0A Pending CN115396226A (en) 2022-08-31 2022-08-31 Data transmission method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115396226A (en)

Similar Documents

Publication Publication Date Title
CN106533669B (en) The methods, devices and systems of equipment identification
CN107801165B (en) Business short message pushing method and device, computer equipment and storage medium
US11303431B2 (en) Method and system for performing SSL handshake
CN104660589B (en) Method, system and terminal for encrypting control and information analysis of information
US11627205B2 (en) Information processing method and apparatus, communication device and storage medium
CN112823503B (en) Data access method, data access device and mobile terminal
CN104602238A (en) Wireless network connecting method, device and system
CN108449357B (en) Authorized login method and device, intelligent device and storage medium
CN106789008B (en) Method, device and system for decrypting sharable encrypted data
CN113472722A (en) Data transmission method, storage medium, electronic device and automatic ticket selling and checking system
CN114866964A (en) Message transmission method and device based on proximity service, electronic equipment and medium
CN108282551B (en) Message identification processing method and device, monitoring equipment and readable storage medium
CN113992427A (en) Data encryption sending method and device based on adjacent nodes
CN115396226A (en) Data transmission method, device and storage medium
US20220231837A1 (en) Intelligent and secure packet captures for cloud solutions
KR20110014264A (en) Methods and apparatus for encryption verification
CN111797417A (en) File uploading method and device, storage medium and electronic device
CN112398718A (en) Network transmission method and device, electronic equipment and storage medium
CN104994078A (en) Information sending method, information acquisition method, information sending device, information acquisition device, and information processing system in local area network
CN112866995B (en) Connection method, device, electronic equipment and storage medium
CN115189945B (en) Transaction request verification method and device, electronic equipment and readable storage medium
CN114245161B (en) Live broadcast push method and device, storage medium and electronic equipment
CN114666173B (en) Internet of things information transmission method and device based on intermediate equipment
CN113783847B (en) Message interaction method, device, computer equipment and storage medium
CN111355750B (en) Method and device for recognizing brute force password cracking behavior

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination