CN115567282A - Message transmission method, device, equipment and computer storage medium - Google Patents

Message transmission method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN115567282A
CN115567282A CN202211156403.6A CN202211156403A CN115567282A CN 115567282 A CN115567282 A CN 115567282A CN 202211156403 A CN202211156403 A CN 202211156403A CN 115567282 A CN115567282 A CN 115567282A
Authority
CN
China
Prior art keywords
key
message
encrypted
equipment
module
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
CN202211156403.6A
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211156403.6A priority Critical patent/CN115567282A/en
Publication of CN115567282A publication Critical patent/CN115567282A/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords

Landscapes

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

Abstract

The application discloses a message transmission method, a message transmission device, message transmission equipment and a computer storage medium, which are applied to first equipment. Receiving a request message sent by second equipment, wherein the request message comprises a message encrypted by a first key and a key ID of the first key, and the first key is a key obtained by negotiation between the second equipment and the first equipment; inquiring a first key corresponding to the key ID; and sending a response message encrypted by the first key to the second device under the condition that the first key corresponding to the key ID is inquired, wherein the response message is the response message of the encrypted message. According to the embodiment of the application, the key generated by negotiation is inquired through the request message, and the steps of encryption and decryption are reduced, so that the difficulty of encrypting and decrypting the message is reduced, the message encryption and decryption time is further reduced, and the service response time is reduced.

Description

Message transmission method, device, equipment and computer storage medium
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a message transmission method.
Background
In the information interaction process, in order to ensure the security of the interaction information, the transmission message needs to be encrypted.
In practical application, in order to ensure the security of transmission messages, multiple encryption modes are often combined for use, but the combined encryption method increases the encryption and decryption difficulty of project application, so that longer time is required for encryption and decryption, the service response time is prolonged, the user experience is affected, and the project implementation difficulty is increased by using the combined encryption mode.
Disclosure of Invention
The embodiment of the application provides a message transmission method, a message transmission device, message transmission equipment and a computer storage medium, which can reduce message encryption and decryption time, reduce service response time and improve user experience.
In a first aspect, an embodiment of the present application provides a message transmission method, which is applied to a first device, and the method includes:
receiving a request message sent by second equipment, wherein the request message comprises a message encrypted by a first key and a key ID of the first key, and the first key is a key obtained by negotiation between the second equipment and the first equipment;
inquiring a first key corresponding to the key ID;
and sending a response message encrypted by the first key to the second equipment under the condition that the first key corresponding to the key ID is inquired, wherein the response message is a response message of the encrypted message.
In one possible implementation, querying the first key based on the key ID includes:
and inquiring a first key corresponding to the key ID from the cache.
In one embodiment of possible implementation, after querying the first key corresponding to the key ID from the cache, the method further includes:
and under the condition that the first key corresponding to the key ID is not inquired in the cache, inquiring the first key corresponding to the key ID from the database.
In one possible implementation embodiment, before receiving the request message sent by the second device, the method further includes:
receiving an encrypted message sent by second equipment, wherein the encrypted message comprises a first secret key;
decrypting the encrypted message to obtain a first key;
generating a key ID of the first key;
storing the first key and the key ID of the first key into a cache and a database;
and sending the key ID corresponding to the first key to the second device.
In a second aspect, an embodiment of the present application provides a message transmission method, which is applied to a second device, and includes:
sending a request message to the first device, wherein the request message comprises a message encrypted by a first key and a key ID of the first key, and the request message is used for the first device to inquire the first key corresponding to the key ID;
and receiving a response message which is sent by the first equipment and encrypted by adopting the first key under the condition that the first equipment inquires the first key corresponding to the key ID, wherein the response message is the response message of the encrypted message.
In one possible implementation, before sending the request message to the first device, the method further includes:
sending an encrypted message to first equipment, wherein the encrypted message comprises a first key, and the first key is used for decrypting the encrypted message by the first equipment to obtain the first key, generating a key ID of the first key, and storing the first key and the key ID;
and receiving the key ID sent by the first device.
In one possible implementation, before sending the encrypted message to the first device, the method further includes:
generating a first key by adopting an asymmetric encryption algorithm;
and encrypting the message according to the first key to generate an encrypted message.
In a third aspect, an embodiment of the present application provides a packet transmission apparatus, which is applied to a first device, and includes:
a first receiving module, configured to receive a request message sent by a second device, where the request message includes a packet encrypted by using a first key and a key ID of the first key, and the first key is a key obtained by negotiating between the second device and the first device;
the query module is used for querying a first key corresponding to the key ID;
and the first sending module is used for sending a response message encrypted by the first key to the second equipment under the condition that the first key corresponding to the key ID is inquired, wherein the response message is a response message of the encrypted message.
In an embodiment of a possible implementation, the query module is specifically configured to: and inquiring a first key corresponding to the key ID from the cache.
In one possible implementation, the query module is further configured to: and under the condition that the first key corresponding to the key ID is not inquired in the cache, inquiring the first key corresponding to the key ID from the database.
In one possible implementation embodiment, before receiving the request message sent by the second device, the apparatus further includes:
the first receiving module is further configured to receive an encrypted message sent by the second device, where the encrypted message includes a first key;
the decryption module is used for decrypting the encrypted message to obtain a first secret key;
the key ID generation module is used for generating a key ID of the first key;
the storage module is used for storing the first key and the key ID of the first key into a cache and a database;
the first sending module is further configured to send a key ID corresponding to the first key to the second device.
In a fourth aspect, an embodiment of the present application provides a packet transmission apparatus, which is applied to a second device, and includes:
the second sending module is further configured to send a request message to the first device, where the request message includes a packet encrypted by using the first key and a key ID of the first key, so that the first device queries the first key corresponding to the key ID;
the second receiving module is further configured to receive a response message, which is sent by the first device and encrypted by using the first key, when the first device queries the first key corresponding to the key ID, where the response message is a response message of an encrypted message.
In one possible implementation, before sending the request message to the first device, the apparatus further includes:
the second sending module is further configured to send the encrypted message to the first device, where the encrypted message includes the first key, and is used for the first device to decrypt the encrypted message to obtain the first key, generate a key ID of the first key, and store the first key and the key ID;
and the second receiving module is also used for receiving the key ID sent by the first equipment.
In one possible implementation, before sending the encrypted message to the first device, the apparatus further includes:
the encryption module is used for generating a first key by adopting an asymmetric encryption algorithm;
and the encrypted message generation module is used for encrypting the message according to the first secret key to generate an encrypted message.
In a fifth aspect, an embodiment of the present application provides a message transmission device, where the message transmission device includes:
a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements any of the above-described in-message transmission methods.
In a sixth aspect, an embodiment of the present application provides a computer storage medium, where computer program instructions are stored on the computer storage medium, and when the computer program instructions are executed by a processor, the message transmission method of any one of the foregoing items is implemented.
In a fifth aspect, the present application provides a computer program product, where instructions in the computer program product, when executed by a processor of an electronic device, enable the electronic device to perform any one of the message transmission methods described above.
According to the message encryption transmission method, the message encryption transmission device, the message encryption transmission equipment and the computer storage medium, the step of encryption and decryption is reduced by inquiring the key generated by negotiation through the request message, so that the difficulty of encrypting and decrypting the message is reduced, the message encryption and decryption time is further reduced, the service response time is shortened, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described below, and for those skilled in the art, other drawings may be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a message transmission method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a message transmission method according to another embodiment of the present application;
fig. 3 is a schematic structural diagram of a message transmission apparatus according to yet another embodiment of the present application;
fig. 4 is a schematic structural diagram of a message transmission apparatus according to still another embodiment of the present application;
fig. 5 is a schematic hardware structure diagram of a message transmission device according to still another embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of, and not restrictive on, the present application. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising 8230; \8230;" comprises 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
It should be noted that, in the embodiments of the present application, the acquisition, storage, use, processing, and the like of data all conform to relevant regulations of national laws and regulations.
In practical application, in order to ensure the security of transmission messages, a plurality of encryption modes are often combined for use, but the combined encryption method increases the difficulty of encryption and decryption of project application, so that the encryption and decryption need longer time, the service response time is prolonged, and the user experience is influenced.
In order to solve the problem of the prior art, embodiments of the present application provide a message transmission method, apparatus, device, and computer storage medium. First, a message transmission method provided in the embodiment of the present application is described below.
Fig. 1 is a flowchart illustrating a message transmission method according to an embodiment of the present application. As shown in fig. 1, the steps are as follows:
s110, the second device sends a request message to the first device, wherein the request message comprises a message encrypted by a first key and a key ID of the first key, and the first key is a key obtained by negotiation between the second device and the first device.
S120, the first device queries a first key corresponding to the key ID.
S130, under the condition that the first key corresponding to the key ID is inquired, the first equipment sends a response message encrypted by the first key to the second equipment, wherein the response message is the response message of the encrypted message.
The embodiment of the application provides a message transmission method, which queries a key generated by negotiation through a request message, and reduces the steps of encryption and decryption, thereby reducing the difficulty of encrypting and decrypting a message, further reducing the message encryption and decryption time, and reducing the service response time.
Specific implementations of the above steps are described below.
In S110, the second device sends an encrypted message encrypted by using a first key to the first device, where the first key is a key negotiated in advance between the second device and the first device. In the process of negotiating a key between the second device and the first device, the first device generates a key ID of the first key based on the first key, and stores the first key and the corresponding relation between the first key and the key ID; the key ID is then sent to the second device. Wherein the key ID may be an ID that uniquely identifies the first key.
When the second device sends a request message to the first device, the second device encrypts a message to be transmitted by using the first key, and sends the encrypted message and the key ID to the first device.
In S120, when the first device receives the request message sent by the second device, the first device queries the first key corresponding to the key ID based on the stored correspondence between the first key and the key ID.
In some embodiments, the first key and the corresponding relationship between the first key and the key ID may be stored in the first device, or may be stored in another device.
In S130, when the first device queries the first key corresponding to the key ID, the first device obtains the first key, decrypts the encrypted message using the first key, encrypts a response message to the message using the first key, and then sends the encrypted response message to the second device.
Therefore, the key generated by negotiation in advance is inquired through the request message, and the steps of encryption and decryption are reduced, so that the difficulty of encrypting and decrypting the message is reduced, the message encryption and decryption time is further reduced, and the service response time is reduced. The first key is inquired through the key ID, so that the transmission of the key is avoided, and the risk of key leakage is reduced.
In some embodiments, in a case that the first device does not query the first key corresponding to the key ID, the first device may send a query exception message to the second device.
Therefore, when the first device does not inquire the first key corresponding to the key ID, the first device returns a failure message to the second device, and the second device can re-encrypt the message to be transmitted.
In some embodiments, the first device may store the first key in a cache and a database of the first device.
In some embodiments, the querying, by the first device, the first key corresponding to the key ID may include:
and the first equipment inquires a first key corresponding to the key ID from the cache.
In this embodiment, when the first device receives the key ID sent by the second device, the first device first queries, from the cache, the first key corresponding to the key ID according to the correspondence between the first key and the key ID.
And under the condition that the first equipment inquires the first key from the cache, the first equipment decrypts the encrypted message by using the first key, encrypts a response message to the message by using the first key, and then sends the encrypted response message to the second equipment.
Therefore, by inquiring the first key from the cache, the times of generating the key are reduced, the message encryption and decryption time is reduced, and the service response time is reduced.
In one embodiment, after querying the first key corresponding to the key ID from the cache, the method may further include:
and under the condition that the first key corresponding to the key ID is not inquired in the cache, inquiring the first key corresponding to the key ID from the database.
In this embodiment, when the first device receives the key ID sent by the second device, the first device does not inquire the first key corresponding to the key ID in the cache, and inquires the first key corresponding to the key ID in the database.
And under the condition that the first equipment inquires the first key from the database, the first equipment decrypts the encrypted message by using the first key, encrypts a response message to the message by using the first key, and then sends the encrypted response message to the second equipment.
Therefore, by inquiring the first key from the database, the times of generating the key are reduced, the message encryption and decryption time is reduced, and the service response time is reduced.
In some embodiments, the first device may send a query exception message to the second device in the case where the first device does not query the first key corresponding to the key ID from the cache and the database.
Therefore, when the first device does not inquire the first key corresponding to the key ID from the cache and the database, the first device returns a failure message to the second device, and the second device can re-encrypt the message to be transmitted.
In some embodiments, the first secret key stored in the cache and the database may be time-sensitive, with the first secret key stored in the database being longer than the first secret key stored in the cache.
In one example, the first key stored in the cache may be time-efficient, for example, the first key has a validity duration of 30 minutes, and the cache cleans up the first key after the first key exists in the cache for 30 minutes. The first key stored in the database may be time-efficient, for example, the validity duration of the first key is 2 hours, and the database cleans up the first key after the first key exists in the cache for 2 hours.
And under the condition that the first equipment receives the key ID sent by the second equipment, searching in the cache, if the key ID is searched but exceeds the effective duration, searching in the database to search the first key within the effective duration, encrypting a response message to the message by using the first key, and then sending the encrypted response message to the second equipment.
In this way, the first device queries the cache before querying the first key in the database, and the number of first keys in the cache is smaller relative to the number of first keys in the database, so the response time is shorter. And the first keys in the database and the cache can be cleared regularly, so that the number of the first keys in the database and the cache can be reduced, and the pressure of the server is reduced.
In some embodiments, as shown in fig. 2, before the second device sends the request message to the first device, the method may further include:
s101, the second equipment sends an encrypted message to the first equipment, wherein the encrypted message comprises a first secret key;
s102, the first equipment decrypts the encrypted message to obtain a first secret key;
s103, the first device generates a key ID of the first key;
s104, the first device stores the first key and the key ID of the first key into a cache and a database;
s105, the first device sends the key ID corresponding to the first key to the second device.
Here, the first device generates a key ID of the first key by decrypting the encrypted message to obtain the first key, where the key ID may be an ID uniquely identifying the first key. The first key and the key ID of the first key are stored in the cache and the database, and the cache and the database can store, but are not limited to, the first key, the key ID of the first key, the correspondence between the first key and the key ID, and the time of storage.
Therefore, the first key and the key ID of the first key are stored through the cache and the database, the number of times of key generation is reduced, the corresponding first key can be inquired only according to the key ID, only the key ID is transmitted, the key is not required to be transmitted, and the safety is improved.
Based on this, in some embodiments, before the second device sends the request message to the first device, the method may further include:
the second equipment sends an encrypted message to the first equipment, wherein the encrypted message comprises a first key, and the first key is used for decrypting the encrypted message by the first equipment to obtain the first key, generating a key ID of the first key, and storing the first key and the key ID;
the key ID sent by the first device to the second device.
Therefore, only the encrypted message and the key ID are transmitted, and the risk of key leakage in the transmission process is reduced.
In some embodiments, before sending the encrypted message to the first device, the method may further include:
generating a first key by adopting an asymmetric encryption algorithm;
and encrypting the message according to the first key to generate an encrypted message.
Here, the asymmetric encryption algorithm requires two keys, which may be a pair of a public key and a private key, and if data is encrypted with the public key, decryption is only possible with the corresponding private key, where the public key is public. The key ID may be an ID that uniquely identifies the first key.
Therefore, the first key is generated through the asymmetric encryption algorithm, and only the corresponding key can be decrypted, so that the security of encrypted transmission is improved.
Based on the message transmission method provided in the foregoing embodiment, correspondingly, the present application further provides a specific implementation manner of the message transmission device. Please see the examples below.
Referring to fig. 3, a message transmission apparatus 300 applied to a first device according to an embodiment of the present application includes the following modules:
a first receiving module 310, configured to receive a request message sent by a second device, where the request message includes a message encrypted by using a first key and a key ID of the first key, and the first key is a key negotiated by the second device and the first device;
the query module 320 is configured to query a first key corresponding to the key ID;
the first sending module 330 is configured to send, to the second device, a response message encrypted with the first key when the first key corresponding to the key ID is queried, where the response message is a response message of an encrypted message.
As an implementation manner of the present application, the query module 320 is specifically configured to:
and inquiring a first key corresponding to the key ID from the cache.
As an implementation manner of the present application, the query module 320 is further configured to:
and under the condition that the first key corresponding to the key ID is not inquired in the cache, inquiring the first key corresponding to the key ID from the database.
As an implementation manner of the present application, before receiving the request message sent by the second device, the apparatus 300 further includes:
the first receiving module 310 is further configured to receive an encrypted message sent by the second device, where the encrypted message includes a first key;
the decryption module is used for decrypting the encrypted message to obtain a first secret key;
the key ID generation module is used for generating a key ID of the first key;
the storage module is used for storing the first key and the key ID of the first key into a cache and a database;
the first sending module 330 is further configured to send a key ID corresponding to the first key to the second device.
Referring to fig. 4, a message transmission apparatus 400 applied to a second device according to the embodiment of the present application includes the following modules:
a second sending module 410, configured to send a request message to the first device, where the request message includes a message encrypted by using the first key and a key ID of the first key, and is used for the first device to query the first key corresponding to the key ID;
the second receiving module 420 is configured to receive a response message, which is sent by the first device and encrypted by using the first key, when the first device queries the first key corresponding to the key ID, where the response message is a response message of an encrypted message.
As an implementation manner of the present application, before sending the request message to the first device, the apparatus further includes:
the second sending module 410 is further configured to send the encrypted message to the first device, where the encrypted message includes a first key, so that the first device decrypts the encrypted message to obtain the first key, generates a key ID of the first key, and stores the first key and the key;
the second receiving module 420 is further configured to receive the key ID sent by the first device.
As an implementation manner of the present application, before sending the encrypted packet to the first device, the apparatus further includes:
the encryption module is used for generating a first key by adopting an asymmetric encryption algorithm;
and the encrypted message generation module is used for encrypting the message according to the first secret key to generate an encrypted message.
Each module of the message transmission device provided in the embodiment of the present application can implement the functions of each step of the message transmission method provided in fig. 1 and fig. 2, and can achieve the corresponding technical effects, and for brevity, no further description is given here.
Fig. 5 is a schematic diagram illustrating a hardware structure of a message transmission device according to an embodiment of the present application.
The messaging device may include a processor 501 and memory 502 that stores computer program instructions.
Specifically, the processor 501 may include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present Application.
Memory 502 may include a mass storage for data or instructions. By way of example, and not limitation, memory 502 may include a Hard Disk Drive (HDD), a floppy Disk Drive, flash memory, an optical Disk, a magneto-optical Disk, magnetic tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 502 may include removable or non-removable (or fixed) media, where appropriate. The memory 502 may be internal or external to the integrated gateway disaster recovery device, where appropriate. In a particular embodiment, the memory 502 is non-volatile solid-state memory.
The Memory may include Read Only Memory (ROM), random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash Memory devices, electrical, optical, or other physical/tangible Memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors) it is operable to perform operations described with reference to the method according to an aspect of the disclosure.
The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement any of the message transmission methods in the above embodiments.
In one example, the message transmitting device may also include a communication interface 503 and a bus 510. As shown in fig. 5, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 to complete communication therebetween.
The communication interface 503 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiments of the present application.
The bus 510 includes hardware, software, or both to couple the components of the message transmitting device to each other. By way of example and not limitation, a Bus may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front Side Bus (Front Side Bus, FSB), a Hyper Transport (HT) Interconnect, an Industry Standard Architecture (ISA) Bus, an infiniband Interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a MicroChannel Architecture (MCA) Bus, a Peripheral Component Interconnect (PCI) Bus, a PCI-Express (Peripheral Component Interconnect-X, PCI-X) Bus, a Serial attached Technology (Serial attached Technology, vlth) Bus, a Local Bus, or a combination of two or more of these, as appropriate. Bus 510 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the present application, any suitable buses or interconnects are contemplated by the present application.
The message transmission device may execute the message transmission method in the embodiment of the present application based on the request message, thereby implementing the message transmission method and apparatus described in conjunction with fig. 1 to 4.
In addition, in combination with the message transmission method in the foregoing embodiment, the embodiment of the present application may provide a computer storage medium to implement. The computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement any of the message transmission methods in the above embodiments.
The present application further provides a computer program product, where when an instruction in the computer program product is executed by a processor of an electronic device, the electronic device executes various processes of implementing any one of the embodiments of the message transmission method.
It is to be understood that the present application is not limited to the particular arrangements and instrumentality described above and shown in the attached drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic Circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor Memory devices, read-Only memories (ROMs), flash memories, erasable Read-Only memories (EROMs), floppy disks, compact disk Read-Only memories (CD-ROMs), optical disks, hard disks, optical fiber media, radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware for performing the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As is clear to those skilled in the art, for convenience and simplicity of description, the specific working processes of the above-described systems, modules and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered within the scope of the present application.

Claims (17)

1. A message transmission method is applied to a first device, and is characterized by comprising the following steps:
receiving a request message sent by second equipment, wherein the request message comprises a message encrypted by a first key and a key ID of the first key, and the first key is a key obtained by negotiation between the second equipment and the first equipment;
inquiring a first key corresponding to the key ID;
and sending a response message encrypted by the first key to the second device under the condition that the first key corresponding to the key ID is inquired, wherein the response message is the response message of the encrypted message.
2. The message transmission method according to claim 1, wherein the querying the first key according to the key ID comprises:
and inquiring a first key corresponding to the key ID from the cache.
3. The message transmission method according to claim 2, wherein after the querying the first key corresponding to the key ID from the cache, the method further comprises:
and under the condition that the first key corresponding to the key ID is not inquired in the cache, inquiring the first key corresponding to the key ID from the database.
4. The message transmission method according to claim 1, wherein before receiving the request message sent by the second device, the method further comprises:
receiving an encrypted message sent by the second device, wherein the encrypted message comprises the first key;
decrypting the encrypted message to obtain the first key;
generating a key ID for the first key;
storing the first key and the key ID of the first key into a cache and a database;
and sending a key ID corresponding to the first key to the second equipment.
5. A message transmission method is applied to a second device, and is characterized by comprising the following steps:
sending a request message to first equipment, wherein the request message comprises a message encrypted by a first key and a key ID of the first key, and the request message is used for the first equipment to inquire the first key corresponding to the key ID;
and receiving a response message which is sent by the first equipment and encrypted by adopting the first key under the condition that the first equipment inquires the first key corresponding to the key ID, wherein the response message is the response message of the encrypted message.
6. The message transmission method according to claim 5, wherein before sending the request message to the first device, the method further comprises:
sending an encrypted message to the first device, where the encrypted message includes the first key, so that the first device decrypts the encrypted message to obtain the first key, generates a key ID of the first key, and stores the first key and the key ID;
and receiving the key ID sent by the first equipment.
7. The message transmission method according to claim 6, wherein before said sending an encrypted message to said first device, said method further comprises:
generating the first key by adopting an asymmetric encryption algorithm;
and encrypting the message according to the first key to generate an encrypted message.
8. A message transmission device is applied to a first device, and is characterized by comprising:
a first receiving module, configured to receive a request message sent by a second device, where the request message includes a packet encrypted by a first key and a key ID of the first key, and the first key is a key negotiated by the second device and the first device;
the query module is used for querying the first key corresponding to the key ID;
a first sending module, configured to send, to the second device, a response message encrypted with the first key when the first key corresponding to the key ID is queried, where the response message is a response message of the encrypted packet.
9. The message transmitting device according to claim 8, wherein the query module is specifically configured to: and inquiring a first key corresponding to the key ID from the cache.
10. The message transmitting device according to claim 9, wherein the query module is further configured to: and under the condition that the first key corresponding to the key ID is not inquired in the cache, inquiring the first key corresponding to the key ID from the database.
11. The message transmission apparatus according to claim 8, wherein before receiving the request message sent by the second device, the apparatus further comprises:
the first receiving module is further configured to receive an encrypted packet sent by the second device, where the encrypted packet includes the first key;
the decryption module is used for decrypting the encrypted message to obtain the first secret key;
a key ID generation module for generating a key ID of the first key;
the storage module is used for storing the first key and the key ID of the first key into a cache and a database;
the first sending module is further configured to send a key ID corresponding to the first key to the second device.
12. A message transmission device is applied to a second device, and is characterized by comprising:
the second sending module is further configured to send a request message to the first device, where the request message includes a packet encrypted by using a first key and a key ID of the first key, so that the first device queries a first key corresponding to the key ID;
the second receiving module is further configured to receive a response message that is sent by the first device and encrypted by using the first key, where the response message is a response message of the encrypted packet, when the first device queries the first key corresponding to the key ID.
13. The messaging apparatus of claim 12, wherein prior to sending the request message to the first device, the apparatus further comprises:
the second sending module is further configured to send an encrypted message to the first device, where the encrypted message includes the first key, so that the first device decrypts the encrypted message to obtain the first key, generates a key ID of the first key, and stores the first key and the key ID;
the second receiving module is further configured to receive the key ID sent by the first device.
14. The message transmission apparatus according to claim 13, wherein before the sending of the encrypted message to the first device, the apparatus further comprises:
the encryption module is used for generating the first key by adopting an asymmetric encryption algorithm;
and the encrypted message generating module is used for encrypting the message according to the first key to generate an encrypted message.
15. A message transmission device, characterized in that the device comprises: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the method of on-message transmission of any of claims 1-7.
16. A computer-readable storage medium, having stored thereon computer program instructions, which when executed by a processor, implement the message transmission method according to any one of claims 1-7.
17. A computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, enable the electronic device to perform the message transmission method according to any of claims 1-7.
CN202211156403.6A 2022-09-22 2022-09-22 Message transmission method, device, equipment and computer storage medium Pending CN115567282A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211156403.6A CN115567282A (en) 2022-09-22 2022-09-22 Message transmission method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211156403.6A CN115567282A (en) 2022-09-22 2022-09-22 Message transmission method, device, equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN115567282A true CN115567282A (en) 2023-01-03

Family

ID=84741223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211156403.6A Pending CN115567282A (en) 2022-09-22 2022-09-22 Message transmission method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN115567282A (en)

Similar Documents

Publication Publication Date Title
JP2017518651A (en) Wireless communication connection establishment method and system
CN112084234B (en) Data acquisition method, device, equipment and medium
CN110621016B (en) User identity protection method, user terminal and base station
CN114143082B (en) Encryption communication method, system and device
CN110730447B (en) User identity protection method, user terminal and core network
CN113612852A (en) Communication method, device, equipment and storage medium based on vehicle-mounted terminal
EP1368951B1 (en) A system for encryption of wireless transmissions from personal palm computers to world wide web terminals
CN114095277A (en) Power distribution network secure communication method, secure access device and readable storage medium
CN115017529B (en) Encryption method for automobile diagnosis software
CN115344848B (en) Identification acquisition method, device, equipment and computer readable storage medium
CN115567282A (en) Message transmission method, device, equipment and computer storage medium
CN111093169B (en) Communication establishing method and device
CN114386075A (en) Data transmission channel establishing method, data transmission device, data transmission equipment and medium
CN114389793B (en) Method, device, equipment and computer storage medium for verifying session key
CN114912105A (en) Data storage method, device, system, equipment, medium and product
JP2993429B2 (en) Mobile wireless terminal encryption system
CN112511550B (en) Communication method, communication device, electronic device and storage medium
CN115225293B (en) Authentication method, system, device, equipment and computer storage medium
CN116305300B (en) Fair privacy set intersection method
CN111212047B (en) Communication establishing method and device
CN112422293B (en) Key generation method, device and information processing method
EP4195590A1 (en) Secure data transmission
CN114625987A (en) Two-dimensional code address generation method, device and equipment and computer storage medium
CN116821920A (en) Data storage method, device, equipment and computer storage medium
CN117113381A (en) Data processing method, device, equipment and storage medium

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