Message processing method and device, equipment, storage medium and program product

By using pre-generated verification keys and encryption key sets in message authentication code technology, the message authentication code and encryption results are determined, and authentication messages are generated, the problems of limited protection form and insufficient protection strength in the prior art are solved, and higher security protection strength and privacy protection effects are achieved.

CN119544384AActive Publication Date: 2025-02-28成方金融科技有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510088920.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-02-28
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

The protection form of existing message authentication code technologies is relatively limited, and the protection intensity is insufficient, making it difficult to deal with the growing security threat, especially to resist quantum computing attacks.

Method used

By obtaining the target message and obtaining the pre-generated verification key and encryption key set, these keys are used to determine the message authentication code and encryption results, generating authentication messages, and decryption processing is performed through homomorphic decryption policy to ensure the secure transmission of messages.

Benefits of technology

It improves the security protection intensity of target messages, increases the difficulty of cracking, ensures the privacy protection of messages, and can effectively resist quantum computing attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544384A_ABST
    Figure CN119544384A_ABST
Patent Text Reader

Abstract

The invention discloses a message processing method and device, equipment, a storage medium and a program product, and relates to the technical field of data encryption and decryption. The method comprises the following steps: acquiring a target message, and acquiring a pre-generated verification key and an encryption key set; determining a message authentication code of the target message according to the verification key, and determining a first encryption result of the target message according to the encryption key in the encryption key set; determining a second encryption result of a set digital sequence according to the encryption key, the digital sequence being generated based on the target message; and generating an authentication message of the target message according to the message authentication code, the first encryption result and the second encryption result, and sending the authentication message to a receiving terminal, so that the receiving terminal performs message authentication through decryption processing and obtains the target message. According to the method, the uncertainty of the position of the first encryption result is increased, and the security protection strength of the target message is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data encryption and decryption, and in particular to a message processing method, device, equipment, storage medium and program product. Background Art

[0002] With the rapid development of information technology, Message Authentication Code (MAC) technology has become a key technology to ensure data integrity and authenticate the source of messages. The MAC algorithm uses a key and a message as input to generate a fixed-length output, namely the MAC value, to verify the integrity and authenticity of the message.

[0003] Typical message authentication code technologies focus on message integrity and authentication, but do not provide adequate protection for the message content itself. These technologies usually send messages in plain text and are only suitable for the transmission of public information, but not for the transmission of private data.

[0004] Although some modified MAC technologies can encrypt message content, the protection they provide for messages is relatively limited and the protection strength is insufficient, making it difficult to cope with growing security threats, especially resisting attacks from quantum computing. Summary of the invention

[0005] The present invention provides a message processing method, device, equipment, storage medium and program product to solve the problem that the existing message authentication code technology has limited protection forms and insufficient protection strength.

[0006] In a first aspect, an embodiment of the present invention provides a message processing method, the method comprising:

[0007] Obtaining a target message, and obtaining a pre-generated verification key and an encryption key set, wherein the verification key and the encryption key set are pre-generated by the sending terminal through key negotiation with the receiving terminal based on a root key;

[0008] Determine a message authentication code of the target message according to the verification key, and determine a first encryption result of the target message according to an encryption key in the encryption key set;

[0009] Determining, according to the encryption key, a second encryption result of a set digital sequence, wherein the digital sequence is generated based on the target message;

[0010] An authentication message of the target message is generated according to the message authentication code, the first encryption result and the second encryption result, and the authentication message is sent to a receiving terminal, so that the receiving terminal performs message authentication and obtains the target message through decryption processing.

[0011] In a second aspect, an embodiment of the present invention provides a message processing method, the method comprising:

[0012] After receiving the authentication message corresponding to the target message transmitted by the sending terminal, obtaining a message authentication code and a ciphertext set included in the authentication message, wherein the ciphertext set is generated by the sending terminal through the determined first encryption result and the second encryption result;

[0013] Performing a first decryption process on the ciphertext set using a homomorphic decryption strategy and a root key received in advance from a sending terminal to obtain a first decryption result;

[0014] Perform a second decryption process on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, restore the target message according to the first decryption result.

[0015] In a third aspect, an embodiment of the present invention provides a message processing device, applied to a sending terminal, the device comprising:

[0016] A key acquisition module, used to acquire a target message and acquire a pre-generated verification key and an encryption key set, wherein the verification key and the encryption key set are pre-generated by the sending terminal through key negotiation with the receiving terminal based on a root key;

[0017] A first encryption result determination module, configured to determine a message authentication code of the target message according to the verification key, and determine a first encryption result of the target message according to an encryption key in the encryption key set;

[0018] A second encryption result determination module, configured to determine a second encryption result of a set digital sequence according to the encryption key, wherein the digital sequence is generated based on the target message;

[0019] The authentication message sending module is used to generate an authentication message of the target message according to the message authentication code, the first encryption result and the second encryption result, and send the authentication message to the receiving terminal so that the receiving terminal performs message authentication and obtains the target message through decryption processing.

[0020] In a fourth aspect, an embodiment of the present invention provides a message processing device, applied to a receiving terminal, the device comprising:

[0021] an authentication message receiving module, configured to, after receiving an authentication message corresponding to a target message transmitted by a sending terminal, obtain a message authentication code and a ciphertext set included in the authentication message, wherein the ciphertext set is generated by the sending terminal through the determined first encryption result and the second encryption result;

[0022] A first decryption result determination module, configured to perform a first decryption process on the ciphertext set by using a homomorphic decryption strategy and a root key received in advance from a sending terminal to obtain a first decryption result;

[0023] The target message restoration module is used to perform a second decryption process on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, restore the target message according to the first decryption result.

[0024] In a fifth aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0025] at least one processor;

[0026] and a memory communicatively coupled to the at least one processor;

[0027] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the message processing method described in any embodiment of the present invention.

[0028] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the message processing method described in any embodiment of the present invention when executed.

[0029] In a seventh aspect, an embodiment of the present invention further provides a computer program product, characterized in that the computer program product comprises a computer program, and when the computer program is executed by a processor, the message processing method according to any embodiment of the present invention is implemented.

[0030] The technical solution of the embodiment of the present invention obtains the target message and obtains the pre-generated verification key and encryption key set, which are generated by the sending terminal in advance according to the root key through key negotiation with the receiving terminal; according to the verification key, the message authentication code of the target message is determined, and according to the encryption key in the encryption key set, the first encryption result of the target message is determined; according to the encryption key, the second encryption result of the set digital sequence is determined, and the digital sequence is generated based on the target message; according to the message authentication code, the first encryption result and the second encryption result, the authentication message of the target message is generated, and the authentication message is sent to the receiving terminal, so that the receiving terminal performs message authentication and obtains the target message through decryption processing. The method determines the first encryption result of the target message by flexibly selecting the encryption key from the encryption key set, realizes the encryption of the message content, improves the security protection strength of the target message, obtains the second encryption result of the set digital sequence, and generates the authentication message of the target message based on the first encryption result and the second encryption result, thereby increasing the uncertainty of the position of the first encryption result, thereby increasing the difficulty of cracking by the adversary, and further improving the privacy protection strength of the target message.

[0031] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 A flowchart of a message processing method applied to a sending terminal provided by an embodiment of the present invention;

[0034] Figure 2 A flowchart of a message processing method applied to a receiving terminal provided by an embodiment of the present invention;

[0035] Figure 3 A schematic diagram of the structure of a message processing device applied to a sending terminal provided by an embodiment of the present invention;

[0036] Figure 4 A schematic diagram of the structure of a message processing device applied to a receiving terminal provided by an embodiment of the present invention;

[0037] Figure 5A schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0040] It should be noted that typical message authentication code technology focuses on the integrity and authentication of messages, but does not provide adequate protection for the message content itself, and is not suitable for sending private data. Although the modified MAC technology can encrypt the message content, its protection for messages is relatively limited and the protection strength is insufficient, making it difficult to cope with the growing security threats, especially the attacks of quantum computing.

[0041] Based on this, an embodiment of the present invention provides a message processing method. Figure 1 A flowchart of a message processing method applied to a sending terminal is provided in an embodiment of the present invention. The embodiment of the present invention can be applicable to a scenario in which messages to be sent are encrypted to deal with security threats. The method can be executed by a message processing device, which is applied to the sending terminal and can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which is preferably a mobile terminal, a desktop computer, a laptop computer, a server, etc.

[0042] like Figure 1 As shown, the message processing method provided by the embodiment of the present invention may specifically include:

[0043] S101. Obtain a target message, and obtain a pre-generated verification key and encryption key set, where the verification key and encryption key set are pre-generated by a sending terminal through key negotiation with a receiving terminal based on a root key.

[0044] Among them, the target message can be understood as a message that needs to be sent and received and has encryption requirements. Exemplarily, the target message can be a finite-length number, text or picture, which is not limited in the embodiments of the present invention. The verification key can be understood as a key used to verify the identity of the communicating parties, ensuring that both communicating parties are the expected participants and preventing security threats such as man-in-the-middle attacks. The verification key can be determined through negotiation between the communicating parties and replaced regularly. The encryption key set can be understood as a set of encryption keys used to encrypt the target message. The root key can be understood as the initially generated shared key, which is usually used to generate other keys, including verification keys and encryption keys.

[0045] In this embodiment, the sending terminal obtains the target message. The method of obtaining the target message may be to read a local storage file or to detect an editing operation on the editing area in the current interface. The target message is determined according to the editing operation. The editing operation may be the target message content input by the user or the target message content selected in a drop-down box. The embodiment of the present invention does not limit this. In addition, a pre-generated verification key and encryption key set are obtained. The generation process of the verification key and encryption key set may be that the sending terminal generates a root key in advance according to an encryption key generation algorithm, and shares the root key with the receiving terminal through a secure communication method, and negotiates the generation rule of the verification key. The sending terminal generates the verification key through the root key and the negotiated verification key generation rule, and generates the encryption key set in combination with the key generation algorithm.

[0046] S102: Determine a message authentication code of the target message according to the verification key, and determine a first encryption result of the target message according to the encryption key in the encryption key set.

[0047] The message authentication code can be understood as a short message used to verify the integrity, correctness and identity of the sender of the data. The first encryption result can be understood as the encryption result obtained after performing an encryption process on the target message.

[0048] In this embodiment, the method of determining the message authentication code of the target message based on the verification key can be: processing the target message according to the verification key, and obtaining the message authentication code through a specific algorithm such as the HMAC algorithm; or the target message can be first converted into binary to obtain a message sequence, the target message is divided according to the length of the verification password, and each group of message sequences after division is processed using the verification key, and then the message authentication code is obtained through a specific algorithm.

[0049] In this embodiment, one or more suitable encryption keys are flexibly selected from the encryption key set, the target message converted into binary is encrypted according to the encryption algorithm and the selected encryption key, and a first encryption result of the target message is determined.

[0050] It should be noted that the embodiments of the present invention do not limit the specific technology used by the encryption algorithm, as long as the asymmetric cryptographic algorithm can meet the security requirements and can meet additive homomorphic (at least additive semi-homomorphic encryption technology), such as Paillier et al.

[0051] It should be noted that when it is necessary to resist quantum computing attacks, there is no need to adjust the processing flow of the message processing method provided in this embodiment, and quantum computing attacks of various strengths can be resisted by selecting one or more of the following replacement options: for example, the specific algorithm for generating a message authentication code is set to an algorithm such as the SM3 algorithm that can output a summary with a length of 256 bits; the technology used by the encryption algorithm is set to a lattice cryptography technology with additive homomorphism.

[0052] S103. Determine a second encryption result of a set digital sequence according to the encryption key, where the digital sequence is generated based on the target message.

[0053] The second encryption result can be understood as the result of encrypting the set digital sequence, which is used to confuse the first encryption result to increase the difficulty of cracking the first encryption result. The digital sequence can be understood as a pre-set sequence used to process the first encryption result, which can be one or more.

[0054] In this embodiment, the preset digital sequence is encrypted by an encryption algorithm according to the encryption key to determine the second encryption result. The length of the set digital sequence is the same as the binary digit number after the target message is binary-converted, and each bit in the digital sequence is a set bit value, such as all 0.

[0055] It should be noted that the results of encrypting the same number are usually different.

[0056] It is understandable that encryption algorithms can be adaptively and flexibly set when it is necessary to resist quantum computing attacks.

[0057] S104. Generate an authentication message of the target message according to the message authentication code, the first encryption result and the second encryption result, and send the authentication message to the receiving terminal, so that the receiving terminal performs message authentication and obtains the target message through decryption processing.

[0058] The authentication message may be understood as a message sent by a sending terminal to a receiving terminal, which is used by the receiving terminal to obtain a target message and confirm the correctness of the target message.

[0059] In this embodiment, the message authentication code, the first encryption result, and the second encryption result are integrated to generate an authentication message of the target message. It is understandable that if the second encryption result is obtained by encrypting multiple digital sequences, the second encryption result includes the encryption results corresponding to each digital sequence, and when generating the authentication message of the target message, the first encryption result and the encryption results corresponding to each digital sequence in the second encryption result can be confused. After the authentication message is generated, the authentication message is sent to the receiving terminal, so that the receiving terminal confirms the target message through decryption processing and obtains the target message.

[0060] A message processing method provided by an embodiment of the present invention obtains a target message and obtains a pre-generated verification key and an encryption key set, wherein the verification key and the encryption key set are generated by a sending terminal in advance according to a root key through key negotiation with a receiving terminal; according to the verification key, a message authentication code of the target message is determined, and according to an encryption key in the encryption key set, a first encryption result of the target message is determined; according to the encryption key, a second encryption result of a set digital sequence is determined, and the digital sequence is generated based on the target message; according to the message authentication code, the first encryption result and the second encryption result, an authentication message of the target message is generated, and the authentication message is sent to a receiving terminal, so that the receiving terminal performs message authentication and obtains the target message through decryption processing. The method determines the first encryption result of the target message by flexibly selecting an encryption key from the encryption key set, realizes the encryption of the message content, improves the security protection strength of the target message, obtains the second encryption result of the set digital sequence, and generates the authentication message of the target message based on the first encryption result and the second encryption result, thereby increasing the uncertainty of the position of the first encryption result, thereby increasing the difficulty of cracking by the adversary, and further improving the privacy protection strength of the target message.

[0061] As a first optional embodiment of this embodiment, based on the above embodiment, the verification key and the encryption key set may be generated by performing key negotiation with the receiving terminal according to the root key, which may be specifically implemented as the following steps:

[0062] a1) Generate the root key by using a key generation method of an asymmetric homomorphic encryption algorithm, and send the root key to a receiving terminal through a key exchange strategy.

[0063] In this embodiment, a root key, i.e., a private key of an asymmetric cipher, is generated by a key generation method of an asymmetric homomorphic encryption algorithm (such as the Paillier algorithm), and the generated root key is sent to a receiving terminal through a key exchange strategy. Exemplarily, the key exchange strategy may adopt quantum key distribution, Diffie-Hellman key exchange, etc.

[0064] b1) generating the verification key and the encryption key set according to the received key generation rule, wherein the key generation rule is generated based on the root key through negotiation with the receiving terminal.

[0065] In this embodiment, after the root key is sent to the receiving terminal, the key generation rule or method is negotiated with the receiving terminal based on the sent root key, and the generation rule of the root key and the verification key is regularly changed. After receiving the agreed key generation rule, the verification key is generated according to the root key and the received key generation rule; the encryption key set, i.e., the public key set of the asymmetric cipher, is generated using the key generation algorithm in the encryption algorithm. It should be noted that the private key corresponding to each public key in the public key set is the root key.

[0066] The above technical scheme of this embodiment jointly ensures that the sending terminal can securely share and use the root key with the receiving terminal through an asymmetric homomorphic encryption algorithm and a key exchange strategy. Since all keys after sharing are derived from the same root key, the security and consistency of the keys are ensured. At the same time, by negotiating key generation rules, it is ensured that the communicating parties use the same method to generate verification keys, thereby achieving correct decryption.

[0067] As a second optional embodiment of this embodiment, based on the above embodiment, determining the message authentication code of the target message according to the verification key can be concretized into the following steps:

[0068] a2) converting the target message into a binary bit sequence, obtaining a message sequence, and acquiring a key length of the verification key.

[0069] In this embodiment, the target message is converted into a binary bit sequence using a corresponding encoding method, and the converted sequence is determined to be a message sequence, that is, the message sequence is a sequence composed of 0 and 1. At the same time, the verification key is converted into a binary bit sequence to obtain the key length of the verification key, wherein the key length can be understood as the number of bits contained in the binary bit sequence corresponding to the verification key.

[0070] Exemplarily, the target message is converted into a binary bit sequence to obtain a message sequence It can be expressed as:

[0071] ;

[0072] in, is the length of the binary bit sequence, that is, the length of the message sequence, For target message Performs binary conversion operation.

[0073] b2) dividing the message sequence into a plurality of message subsequences each having the key length, wherein the last message subsequence obtained by the division has the key length after being padded with a determined padding length using a bit value.

[0074] In this embodiment, the message sequence is divided into a plurality of message subsequences each having the key length, that is, the sequence length of each message subsequence is the same as the key length. It should be noted that if the sequence length of the last message subsequence obtained by the division is less than the key length, the padding length is determined, that is, the number of bit values ​​required to be padded to be the same as the key length, and then the last message subsequence is padded at the end according to the determined padding length using the bit value (that is, 0 or 1) pre-agreed by both parties, so that the last message subsequence after padding has the key length.

[0075] Exemplarily, following the above example description, the key length for obtaining the verification key is , then the message sequence Divide into message subsequences, each containing binary bits, where is rounded up. The message sequence is denoted as , , if the last message subsequence Bit length is less than , then fill the last message subsequence at the end with the binary bit value (0 or 1) agreed by both parties to a length of Bit.

[0076] c2) for each message subsequence, performing an XOR operation on the message subsequence using the verification key, and performing XOR operation results obtained by processing the first Hash function to generate an encrypted subsequence of the message subsequence.

[0077] In this embodiment, for each message subsequence, the verification key is subjected to a bitwise XOR operation with each message subsequence to obtain an XOR operation result, and the XOR operation result is processed by a first hash function determined in advance by the transmitting terminal and the receiving terminal, such as SM3, SHA-256, etc., to generate an encrypted subsequence of each message subsequence.

[0078] Exemplarily, following the above example description, the verification key For message subsequence The bitwise XOR operation can be expressed as ; The first hash function can be expressed as , the process of generating the encrypted subsequence of the message subsequence through the first hash function can be expressed as .

[0079] d2) concatenating the encrypted subsequences and processing them through a second hash function to generate the message authentication code.

[0080] In this embodiment, the encrypted subsequences are concatenated and merged, and the merged result is processed by a second hash function to generate a message authentication code.

[0081] It should be noted that when it is necessary to resist quantum computing attacks, the hash function used can be directly set to a function that can output a summary with a length of 256 bits.

[0082] Exemplarily, following the above example, each encrypted subsequence is concatenated and the combined result is obtained. The process can be expressed as:

[0083] .

[0084] Exemplarily, the combined result is processed by a second hash function to generate a message authentication code The process can be expressed as:

[0085] .

[0086] The above technical scheme of this embodiment improves the efficiency of the verification key in processing the target message by converting the target message into a binary bit sequence and dividing it into message subsequences, and supplementing and filling the message subsequences. At the same time, through two hash function processings, it is difficult to find two different input values ​​that produce the same output hash value, that is, the reliability of the generated message authentication code is improved, which provides strong support for the receiving terminal to perform accurate message verification.

[0087] As a third optional embodiment of this embodiment, the step of determining the first encryption result of the target message according to the encryption key in the encryption key set may be specifically optimized into the following steps:

[0088] a3) randomly selecting a key from the encryption key set as the encryption key.

[0089] In this embodiment, the randomly selected key may select one or more keys.

[0090] b3) encrypting each binary bit in the target message represented by the binary bit sequence by using a homomorphic encryption algorithm and the encryption key.

[0091] In this embodiment, a homomorphic encryption algorithm is used to encrypt each binary bit in a binary bit sequence converted from a target message according to an encryption key to obtain an encryption result of each binary bit, that is, a corresponding ciphertext.

[0092] Exemplarily, the process of encrypting each binary bit can be expressed as:

[0093] ;

[0094] ;

[0095] ;

[0096] in, is the encryption key, For the encryption key The encryption algorithm when The first bit in the binary bit sequence The bit value of a binary digit, The first bit in the binary bit sequence The encrypted result of binary bits.

[0097] c3) forming a first encryption result of the target message based on the encryption result of each binary digit.

[0098] The first encryption result may be understood as a result obtained after encrypting the target message.

[0099] In this embodiment, the encryption results of each binary bit are combined to form a first encryption result of the target message.

[0100] Exemplarily, following the above example, the first encryption result of the target message is formed based on the encryption result of each binary bit. The process can be expressed as:

[0101] ;

[0102] ;

[0103] in, For The encryption result of For The encryption result.

[0104] The above technical scheme of this embodiment encrypts each binary bit by randomly selecting a key as an encryption key, thereby realizing the encryption of the target message and protecting the security of the target message. By adopting a homomorphic encryption algorithm, the number of subsequent decryptions is reduced while ensuring the security of the target message, thereby improving the decryption efficiency.

[0105] As a fourth optional embodiment of this embodiment, the step of determining the second encryption result of the set digital sequence according to the encryption key may be specifically optimized into the following steps:

[0106] a4) acquiring a binary bit sequence of the target message, and generating at least one digital sequence having a sequence length the same as that of the binary bit sequence, wherein each bit in the digital sequence is a set bit value.

[0107] In this embodiment, a binary bit sequence of the target message is obtained, a sequence length of the binary bit sequence is determined, and at least one digital sequence is generated according to the sequence length, wherein the sequence length of the digital sequence is the same as the sequence length of the binary bit sequence, and each bit in the digital sequence is a set bit value. Exemplarily, the bit value of each bit is 0.

[0108] b4) Encrypting each of the digital sequences respectively using a homomorphic encryption algorithm and the encryption key to obtain second encryption results corresponding to each of the digital sequences respectively.

[0109] The second encryption result may be understood as a result obtained after encrypting the digital sequence.

[0110] In this embodiment, each bit in each digital sequence is encrypted using an encryption key through a homomorphic encryption algorithm to obtain a second encryption result corresponding to each digital sequence.

[0111] For example, let the number of digital sequences be , the bit value of each bit in the digital sequence is 0, and the sequence length of the digital sequence is , the process of obtaining the second encryption result of the digital sequence can be expressed as:

[0112] ;

[0113] ;

[0114] ;

[0115] ;

[0116] in, For the first bits are encrypted using a homomorphic encryption algorithm and an encryption key The bit value 0 of the bit is encrypted, and the encryption result obtained is for The second encryption result corresponding to the corresponding digital sequence.

[0117] It is understandable that since cryptographic algorithms that meet security requirements have the property of ciphertext indistinguishability, even if the same plaintext is encrypted, the resulting ciphertext will be different.

[0118] It should be noted that if the number of digital sequences If the value is greater than 1, the above encryption process is repeated for each digital sequence to obtain the second encryption result corresponding to each digital sequence. It can be understood that as the number of digital sequences increases, it is more difficult for the adversary to determine which is the first encryption result corresponding to the target message, which increases the difficulty of cracking, but also increases the computing cost and computing loss. Therefore, appropriate parameters can be selected according to security and efficiency requirements.

[0119] When it is necessary to resist quantum computing attacks, the homomorphic encryption algorithm can be conveniently set to a homomorphic encryption algorithm based on lattice cryptography (the homomorphic addition property must be satisfied) without changing the message processing process.

[0120] The above technical scheme of this embodiment generates at least one digital sequence with the same sequence length as the sequence length of the binary bit sequence, and encrypts each digital sequence respectively through the homomorphic encryption algorithm and the encryption key, thereby generating a second encryption result similar to the first encryption result, thereby increasing the difficulty for the adversary to determine the first encryption result, increasing the difficulty of cracking, and improving the protection strength of the target message; and by using the homomorphic encryption algorithm, it provides strong support for ensuring data security and efficiency in the subsequent decryption process.

[0121] As a fifth optional embodiment of this embodiment, the step of generating the authentication message of the target message according to the message authentication code, the first encryption result and the second encryption result may be specifically implemented as the following steps:

[0122] a5) constructing a ciphertext set of the target message based on the first encryption result and the second encryption result.

[0123] The ciphertext set may be understood as a set formed by combining the first encryption result and the second encryption result.

[0124] In this embodiment, the first encryption result and at least one second encryption result are combined to form a ciphertext set of the target message. It should be noted that when the second encryption result is not unique, the first encryption result and each second encryption result in the ciphertext set can be arranged in a random order to increase the difficulty for the adversary to crack and ensure the security of the target message.

[0125] Exemplarily, when the second encryption result is unique, the ciphertext set can be expressed as: ,or ;

[0126] Exemplarily, when the second encryption result is 2, the ciphertext set can be expressed as: ;or ;or ;or wait;

[0127] in, and are the second encryption results corresponding to each digital sequence respectively.

[0128] b5) constructing an authentication message of the target message based on the ciphertext set and the message authentication code.

[0129] In this embodiment, the ciphertext set and the message authentication code are integrated as the authentication message of the target message.

[0130] Exemplarily, the authentication message can be expressed as .

[0131] The above technical scheme of this embodiment, based on the first encryption result and the second encryption result, constitutes the ciphertext set of the target message, realizes that any number of second encryption results can be sent, and the second encryption results can be arranged in a random order with the first encryption results corresponding to the target message, so that the enemy cannot determine the first encryption result corresponding to the target message, increases the difficulty for the enemy to crack, and further improves the security protection strength of the target message.

[0132] In order to cope with the growing security threats, especially to resist the attacks of quantum computing, a message processing method provided in an embodiment of the present invention can resist the attacks of quantum computing to varying degrees by flexibly replacing the hash function with a hash function with doubled output length (256 bits) and / or selecting a homomorphic encryption algorithm that is resistant to quantum computing attacks according to actual needs without changing the message processing process.

[0133] Figure 2 A flowchart of a message processing method applied to a receiving terminal is provided in an embodiment of the present invention. The embodiment of the present invention can be applicable to the scenario of decrypting encrypted messages. The method can be executed by a message processing device, which is applied to the receiving terminal and can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which is preferably a mobile terminal, a desktop computer, a laptop computer, a server, etc.

[0134] like Figure 2 As shown, the message processing method provided by the embodiment of the present invention may specifically include:

[0135] S201. After receiving an authentication message corresponding to a target message transmitted by a sending terminal, obtain a message authentication code and a ciphertext set included in the authentication message, where the ciphertext set is generated by the sending terminal through a determined first encryption result and a second encryption result.

[0136] In this embodiment, an authentication message corresponding to a target message transmitted by a sending terminal is received, and a message authentication code and a ciphertext set included in the authentication message are obtained. It can be understood that the ciphertext set includes a first encryption result and a second encryption result determined by the sending terminal.

[0137] S202. Perform a first decryption process on the ciphertext set using a homomorphic decryption strategy and a root key received in advance from a sending terminal to obtain a first decryption result.

[0138] The first decryption result may be understood as the decryption result of the binary bit sequence corresponding to the target message determined by the receiving terminal.

[0139] In this embodiment, the first decryption process is performed on the ciphertext set using the root key received in advance from the sending terminal through the homomorphic decryption strategy, that is, the second encryption result is removed and the first encryption result is decrypted to obtain the first decryption result.

[0140] S203, performing a second decryption process on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, restoring the target message according to the first decryption result.

[0141] The second decryption result may be understood as the result of the corresponding message authentication code determined by the receiving terminal.

[0142] In this embodiment, the second decryption processing is performed on the first decryption result, that is, the first decryption result is subjected to the processing performed by the sending terminal on the binary bit sequence of the target message, such as grouping, XOR operation and hash function processing, to determine the message authentication code corresponding to the first decryption result, that is, the second decryption result. The second decryption result is compared with the message authentication code to see if they are consistent. If they are the same, it indicates that the message verification is correct, that is, the first decryption result is consistent with the binary bit sequence of the target message, and the target message is obtained by performing the inverse operation of binary conversion on the first decryption result.

[0143] A message processing method provided by an embodiment of the present invention obtains a message authentication code and a ciphertext set included in the authentication message after receiving an authentication message corresponding to a target message transmitted by a sending terminal, wherein the ciphertext set is generated by the sending terminal through a determined first encryption result and a second encryption result; a first decryption process is performed on the ciphertext set through a homomorphic decryption strategy and a root key received in advance from the sending terminal to obtain a first decryption result; a second decryption process is performed on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, the target message is restored according to the first decryption result. This method performs a first decryption process on the ciphertext set through a homomorphic decryption strategy and a root key received in advance from the sending terminal, thereby improving the efficiency and security of obtaining the first decryption result; a second decryption result is obtained by performing a second decryption process on the first decryption result, and the target message is restored according to the consistency between the second decryption result and the message authentication code, thereby ensuring the accuracy of the receiving terminal obtaining the target message.

[0144] As a first optional embodiment of this embodiment, the ciphertext set may be subjected to a first decryption process using the homomorphic decryption strategy and the root key received in advance from the sending terminal to obtain a first decryption result, which may be specifically implemented as the following steps:

[0145] a6) Obtaining all ciphertext elements included in the ciphertext set, and performing homomorphic addition calculation on the ciphertext elements to obtain addition calculation results.

[0146] The ciphertext element can be understood as the element corresponding to each binary bit encryption in the first encryption result and each second encryption result in the ciphertext set. The addition calculation result can be understood as the result obtained after performing homomorphic addition calculation, which is used to retain only the first encryption result.

[0147] In this embodiment, all ciphertext elements included in the ciphertext set are obtained, and homomorphic addition calculation is performed on all ciphertext elements in the same position to restore the first encryption result, that is, to obtain the addition calculation result.

[0148] For example, if the ciphertext set includes , the addition calculation result is obtained The process can be expressed as: , will soon , and The ciphertext elements at the same position in are added.

[0149] It should be noted that if the second encryption result contained in the ciphertext set has a large value and the noise superposition in the ciphertext reaches or exceeds the threshold, the ciphertext needs to be refreshed to ensure that the homomorphic addition calculation and subsequent decryption of the addition calculation results can be executed normally.

[0150] b6) decrypting the addition calculation result according to the homomorphic decryption algorithm and the root key received in advance from the sending terminal to obtain a decrypted binary bit sequence with a sequence length of a set value.

[0151] The set value may be understood as the sequence length of the binary bit sequence of the target message.

[0152] In this embodiment, the addition calculation result is decrypted according to the homomorphic decryption algorithm and the root key received in advance from the sending terminal to obtain a decrypted binary bit sequence, and the sequence length of the decrypted binary bit sequence is a set value, that is, the same as the sequence length of the binary bit sequence of the target message.

[0153] It should be noted that the result of adding the homomorphic ciphertexts is the same as the result of adding the corresponding plaintexts after decryption. Therefore, if the authentication message has not been tampered with, the decrypted binary bit sequence is the binary bit sequence of the target message.

[0154] Exemplarily, following the above example description, according to the homomorphic decryption algorithm and the root key received in advance from the sending terminal , the addition result Decryption to obtain a decrypted binary bit sequence with a sequence length of the set value The process can be expressed as:

[0155] ;

[0156] in, To restore the target message corresponding to the decrypted binary bit sequence.

[0157] Understandably, Should be the same as the binary bit sequence of the target message Consistent, when The sequence length is When .

[0158] c6) determining the decrypted binary bit sequence as the first decryption result.

[0159] The above technical scheme of this embodiment can obtain the encryption result of the target message by performing homomorphic addition calculation on the ciphertext elements. There is no need for the receiving terminal to know the meaning or order of each encryption result in the ciphertext set, and no decryption is required during the calculation process, thereby ensuring data security during the calculation. At the same time, only the final addition calculation result of the homomorphic addition calculation needs to be decrypted, thereby reducing the number of decryption times and improving decryption efficiency.

[0160] As a second optional embodiment of this embodiment, the first decryption result may be subjected to a second decryption process to obtain a second decryption result, which is specifically optimized into the following steps:

[0161] a7) Obtaining a decrypted binary bit sequence representing the first decryption result.

[0162] In this embodiment, a decrypted binary bit sequence representing the first decryption result is obtained.

[0163] b7) dividing the decrypted binary bit sequence according to the key length of the generated verification key to obtain at least one decrypted subsequence, wherein the last decrypted subsequence obtained by the division has the key length after being padded with the determined padding length using the bit value.

[0164] In this embodiment, the receiving terminal generates a verification key using the received root key and verification key generation rule, and divides the decrypted binary bit sequence into at least one decrypted subsequence according to the key length of the generated verification key. If the sequence length of the last decrypted subsequence is less than the key length, the padding length is determined, that is, the number of bit values ​​required to fill the sequence length of the last decrypted subsequence to be the same as the key length, and then the last decrypted subsequence is padded at the end according to the determined padding length using the bit value (that is, 0 or 1) pre-agreed by both parties, so that the last decrypted subsequence after padding has the key length.

[0165] It is understandable that the key length of the verification key generated by the receiving terminal should be the same as the key length of the verification key generated by the sending terminal, and the number of decryption subsequences divided accordingly should be the same as the number of message subsequences divided by the sending terminal.

[0166] c7) performing an XOR operation on each of the decryption subsequences using the verification key, processing each of the XOR operation results using a first Hash function, and concatenating each of the first Hash results and processing them using a second Hash function to generate a decryption authentication code as a second decryption result.

[0167] The decryption authentication code may be understood as an authentication code used to compare with the message authentication code included in the authentication message to confirm whether the first decryption result obtained by decryption is correct.

[0168] In this embodiment, an XOR operation is performed on each of the decryption subsequences using a verification key, and each XOR operation result is processed by a first hash function to obtain each first hash result, and then the first hash results are concatenated and processed by a second hash function to generate a decryption authentication code, which is used as the second decryption result.

[0169] Exemplary, generate a decryption authentication code The process can be expressed as:

[0170] ;

[0171] in, For the A decryption subsequence.

[0172] The above technical scheme of this embodiment divides the decrypted binary bit sequence representing the first decryption result according to the key length of the verification key, obtains the decrypted subsequence and adaptively fills the last decrypted subsequence, and performs the same XOR operation and hash function processing as the sending end on the decrypted subsequence to generate a second decryption result corresponding to the message authentication code sent by the sending terminal, thereby verifying the correctness of the first decryption result to ensure that the restored target message is correct and prevent the target message content from being tampered with.

[0173] Figure 3 Schematic diagram of a message processing device applied to a sending terminal provided by an embodiment of the present invention. Figure 3 As shown, the device includes: a key acquisition module 31, a first encryption result determination module 32, a second encryption result determination module 33 and an authentication message sending module 34, wherein:

[0174] A key acquisition module 31 is used to acquire a target message and acquire a pre-generated verification key and an encryption key set, wherein the verification key and the encryption key set are pre-generated by the sending terminal through key negotiation with the receiving terminal based on a root key;

[0175] A first encryption result determination module 32, configured to determine a message authentication code of the target message according to the verification key, and to determine a first encryption result of the target message according to an encryption key in the encryption key set;

[0176] A second encryption result determination module 33, for determining a second encryption result of a set digital sequence according to the encryption key, the digital sequence being generated based on the target message;

[0177] The authentication message sending module 34 is used to generate an authentication message of the target message according to the message authentication code, the first encryption result and the second encryption result, and send the authentication message to the receiving terminal so that the receiving terminal performs message authentication and obtains the target message through decryption processing.

[0178] A message processing device provided by an embodiment of the present invention obtains a target message and obtains a pre-generated verification key and an encryption key set, wherein the verification key and the encryption key set are generated by a sending terminal in advance according to a root key through key negotiation with a receiving terminal; according to the verification key, a message authentication code of the target message is determined, and according to an encryption key in the encryption key set, a first encryption result of the target message is determined; according to the encryption key, a second encryption result of a set digital sequence is determined, and the digital sequence is generated based on the target message; according to the message authentication code, the first encryption result and the second encryption result, an authentication message of the target message is generated, and the authentication message is sent to the receiving terminal, so that the receiving terminal performs message authentication and obtains the target message through decryption processing. The method realizes the encryption of the message content and improves the security protection strength of the target message by flexibly selecting an encryption key from the encryption key set to determine the first encryption result of the target message, and by obtaining the second encryption result of the set digital sequence, and generating the authentication message of the target message based on the first encryption result and the second encryption result, the uncertainty of the position of the first encryption result is increased, thereby increasing the difficulty of cracking by the adversary, and further improving the privacy protection strength of the target message. Further, the message processing device also includes a negotiation generation module, which can be specifically used to:

[0179] Generate the root key by a key generation method of an asymmetric homomorphic encryption algorithm, and send the root key to a receiving terminal through a key exchange strategy;

[0180] The verification key and the encryption key set are generated according to the received key generation rule, wherein the key generation rule is generated based on the root key through negotiation with the receiving terminal.

[0181] Furthermore, the first encryption result determination module 32 may be specifically used for:

[0182] Convert the target message into a binary bit sequence, obtain a message sequence, and obtain the key length of the verification key;

[0183] Dividing the message sequence into a plurality of message subsequences respectively having the key length, wherein the last message subsequence obtained by the division has the key length after being padded with the determined padding length by means of the bit value;

[0184] For each message subsequence, perform an XOR operation on the message subsequence using the verification key, and generate an encrypted subsequence of the message subsequence by processing the XOR operation result obtained by the first Hash function;

[0185] The encrypted subsequences are concatenated and processed through a second hash function to generate the message authentication code.

[0186] Furthermore, the first encryption result determination module 32 may also be specifically used for:

[0187] Randomly selecting a key from the encryption key set as an encryption key;

[0188] Encrypting each binary bit in a target message represented by a binary bit sequence by a homomorphic encryption algorithm and the encryption key;

[0189] A first encryption result of the target message is formed based on the encryption result of each binary digit.

[0190] Furthermore, the second encryption result determination module 33 may be specifically used for:

[0191] Acquire a binary bit sequence of the target message, and generate at least one digital sequence having a sequence length that is the same as the sequence length of the binary bit sequence, wherein each bit in the digital sequence is a set bit value;

[0192] Each of the digital sequences is encrypted respectively by using a homomorphic encryption algorithm and the encryption key to obtain a second encryption result corresponding to each of the digital sequences.

[0193] Furthermore, the authentication message sending module 34 can be specifically used for:

[0194] Constructing a ciphertext set of the target message based on the first encryption result and the second encryption result;

[0195] Based on the ciphertext set and the message authentication code, an authentication message of the target message is constructed.

[0196] The message processing device provided by the embodiment of the present invention can execute the message processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0197] Figure 4 Schematic diagram of a message processing device applied to a receiving terminal provided by an embodiment of the present invention. Figure 4 As shown, the device includes: an authentication message receiving module 41, a first decryption result determining module 42 and a target message restoring module 43, wherein:

[0198] The authentication message receiving module 41 is used to obtain a message authentication code and a ciphertext set included in the authentication message after receiving the authentication message corresponding to the target message transmitted by the sending terminal, wherein the ciphertext set is generated by the sending terminal through the determined first encryption result and the second encryption result;

[0199] A first decryption result determination module 42, configured to perform a first decryption process on the ciphertext set by using a homomorphic decryption strategy and a root key received in advance from a sending terminal to obtain a first decryption result;

[0200] The target message restoration module 43 is used to perform a second decryption process on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, restore the target message according to the first decryption result.

[0201] A message processing device provided by an embodiment of the present invention obtains a message authentication code and a ciphertext set included in the authentication message after receiving an authentication message corresponding to a target message transmitted by a sending terminal, wherein the ciphertext set is generated by the sending terminal through a determined first encryption result and a second encryption result; performs a first decryption process on the ciphertext set through a homomorphic decryption strategy and a root key received in advance from the sending terminal to obtain a first decryption result; performs a second decryption process on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, restores the target message according to the first decryption result. This method performs a first decryption process on the ciphertext set through a homomorphic decryption strategy and a root key received in advance from the sending terminal, thereby improving the efficiency and security of obtaining the first decryption result; performs a second decryption process on the first decryption result to obtain a second decryption result, and restores the target message according to the consistency between the second decryption result and the message authentication code, thereby ensuring the accuracy of the receiving terminal obtaining the target message.

[0202] Furthermore, the first decryption result determination module 42 may be specifically used for:

[0203] Obtaining all ciphertext elements included in the ciphertext set, and performing homomorphic addition calculation on the ciphertext elements to obtain an addition calculation result;

[0204] Decrypting the addition calculation result according to the homomorphic decryption algorithm and the root key received in advance from the sending terminal to obtain a decrypted binary bit sequence with a sequence length of a set value;

[0205] The decrypted binary bit sequence is determined as the first decryption result.

[0206] Furthermore, the target message restoration module 43 can be specifically used for:

[0207] Obtaining a decrypted binary bit sequence representing a first decryption result;

[0208] Dividing the decrypted binary bit sequence according to the key length of the generated verification key to obtain at least one decrypted subsequence, wherein the last decrypted subsequence obtained by the division has the key length after being padded with the determined padding length by the bit value;

[0209] The verification key is used to perform an XOR operation on each of the decryption subsequences, and each of the XOR operation results is processed by a first Hash function, and the first Hash results are concatenated and processed by a second Hash function to generate a decryption authentication code as a second decryption result.

[0210] The message processing device provided by the embodiment of the present invention can execute the message processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0211] Figure 5 A schematic diagram of an electronic device 50 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0212] like Figure 5 As shown, the electronic device 50 includes at least one processor 51, and a memory connected to the at least one processor 51 in communication, such as a read-only memory (ROM) 52, a random access memory (RAM) 53, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 51 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 52 or the computer program loaded from the storage unit 58 to the random access memory (RAM) 53. In the RAM 53, various programs and data required for the operation of the electronic device 50 can also be stored. The processor 51, the ROM 52, and the RAM 53 are connected to each other through a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.

[0213] A number of components in the electronic device 50 are connected to the I / O interface 55, including: an input unit 56, such as a keyboard, a mouse, etc.; an output unit 57, such as various types of displays, speakers, etc.; a storage unit 58, such as a disk, an optical disk, etc.; and a communication unit 59, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 59 allows the electronic device 50 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0214] The processor 51 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 51 executes the various methods and processes described above, such as a message processing method.

[0215] In some embodiments, the message processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 58. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 50 via the ROM 52 and / or the communication unit 59. When the computer program is loaded into the RAM 53 and executed by the processor 51, one or more steps of the message processing method described above may be performed. Alternatively, in other embodiments, the processor 51 may be configured to perform the message processing method in any other appropriate manner (e.g., by means of firmware).

[0216] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0217] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0218] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0219] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0220] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0221] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0222] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0223] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A message processing method, characterized in that: Applicable to the sending terminal, including: Obtaining a target message, and obtaining a pre-generated verification key and an encryption key set, wherein the verification key and the encryption key set are pre-generated by the sending terminal through key negotiation with the receiving terminal based on a root key; Determine a message authentication code of the target message according to the verification key, and determine a first encryption result of the target message according to an encryption key in the encryption key set; Determining, according to the encryption key, a second encryption result of a set digital sequence, wherein the digital sequence is generated based on the target message; An authentication message of the target message is generated according to the message authentication code, the first encryption result and the second encryption result, and the authentication message is sent to a receiving terminal, so that the receiving terminal performs message authentication and obtains the target message through decryption processing.

2. The method according to claim 1, characterized in that The step of generating the verification key and the encryption key set by performing key negotiation with the receiving terminal according to the root key comprises: Generate the root key by a key generation method of an asymmetric homomorphic encryption algorithm, and send the root key to a receiving terminal through a key exchange strategy; The verification key and the encryption key set are generated according to the received key generation rule, wherein the key generation rule is generated based on the root key through negotiation with the receiving terminal.

3. The method according to claim 1, characterized in that The step of determining the message authentication code of the target message according to the verification key comprises: Convert the target message into a binary bit sequence, obtain a message sequence, and obtain the key length of the verification key; Dividing the message sequence into a plurality of message subsequences respectively having the key length, wherein the last message subsequence obtained by the division has the key length after being padded with the determined padding length by means of the bit value; For each message subsequence, perform an XOR operation on the message subsequence using the verification key, and generate an encrypted subsequence of the message subsequence by processing the XOR operation result obtained by the first Hash function; The encrypted subsequences are concatenated and processed through a second hash function to generate the message authentication code.

4. The method according to claim 1, characterized in that: The step of determining a first encryption result of the target message according to an encryption key in the encryption key set includes: Randomly selecting a key from the encryption key set as an encryption key; Encrypting each binary bit in a target message represented by a binary bit sequence by a homomorphic encryption algorithm and the encryption key; A first encryption result of the target message is formed based on the encryption result of each binary digit.

5. The method according to claim 1, characterized in that Determining a second encryption result of the set digital sequence according to the encryption key includes: Acquire a binary bit sequence of the target message, and generate at least one digital sequence having a sequence length that is the same as the sequence length of the binary bit sequence, wherein each bit in the digital sequence is a set bit value; Each of the digital sequences is encrypted respectively by using a homomorphic encryption algorithm and the encryption key to obtain a second encryption result corresponding to each of the digital sequences.

6. The method according to claim 1, characterized in that The step of generating an authentication message of the target message according to the message authentication code, the first encryption result, and the second encryption result includes: Constructing a ciphertext set of the target message based on the first encryption result and the second encryption result; Based on the ciphertext set and the message authentication code, an authentication message of the target message is constructed.

7. A message processing method, characterized in that: Applied to receiving terminals, including: After receiving the authentication message corresponding to the target message transmitted by the sending terminal, obtaining a message authentication code and a ciphertext set included in the authentication message, wherein the ciphertext set is generated by the sending terminal through the determined first encryption result and the second encryption result; Performing a first decryption process on the ciphertext set using a homomorphic decryption strategy and a root key received in advance from a sending terminal to obtain a first decryption result; Perform a second decryption process on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, restore the target message according to the first decryption result.

8. The method according to claim 7, characterized in that The step of performing a first decryption process on the ciphertext set using a homomorphic decryption strategy and a root key pre-received from a sending terminal to obtain a first decryption result includes: Obtaining all ciphertext elements included in the ciphertext set, and performing homomorphic addition calculation on the ciphertext elements to obtain an addition calculation result; Decrypting the addition calculation result according to the homomorphic decryption algorithm and the root key received in advance from the sending terminal to obtain a decrypted binary bit sequence with a sequence length of a set value; The decrypted binary bit sequence is determined as the first decryption result.

9. The method according to claim 7, characterized in that: The performing a second decryption process on the first decryption result to obtain a second decryption result includes: Obtaining a decrypted binary bit sequence representing a first decryption result; Dividing the decrypted binary bit sequence according to the key length of the generated verification key to obtain at least one decrypted subsequence, wherein the last decrypted subsequence obtained by the division has the key length after being padded with the determined padding length by the bit value; The verification key is used to perform an XOR operation on each of the decryption subsequences, and each of the XOR operation results is processed by a first Hash function, and the first Hash results are concatenated and processed by a second Hash function to generate a decryption authentication code as a second decryption result.

10. A message processing device, characterized in that: Applicable to the sending terminal, including: A key acquisition module, used to acquire a target message and acquire a pre-generated verification key and an encryption key set, wherein the verification key and the encryption key set are pre-generated by the sending terminal through key negotiation with the receiving terminal based on a root key; A first encryption result determination module, configured to determine a message authentication code of the target message according to the verification key, and determine a first encryption result of the target message according to an encryption key in the encryption key set; A second encryption result determination module, configured to determine a second encryption result of a set digital sequence according to the encryption key, wherein the digital sequence is generated based on the target message; The authentication message sending module is used to generate an authentication message of the target message according to the message authentication code, the first encryption result and the second encryption result, and send the authentication message to the receiving terminal so that the receiving terminal performs message authentication and obtains the target message through decryption processing.

11. A message processing device, characterized in that: Applied to receiving terminals, including: an authentication message receiving module, configured to, after receiving an authentication message corresponding to a target message transmitted by a sending terminal, obtain a message authentication code and a ciphertext set included in the authentication message, wherein the ciphertext set is generated by the sending terminal through the determined first encryption result and the second encryption result; A first decryption result determination module, configured to perform a first decryption process on the ciphertext set by using a homomorphic decryption strategy and a root key received in advance from a sending terminal to obtain a first decryption result; The target message restoration module is used to perform a second decryption process on the first decryption result to obtain a second decryption result, and when the second decryption result is consistent with the message authentication code, restore the target message according to the first decryption result.

12. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the message processing method according to any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the message processing method according to any one of claims 1 to 9 when executed.

14. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the message processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for message security

    CN108632218A

  • Message transmission method, message verification method, device, equipment, medium and product

    CN116684102A

  • Message transmission method and device, terminal, server and medium

    CN118057759A

  • Data security transmission method and system based on autonomous security interaction protocol

    CN118784337A

  • Method and apparatus for device and user authentication based on single EAP message in mobile communication system

    KR100789920B1