Communication method and device, electronic equipment, storage medium and program product

By using a preset symmetric encryption algorithm in the satellite voice communication system to encrypt voice data and adding frame identifiers to the initial ciphertext frame to form a target ciphertext frame, the problem of communication delay under the public key ciphertext system is solved. Lower communication latency and higher real-time performance are achieved.

CN119484094APending Publication Date: 2025-02-18CHINA SATELLITE NETWORK EXPLORATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411613366.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the existing satellite voice communication system, when voice data is encrypted through the public key cryptographic system, there is a problem of large communication delay.

Method used

The voice data is encrypted using a preset symmetric encryption algorithm to determine the plain text frames corresponding to the voice data, and encrypt each plain text frame through the encryption algorithm to obtain the initial cipher text frame, and add frame identifiers to each initial cipher text frame. , a target ciphertext frame is formed, and finally a target ciphertext frame is sent to the second terminal device.

Benefits of technology

The voice data is encrypted through a symmetric encryption algorithm, which reduces the time required for the key negotiation stage, thereby reducing communication delay and improving communication real-time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484094A_ABST
    Figure CN119484094A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a communication method and device, electronic equipment, a storage medium and a program product. The method is applied to a first terminal device and comprises the steps that at least one plaintext frame corresponding to voice data is determined, and the length of the plaintext frame is the encryption length corresponding to a preset symmetric encryption algorithm; performing encryption processing on each plaintext frame through the preset symmetric encryption algorithm to obtain at least one initial ciphertext frame, and adding a plurality of corresponding frame identifiers in each initial ciphertext frame to obtain at least one target ciphertext frame; and sending the at least one target ciphertext frame to a second terminal device. The method can reduce the communication delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular, to a communication method, device, electronic device, storage medium, and program product. Background Art

[0002] In satellite voice communication systems, voice data can be encrypted to ensure information security.

[0003] Currently, a public key cryptography system can be used to encrypt and decrypt voice data. However, there is a technical problem of large communication delay when encrypting voice data using the above method. Summary of the invention

[0004] The embodiments of the present application provide a communication method, device, electronic device, storage medium and program product, wherein the method can improve the real-time performance of communication.

[0005] In a first aspect, the present application provides a communication method, which is applied to a first terminal device, and the method includes:

[0006] Determine at least one plaintext frame corresponding to the voice data, wherein the length of the plaintext frame is an encryption length corresponding to a preset symmetric encryption algorithm;

[0007] Encrypt each plaintext frame using the preset symmetric encryption algorithm to obtain at least one initial ciphertext frame, and add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame;

[0008] The at least one target ciphertext frame is sent to the second terminal device.

[0009] In a possible implementation, determining at least one plaintext frame corresponding to the voice data includes:

[0010] Performing encoding processing on the voice data to obtain a plurality of voice subframes and a subframe identifier corresponding to each voice subframe, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in the plurality of voice subframes;

[0011] At least one plaintext frame corresponding to the voice data is determined according to the multiple voice subframes and the subframe identifiers corresponding to the voice subframes.

[0012] In a possible implementation, determining at least one plaintext frame corresponding to the voice data according to the multiple voice subframes and the subframe identifiers corresponding to the voice subframes includes:

[0013] Adding a corresponding subframe identifier to the head and tail of each speech subframe to obtain multiple target subframes;

[0014] At least one plaintext frame corresponding to the voice data is determined according to the multiple target subframes.

[0015] In a possible implementation manner, determining at least one plaintext frame corresponding to the voice data according to the multiple target subframes includes:

[0016] Determine, according to the subframe identifier included in each target subframe, at least one set from the multiple target subframes, the set including two consecutive target subframes, and the total length of the two consecutive target subframes is the encryption length corresponding to the preset symmetric encryption algorithm;

[0017] For any set, performing splicing processing on the target subframes in the set to obtain a plaintext frame corresponding to the set;

[0018] The at least one plaintext frame includes a plaintext frame corresponding to each set.

[0019] In a possible implementation, each plaintext frame is encrypted by the preset symmetric encryption algorithm to obtain at least one initial ciphertext frame, including:

[0020] Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0;

[0021] Generate a key corresponding to each plaintext frame according to the initial key and the initial sequence;

[0022] For any plaintext frame, encrypt the plaintext frame using the key corresponding to the plaintext frame to obtain an initial ciphertext frame corresponding to the plaintext frame;

[0023] The at least one initial ciphertext frame includes an initial ciphertext frame corresponding to each plaintext frame.

[0024] In a possible implementation, generating a key corresponding to each plaintext frame according to the initial key and the initial sequence includes:

[0025] Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence;

[0026] Generate an i+1th key corresponding to an i+1th plaintext frame according to the i-th key and the i-th sequence corresponding to the initial sequence, wherein the i-th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset algorithm;

[0027] Wherein, the i is 1, 2, 3, ... in sequence.

[0028] In a possible implementation, generating a first key corresponding to a first plaintext frame according to the initial key and the initial sequence includes:

[0029] Generate a first sub-initial key according to the first part of the initial key and the initial sequence, where the first part of the initial key is the first M bits of the initial key;

[0030] Generate a second sub-initial key according to the second part of the initial key, where the second part of the initial key is the first M bits of the initial key or the last N bits of the initial key;

[0031] The first sub-initial key and the second sub-initial key are concatenated to obtain an initial concatenated key, and a hash operation is performed on the initial concatenated key to generate a first key corresponding to the first plaintext frame.

[0032] In a possible implementation, generating a first sub-initial key according to the first part of the initial key and the initial sequence includes:

[0033] Performing an XOR operation on the first part of the initial key and the initial sequence to obtain a first operation result;

[0034] Perform a hash operation on the first operation result to obtain the first sub-initial key.

[0035] In a possible implementation, generating a second sub-initial key according to the second part of the initial key includes:

[0036] Perform a negation operation on the second part of the initial key to generate the second sub-initial key.

[0037] In a possible implementation, multiple corresponding frame identifiers are added to each initial ciphertext frame to obtain at least one target ciphertext frame, including:

[0038] For any initial ciphertext frame, determine a frame identifier corresponding to the initial ciphertext frame, and add a plurality of corresponding frame identifiers to the initial ciphertext frame to obtain a target ciphertext frame corresponding to the initial ciphertext frame, wherein the frame identifier is used to indicate an encryption order of the corresponding initial ciphertext frame in the at least one initial ciphertext frame;

[0039] The at least one target ciphertext frame includes: a target ciphertext frame corresponding to each initial ciphertext frame.

[0040] In a possible implementation, multiple corresponding frame identifiers are added to the initial ciphertext frame, including:

[0041] The corresponding frame identifiers are added to the head, middle and tail of the initial ciphertext frame.

[0042] In a second aspect, the present application provides a communication method, which is applied to a second terminal device, and the method includes:

[0043] Receive at least one target ciphertext frame sent by the first terminal device, the target ciphertext frame including an initial ciphertext frame and a plurality of corresponding frame identifiers, the initial ciphertext frame being obtained by encrypting a plaintext frame using a preset symmetric encryption algorithm, and the length of the plaintext frame being a decryption length corresponding to the preset symmetric encryption algorithm;

[0044] For any target ciphertext frame, according to the frame identifier in the target ciphertext frame, an initial ciphertext frame in the target ciphertext frame is decrypted by the preset algorithm to obtain a plaintext frame corresponding to the target ciphertext frame;

[0045] The voice data is determined according to the plaintext frame corresponding to each target ciphertext frame.

[0046] In a possible implementation, according to the frame identifier in the target ciphertext frame, decrypting the initial ciphertext frame in the target ciphertext frame by using the preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame includes:

[0047] Determining the frame length of the target ciphertext frame;

[0048] Performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result, wherein the verification result is verification passed or verification failed;

[0049] When the verification result is that the verification is passed, the initial ciphertext frame is extracted from the target ciphertext frame according to the frame length, and the initial ciphertext frame is decrypted by the preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

[0050] In a possible implementation, performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result includes:

[0051] Determining whether the frame length is within a preset range;

[0052] If yes, performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result;

[0053] If not, it is determined that the verification result is verification failure.

[0054] In a possible implementation, the frame length is equal to a preset length; and the target ciphertext frame is verified according to the frame length and a frame identifier in the target ciphertext frame to obtain a verification result, including:

[0055] extracting the plurality of frame identifiers at a plurality of first preset positions in the target ciphertext frame,

[0056] If at least two frame identifiers among the multiple frame identifiers are the same, determining that the verification result is a verification pass;

[0057] If the multiple frame identifiers are not the same, determining that the verification result is verification failure;

[0058] The frame identifier in the target ciphertext frame includes the multiple frame identifiers.

[0059] In a possible implementation, the frame length is less than a preset length; and the target ciphertext frame is verified according to the frame length and a frame identifier in the target ciphertext frame to obtain a verification result, including:

[0060] Extracting a first frame identifier from a header of the target ciphertext frame, and extracting a second frame identifier from a tail of the target ciphertext frame;

[0061] If the first frame identifier and the second frame identifier are the same, determining that the verification result is verification passed;

[0062] If the first frame identifier and the second frame identifier are different, determining a first target position and a second target position according to a frame identifier length of the frame identifier and the preset length, extracting a third frame identifier at the first target position, and extracting a fourth frame identifier at the second target position, and determining the verification result according to the first frame identifier, the second frame identifier, the third frame identifier, and the fourth frame identifier;

[0063] The frame identifier in the target ciphertext frame includes the first frame identifier, the second frame identifier, the third frame identifier and the fourth frame identifier.

[0064] In a possible implementation manner, determining the verification result according to the first frame identifier, the second frame identifier, the third frame identifier, and the fourth frame identifier includes:

[0065] If the first frame identifier and the third frame identifier are the same, or the second frame identifier and the fourth frame identifier are the same, determining that the verification result is verification passed;

[0066] If the first frame identifier and the third frame identifier are different, and the second frame identifier and the fourth frame identifier are different, it is determined that the verification result is verification failure.

[0067] In a possible implementation, the frame length is equal to a preset length; and extracting the initial ciphertext frame from the target ciphertext frame according to the frame length includes:

[0068] Data other than the multiple frame identifiers is extracted from the target ciphertext frame, and the extracted data is determined as the initial ciphertext frame.

[0069] In a possible implementation manner, the frame length is less than a preset length; and extracting the initial ciphertext frame from the target ciphertext frame according to the frame length includes:

[0070] Extract data from after the first frame identifier and before the third frame identifier in the target ciphertext frame, and extract data from after the fourth frame identifier and before the second frame identifier in the target ciphertext frame, and determine the extracted data as the initial ciphertext frame.

[0071] In a possible implementation, decrypting the initial ciphertext frame by using the preset algorithm to obtain a plaintext frame corresponding to the target ciphertext frame includes:

[0072] Determining a key corresponding to the target ciphertext frame according to a frame identifier in the target ciphertext frame;

[0073] The initial ciphertext frame is decrypted according to the key corresponding to the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame.

[0074] In a possible implementation, determining a key corresponding to the target ciphertext frame according to a frame identifier in the target ciphertext frame includes:

[0075] Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0;

[0076] Generate multiple keys according to the initial key and the initial sequence;

[0077] According to the frame identifier in the target ciphertext frame, a key corresponding to the target ciphertext frame is determined from the multiple keys.

[0078] In a possible implementation, multiple keys are generated according to the initial key and the initial sequence, including:

[0079] Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence;

[0080] Generate an (i+1)th key according to the (i)th key and the (i)th sequence corresponding to the initial sequence, wherein the (i)th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset change algorithm;

[0081] Wherein, the i is 1, 2, 3, ... in sequence.

[0082] In a possible implementation, determining, according to a frame identifier in the target ciphertext frame, a key corresponding to the target ciphertext frame from among the multiple keys includes:

[0083] Determine a target frame identifier according to a frame identifier in the target ciphertext frame, wherein the target frame identifier is used to indicate a decryption order of the target ciphertext frame, and a generation order of a key corresponding to the target ciphertext frame among the multiple keys corresponds to the target frame identifier;

[0084] The target frame identifiers are two identical frame identifiers in the target ciphertext frame.

[0085] In a possible implementation, determining voice data according to a plaintext frame corresponding to each target ciphertext frame includes:

[0086] For any plaintext frame, perform verification processing on the plaintext frame to obtain a verification result, where the verification result is verification passed or verification failed;

[0087] For any plaintext frame, when the verification result is verification passed, extracting a first voice subframe and a second voice subframe included in the plaintext frame;

[0088] The voice data is determined according to the first voice subframe and the second voice subframe included in each plaintext frame.

[0089] In a possible implementation, performing verification processing on the plaintext frame to obtain verification processing includes:

[0090] Determine that the first W bits in the plaintext frame are the first subframe identifier, the forward W bits at one-half of the plaintext frame are the second subframe identifier, the backward W bits at one-half of the plaintext frame are the third subframe identifier, and the rear W bits of the plaintext frame are the fourth subframe identifier;

[0091] If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier meet a preset condition, determining that the verification result is verification passed;

[0092] If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier do not meet a preset condition, it is determined that the verification result is verification failure.

[0093] In a possible implementation, the preset condition includes at least one of the following:

[0094] The difference between the fourth subframe identifier and the first subframe identifier is 1;

[0095] The difference between the third subframe identifier and the second subframe identifier is 1;

[0096] The first subframe identifier is equal to the second subframe identifier, and the difference between the third subframe identifier and the first subframe identifier is 1; or,

[0097] A difference between the fourth subframe identifier and the second subframe identifier is 1, and a difference between the third subframe identifier and the first subframe identifier is 1.

[0098] In a possible implementation, extracting the first voice subframe and the second voice subframe included in the plaintext frame includes:

[0099] extracting data between the first subframe identifier and the second subframe identifier as a first voice subframe; and,

[0100] Data between the third subframe identifier and the fourth subframe identifier is extracted as a second voice subframe.

[0101] In a possible implementation, determining voice data according to a first voice subframe and a second voice subframe included in each plaintext frame includes:

[0102] For any plaintext frame, determine the first subframe identifier and / or the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier and / or the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in multiple voice subframes;

[0103] According to the order of each voice subframe in the plurality of voice subframes, the first voice subframe and the second voice subframe in each plaintext frame are concatenated to obtain voice data.

[0104] In a third aspect, the present application provides a communication device, which is applied to a first terminal device, and includes a determination module, an encryption module, and a sending module, wherein:

[0105] The determination module is used to determine at least one plaintext frame corresponding to the voice data, the length of the plaintext frame being the encryption length corresponding to the preset algorithm;

[0106] The encryption module is used to encrypt each plaintext frame by using the preset encryption algorithm to obtain at least one initial ciphertext frame, and add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame;

[0107] The sending module is used to send the at least one target ciphertext frame to the second terminal device.

[0108] In a possible implementation, the determining module is specifically configured to:

[0109] Performing encoding processing on the voice data to obtain a plurality of voice subframes and a subframe identifier corresponding to each voice subframe, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in the plurality of voice subframes;

[0110] At least one plaintext frame corresponding to the voice data is determined according to the multiple voice subframes and the subframe identifiers corresponding to the voice subframes.

[0111] In a possible implementation, the determining module is specifically configured to:

[0112] Adding a corresponding subframe identifier to the head and tail of each speech subframe to obtain multiple target subframes;

[0113] At least one plaintext frame corresponding to the voice data is determined according to the multiple target subframes.

[0114] In a possible implementation, the determining module is specifically configured to:

[0115] Determine, according to the subframe identifier included in each target subframe, at least one set from the multiple target subframes, the set including two consecutive target subframes, and the total length of the two consecutive target subframes is the encryption length corresponding to the preset symmetric encryption algorithm;

[0116] For any set, performing splicing processing on the target subframes in the set to obtain a plaintext frame corresponding to the set;

[0117] The at least one plaintext frame includes a plaintext frame corresponding to each set.

[0118] In a possible implementation, the encryption module is specifically used to:

[0119] Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0;

[0120] Generate a key corresponding to each plaintext frame according to the initial key and the initial sequence;

[0121] For any plaintext frame, encrypt the plaintext frame using the key corresponding to the plaintext frame to obtain an initial ciphertext frame corresponding to the plaintext frame;

[0122] The at least one initial ciphertext frame includes an initial ciphertext frame corresponding to each plaintext frame.

[0123] In a possible implementation, the encryption module is specifically used to:

[0124] Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence;

[0125] Generate an i+1th key corresponding to an i+1th plaintext frame according to the i-th key and the i-th sequence corresponding to the initial sequence, wherein the i-th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset algorithm;

[0126] Wherein, the i is 1, 2, 3, ... in sequence.

[0127] In a possible implementation, the encryption module is specifically used to:

[0128] Generate a first sub-initial key according to the first part of the initial key and the initial sequence, where the first part of the initial key is the first M bits of the initial key;

[0129] Generate a second sub-initial key according to the second part of the initial key, where the second part of the initial key is the first M bits of the initial key or the last N bits of the initial key;

[0130] The first sub-initial key and the second sub-initial key are concatenated to obtain an initial concatenated key, and a hash operation is performed on the initial concatenated key to generate a first key corresponding to the first plaintext frame.

[0131] In a possible implementation, the encryption module is specifically used to:

[0132] Performing an XOR operation on the first part of the initial key and the initial sequence to obtain a first operation result;

[0133] Perform a hash operation on the first operation result to obtain the first sub-initial key.

[0134] In a possible implementation, the encryption module is specifically used to:

[0135] Perform a negation operation on the second part of the initial key to generate the second sub-initial key.

[0136] In a possible implementation, the encryption module is specifically used to:

[0137] For any initial ciphertext frame, determine a frame identifier corresponding to the initial ciphertext frame, and add a plurality of corresponding frame identifiers to the initial ciphertext frame to obtain a target ciphertext frame corresponding to the initial ciphertext frame, wherein the frame identifier is used to indicate an encryption order of the corresponding initial ciphertext frame in the at least one initial ciphertext frame;

[0138] The at least one target ciphertext frame includes: a target ciphertext frame corresponding to each initial ciphertext frame.

[0139] In a possible implementation, the encryption module is specifically used to:

[0140] The corresponding frame identifiers are added to the head, middle and tail of the initial ciphertext frame.

[0141] In a fourth aspect, the present application provides a communication device, which is applied to a second terminal device, and includes a receiving module, a decryption module, and a determination module, wherein:

[0142] The receiving module is used to receive at least one target ciphertext frame sent by the first terminal device, the target ciphertext frame includes an initial ciphertext frame and a plurality of corresponding frame identifiers, the initial ciphertext frame is obtained by encrypting a plaintext frame using a preset algorithm, and the length of the plaintext frame is a decryption length corresponding to the preset algorithm;

[0143] For any target ciphertext frame, the decryption module is used to, according to the frame identifier in the target ciphertext frame, perform decryption processing on the initial ciphertext frame in the target ciphertext frame by using the preset algorithm to obtain a plaintext frame corresponding to the target ciphertext frame;

[0144] The determination module is used to determine the voice data according to the plaintext frame corresponding to each target ciphertext frame.

[0145] In a possible implementation, the decryption module is specifically used to:

[0146] Determining the frame length of the target ciphertext frame;

[0147] Performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result, wherein the verification result is verification passed or verification failed;

[0148] When the verification result is that the verification is passed, the initial ciphertext frame is extracted from the target ciphertext frame according to the frame length, and the initial ciphertext frame is decrypted by the preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

[0149] In a possible implementation, the decryption module is specifically used to:

[0150] Determining whether the frame length is within a preset range;

[0151] If yes, performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result;

[0152] If not, it is determined that the verification result is verification failure.

[0153] In a possible implementation, the frame length is equal to a preset length, and the decryption module is specifically configured to:

[0154] extracting the plurality of frame identifiers at a plurality of first preset positions in the target ciphertext frame,

[0155] If at least two frame identifiers among the multiple frame identifiers are the same, determining that the verification result is a verification pass;

[0156] If the multiple frame identifiers are not the same, determining that the verification result is verification failure;

[0157] The frame identifier in the target ciphertext frame includes the multiple frame identifiers.

[0158] In a possible implementation, the frame length is less than a preset length, and the decryption module is specifically configured to:

[0159] Extracting a first frame identifier from a header of the target ciphertext frame, and extracting a second frame identifier from a tail of the target ciphertext frame;

[0160] If the first frame identifier and the second frame identifier are the same, determining that the verification result is verification passed;

[0161] If the first frame identifier and the second frame identifier are different, determining a first target position and a second target position according to a frame identifier length of the frame identifier and the preset length, extracting a third frame identifier at the first target position, and extracting a fourth frame identifier at the second target position, and determining the verification result according to the first frame identifier, the second frame identifier, the third frame identifier, and the fourth frame identifier;

[0162] The frame identifier in the target ciphertext frame includes the first frame identifier, the second frame identifier, the third frame identifier and the fourth frame identifier.

[0163] In a possible implementation, the decryption module is specifically used to:

[0164] If the first frame identifier and the third frame identifier are the same, or the second frame identifier and the fourth frame identifier are the same, determining that the verification result is verification passed;

[0165] If the first frame identifier and the third frame identifier are different, and the second frame identifier and the fourth frame identifier are different, it is determined that the verification result is verification failure.

[0166] In a possible implementation, the frame length is equal to a preset length, and the decryption module is specifically configured to:

[0167] Data other than the multiple frame identifiers is extracted from the target ciphertext frame, and the extracted data is determined as the initial ciphertext frame.

[0168] In a possible implementation, the frame length is less than a preset length, and the decryption module is specifically configured to:

[0169] Extract data from after the first frame identifier and before the third frame identifier in the target ciphertext frame, and extract data from after the fourth frame identifier and before the second frame identifier in the target ciphertext frame, and determine the extracted data as the initial ciphertext frame.

[0170] In a possible implementation, the decryption module is specifically used to:

[0171] Determining a key corresponding to the target ciphertext frame according to a frame identifier in the target ciphertext frame;

[0172] The initial ciphertext frame is decrypted according to the key corresponding to the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame.

[0173] In a possible implementation, the decryption module is specifically used to:

[0174] Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0;

[0175] Generate multiple keys according to the initial key and the initial sequence;

[0176] According to the frame identifier in the target ciphertext frame, a key corresponding to the target ciphertext frame is determined from the multiple keys.

[0177] In a possible implementation, the decryption module is specifically used to:

[0178] Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence;

[0179] Generate an (i+1)th key according to the (i)th key and the (i)th sequence corresponding to the initial sequence, wherein the (i)th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset change algorithm;

[0180] Herein, the i is 1, 2, 3, ... in sequence.

[0181] In a possible implementation, the decryption module is specifically used to:

[0182] Determine a target frame identifier according to a frame identifier in the target ciphertext frame, wherein the target frame identifier is used to indicate a decryption order of the target ciphertext frame, and a generation order of a key corresponding to the target ciphertext frame among the multiple keys corresponds to the target frame identifier;

[0183] The target frame identifiers are two identical frame identifiers in the target ciphertext frame.

[0184] In a possible implementation, the determining module is specifically configured to:

[0185] For any plaintext frame, perform verification processing on the plaintext frame to obtain a verification result, where the verification result is verification passed or verification failed;

[0186] For any plaintext frame, when the verification result is verification passed, extracting a first voice subframe and a second voice subframe included in the plaintext frame;

[0187] The voice data is determined according to the first voice subframe and the second voice subframe included in each plaintext frame.

[0188] In a possible implementation, the determining module is specifically configured to:

[0189] Determine that the first W bits in the plaintext frame are the first subframe identifier, the forward W bits at one-half of the plaintext frame are the second subframe identifier, the backward W bits at one-half of the plaintext frame are the third subframe identifier, and the rear W bits of the plaintext frame are the fourth subframe identifier;

[0190] If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier meet a preset condition, determining that the verification result is verification passed;

[0191] If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier do not meet a preset condition, it is determined that the verification result is verification failure.

[0192] In a possible implementation, the preset condition includes at least one of the following:

[0193] The difference between the fourth subframe identifier and the first subframe identifier is 1;

[0194] The difference between the third subframe identifier and the second subframe identifier is 1;

[0195] The first subframe identifier is equal to the second subframe identifier, and the difference between the third subframe identifier and the first subframe identifier is 1; or,

[0196] A difference between the fourth subframe identifier and the second subframe identifier is 1, and a difference between the third subframe identifier and the first subframe identifier is 1.

[0197] In a possible implementation, the determining module is specifically configured to:

[0198] extracting data between the first subframe identifier and the second subframe identifier as a first voice subframe; and,

[0199] Data between the third subframe identifier and the fourth subframe identifier is extracted as a second voice subframe.

[0200] In a possible implementation, the determining module is specifically configured to:

[0201] For any plaintext frame, determine the first subframe identifier and / or the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier and / or the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in multiple voice subframes;

[0202] According to the order of each voice subframe in the plurality of voice subframes, the first voice subframe and the second voice subframe in each plaintext frame are concatenated to obtain voice data.

[0203] In a fifth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0204] The memory stores computer-executable instructions;

[0205] The processor executes the computer-executable instructions stored in the memory to implement the method described in any one of the first aspects.

[0206] In a sixth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0207] The memory stores computer-executable instructions;

[0208] The processor executes the computer-executable instructions stored in the memory to implement the method described in any one of the second aspects.

[0209] In a seventh aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.

[0210] In an eighth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the second aspects.

[0211] In a ninth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a computer, implements the method as described in any one of the first aspects.

[0212] In a tenth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a computer, implements the method as described in any one of the second aspects.

[0213] The embodiments of the present application provide a communication method, apparatus, electronic device, storage medium and program product. In the communication method, the first terminal device can determine at least one plaintext frame corresponding to the voice data; each plaintext frame can be encrypted by a preset symmetric encryption algorithm to obtain at least one initial ciphertext frame; multiple corresponding frame identifiers can be added to each initial ciphertext frame to obtain at least one target ciphertext frame; and at least one target ciphertext frame can be sent to the second terminal device. In the above method, the first terminal device can encrypt the voice data to be sent to the second terminal device by a symmetric encryption algorithm, which reduces the time required for the key negotiation phase and thus reduces the communication delay. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0215] Figure 1 A schematic diagram of a MELP encoding process provided in an embodiment of the present application;

[0216] Figure 2 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0217] Figure 3A flow chart of a communication method provided in an embodiment of the present application;

[0218] Figure 4 A schematic diagram of a plaintext frame structure provided in an embodiment of the present application;

[0219] Figure 5 A schematic diagram of generating a target ciphertext frame provided in an embodiment of the present application;

[0220] Figure 6 A flowchart of another communication method provided in an embodiment of the present application;

[0221] Fig. 7A A schematic diagram of an initial key provided in an embodiment of the present application;

[0222] Figure 7B Another schematic diagram of an initial key provided in an embodiment of the present application;

[0223] Figure 8 A flowchart of another communication method provided in an embodiment of the present application;

[0224] Fig. 9 A flowchart of another communication method provided in an embodiment of the present application;

[0225] Fig.10 A schematic diagram of a frame identifier in a target ciphertext frame provided in an embodiment of the present application;

[0226] Fig.11 A flowchart of another communication method provided in an embodiment of the present application;

[0227] Fig.12 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0228] Fig.13 A schematic diagram of the structure of another communication device provided in an embodiment of the present application;

[0229] Fig.14 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0230] These drawings and textual descriptions are not intended to limit the scope of the present application in any way, but rather to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0231] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0232] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0233] The embodiments of the present application relate to Mixed-Excitation Linear Prediction (MELP) coding. First, MELP coding is described.

[0234] MELP coding is a common voice compression coding scheme in satellite mobile communication systems. MELP coding takes into account both low coding rate and high voice quality, thus better improving bandwidth utilization in satellite voice communication.

[0235] Next, combine Figure 1 , the MELP encoding process is explained.

[0236] Figure 1 A schematic diagram of a MELP encoding process provided in an embodiment of the present application. Figure 1 After inputting the original speech data into the encoder, the encoder may perform sampling and framing processing on the original speech data to obtain Q subframes, where Q is an integer greater than or equal to 1. The subframe identifier (ID) of the first subframe in the Q subframes may be 1.

[0237] Starting from the first subframe, the encoder can extract and quantize multiple parameters in the subframe, generate synchronization bits, form a speech subframe based on the synchronization bits and the quantized multiple parameters, and output the speech subframe until the speech subframes corresponding to all subframes are output and the encoding is completed.

[0238] The standard 2.4kbps rate MELP coding has a sampling rate of 8kHz, 180 samples per frame, 54 quantization bits, and a frame length of 22.5ms. The encoded framing bit allocation is divided into two parts: information bits and synchronization bits. Below, combined with Table 1, the parameters of the 2.4kbps rate MELP coding quantization and the bit allocation of each parameter are explained.

[0239] Table 1

[0240]

[0241]

[0242] As shown in Table 1, for a voiced frame, the parameters of the information bit may include a Line Spectral Frequencies (LSF) parameter, a pitch period, a gain, a non-periodic flag bit, a Fourier harmonic spectrum, and a sub-band voiced and unvoiced sound decision. The LSF parameter may correspond to 25 bits, the pitch period may correspond to 7 bits, the gain may correspond to 8 bits, the non-periodic flag bit may correspond to 1 bit, the Fourier harmonic spectrum may correspond to 8 bits, and the sub-band voiced and unvoiced sound decision may correspond to 4 bits. The parameters of the synchronization bit may include a synchronization bit bit, and the synchronization bit bit may correspond to 1 bit. The total number of bits of the voiced frame may be 54 bits.

[0243] For the unvoiced frame, the information bit parameters may include LSF parameters, pitch period, gain, and error correction coding. The LSF parameters may correspond to 25 bits, the pitch period may correspond to 7 bits, the gain may correspond to 8 bits, and the error correction coding may correspond to 4 bits. The synchronization bit parameters may include synchronization bit bits, and the synchronization bit bits may correspond to 1 bit. The total number of bits of the unvoiced frame may be 54 bits.

[0244] The embodiments of the present application relate to the Advanced Encryption Standard (AES) encryption algorithm, and the AES encryption algorithm is described below.

[0245] The internal functions involved in the AES encryption algorithm are relatively simple, and the consumption of software and hardware computing resources is low, so it can have a faster computing speed. It is more suitable for encryption and decryption of data generated in business scenarios such as satellite voice communications, which have high requirements for real-time, data volume, and security, but relatively limited encryption computing resources.

[0246] The plaintext size of each encryption of the AES encryption algorithm is 128 bits, and the key length is at least 128 bits. When AES encrypts data, the data can be divided into 128-bit data blocks, and a key of at least 128 bits can be used to encrypt each data block separately to achieve the purpose of AES encryption of data. Therefore, for attackers, even in the case of exhaustive attacks, the key attack is still necessary. 128 Therefore, it can be considered that the AES algorithm has good anti-attack and security against most attack methods.

[0247] For ease of understanding, the following Figure 2 , the application scenarios of the embodiments of the present application are described.

[0248] Figure 2 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 2 , the sending end can conduct voice communication with the receiving end through the satellite communication network.

[0249] like Figure 2 As shown, the transmitter can generate original audio through a signal source, and can perform voice compression encoding, encryption, channel coding, and pulse modulation on the original audio in sequence, and can send the modulated voice data to the ground station through a radio frequency module.

[0250] The ground station can send the modulated and processed voice data to the satellite communication network through the satellite-to-ground uplink.

[0251] The satellite communication network can send modulated and processed voice data to the ground station via the satellite-to-ground downlink.

[0252] The receiving end can receive the modulated voice data sent by the ground station through the RF module, and can sequentially perform demodulation and sampling processing, channel decoding processing, decryption processing, and voice decoding and synthesis processing on the modulated voice data to obtain synthesized audio, and can play the synthesized audio through the destination.

[0253] At present, in order to ensure the secure transmission of voice data, the sender and the receiver can encrypt and decrypt the voice data through the public key cryptography system.

[0254] Specifically, before the sender and the receiver communicate, they can negotiate the encryption key and the decryption key. During the key negotiation phase, the sender and the receiver usually use error retransmission to ensure the accuracy of the transmitted data. However, during the key negotiation phase, the sender and the receiver need to transmit a large amount of data, and the data over voice (DoV) transmission link itself has a high bit error rate, which further increases the amount of data that needs to be transmitted, resulting in a longer time required for the key negotiation phase, resulting in a longer communication delay.

[0255] In view of this, an embodiment of the present application provides a communication method, in which a sender and a receiver can encrypt and decrypt voice data by a symmetric encryption algorithm. For example, the symmetric encryption algorithm can be an AES encryption algorithm. The sender and the receiver can store or negotiate a symmetric key in advance, and in the above method, the amount of data to be transmitted when negotiating the symmetric key is small, which reduces the time required for the key negotiation phase and reduces the communication delay.

[0256] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0257] Figure 3 A flow chart of a communication method provided in an embodiment of the present application. The execution subject of the method may be a first terminal device, or a communication device set in the first terminal device. For example, the first terminal device may be a transmitter. The communication device may be implemented by software, or by a combination of software and hardware. For ease of understanding, the following description is made by taking the execution subject as the first terminal device as an example. Figure 3 , the method may include:

[0258] S301. Determine at least one plaintext frame corresponding to voice data.

[0259] In this embodiment, the first terminal device can encode the voice data to obtain multiple voice subframes and subframe identifiers corresponding to each voice subframe, where the subframe identifier is used to indicate the order of the corresponding voice subframe in the multiple voice subframes; based on the multiple voice subframes and the subframe identifiers corresponding to each voice subframe, determine at least one plaintext frame corresponding to the voice data.

[0260] The voice data may be voice data to be transmitted from the first terminal device to the second terminal device.

[0261] The encoding process may be a MELP encoding process. Optionally, the encoding process may be a MELP encoding process at a standard 2.4 kbps rate.

[0262] It should be noted that the process of encoding the voice data by the first terminal device can be referred to Figure 1 The speech subframe can be Figure 1 In the example, a speech subframe composed of a synchronization bit and a plurality of quantized parameter bits; a subframe identifier corresponding to the speech subframe may be a subframe ID corresponding to the speech subframe.

[0263] The length of the plaintext frame is the encryption length corresponding to the preset symmetric encryption algorithm.

[0264] The preset symmetric encryption algorithm may be an AES encryption algorithm. It should be understood that the encryption length corresponding to the AES encryption algorithm may be 128 bits. Thus, the length of the plaintext frame may be 128 bits.

[0265] It can be seen from Table 1 that the length of the speech subframe after the MELP coding process at the standard 2.4 kbps rate can be 54 bits.

[0266] For any speech subframe, multiple corresponding subframe identifiers may be added to the speech subframe to obtain a target subframe corresponding to the speech subframe.

[0267] In a possible implementation, the subframe identifier can be represented by a character with a length of 5 bits. The first terminal device can add two corresponding subframe identifiers to the voice subframe to obtain a target subframe corresponding to the voice subframe. It should be understood that the length of the target subframe is 64 bits.

[0268] In a possible implementation, a corresponding subframe identifier can be added to the head and tail of the voice subframe to obtain a target subframe corresponding to the voice subframe. In this way, the information bit of the voice subframe can be prevented from becoming the head or tail of the plaintext frame, thereby achieving the purpose of protecting the information bit of the voice subframe.

[0269] When determining at least one plaintext frame corresponding to the voice data based on multiple voice subframes and subframe identifiers corresponding to each voice subframe, the first terminal device can splice the target subframes corresponding to two consecutive voice subframes to obtain a plaintext frame until the splicing of the target subframes corresponding to all voice subframes is completed.

[0270] In this embodiment, a corresponding subframe identifier can be added to the voice subframe to form a target subframe, and two consecutive target subframes can be spliced ​​to obtain a plaintext frame. Through the above method, on the one hand, two voice subframes can be integrated into a plaintext frame to be encrypted; on the other hand, the two voice subframes included in the plaintext frame are two consecutive voice subframes, so that the receiving end can determine two consecutive voice subframes based on the plaintext frame, so that the probability of the voice subframes determined by the receiving end being discontinuous is small.

[0271] Next, take any two consecutive speech subframes as an example, combined with Figure 4 , the process of determining the plaintext frame is explained.

[0272] Figure 4 A schematic diagram of a plaintext frame structure provided in an embodiment of the present application. Figure 4 , the voice subframe A may include information bits and synchronization bits, the length of the information bits may be 53 bits, and the length of the synchronization bits may be 1 bit. The voice subframe B may include information bits and synchronization bits, the length of the information bits may be 53 bits, and the length of the synchronization bits may be 1 bit.

[0273] After adding the subframe identifier corresponding to the voice subframe to the head and tail of the voice subframe A respectively, the target subframe corresponding to the voice subframe A can be obtained. The length of the target subframe corresponding to the voice subframe A can be 64 bits.

[0274] After adding the subframe identifier corresponding to the voice subframe to the head and tail of the voice subframe B respectively, the target subframe corresponding to the voice subframe B can be obtained. The length of the target subframe corresponding to the voice subframe B can be 64 bits.

[0275] After concatenating the target subframe corresponding to the voice subframe A and the target subframe corresponding to the voice subframe B, a plaintext frame may be obtained. The length of the plaintext frame may be 128 bits.

[0276] S302: Encrypt each plaintext frame using a preset symmetric encryption algorithm to obtain at least one initial ciphertext frame.

[0277] The at least one initial ciphertext frame may include an initial ciphertext frame corresponding to each plaintext frame.

[0278] In this embodiment, the preset symmetric encryption algorithm may be an AES encryption algorithm.

[0279] Specifically, the first terminal device may encrypt each plaintext frame using an AES encryption algorithm to obtain an initial ciphertext frame corresponding to each plaintext frame.

[0280] In this embodiment, the first terminal device and the second terminal device may negotiate to obtain a key corresponding to the AES encryption algorithm before communicating.

[0281] It should be noted that when the first terminal device and the second terminal device negotiate to obtain the key corresponding to the AES encryption algorithm, the amount of data that needs to be transmitted is much smaller than the amount of data that needs to be transmitted when the communicating parties negotiate the key in the public key cryptography system, which makes the communication delay smaller.

[0282] S303: Add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame.

[0283] It should be noted that, in this embodiment, at least one plaintext frame may be encrypted in ascending order according to the subframe identifiers included in the plaintext frame header to obtain at least one target ciphertext frame.

[0284] The frame identifier corresponding to the initial ciphertext frame may be used to indicate the encryption order of the initial ciphertext frame in at least one initial ciphertext frame.

[0285] The at least one target ciphertext frame includes: a target ciphertext frame corresponding to each initial ciphertext frame.

[0286] It should be noted that the method of adding multiple corresponding frame identifiers to each initial ciphertext frame to obtain the target ciphertext frame is consistent. The following takes any initial ciphertext frame as an example to illustrate the method of adding multiple corresponding frame identifiers to the initial ciphertext frame to obtain the target ciphertext frame.

[0287] For any initial ciphertext frame, the first terminal device can determine the frame identifier corresponding to the initial ciphertext frame, and add multiple corresponding frame identifiers in the initial ciphertext frame to obtain the target ciphertext frame corresponding to the initial ciphertext frame. The frame identifier is used to indicate the corresponding initial ciphertext frame and the encryption order in at least one initial ciphertext frame.

[0288] Furthermore, when a plurality of corresponding frame identifiers are added to the initial ciphertext frame, the corresponding frame identifiers may be added to the head, middle, and tail of the initial ciphertext frame.

[0289] Specifically, for any initial ciphertext frame, corresponding frame identifiers may be added to the head, middle, and tail of the initial ciphertext frame to obtain a target ciphertext frame corresponding to the initial ciphertext frame.

[0290] Next, combine Figure 5 , a method for generating a target ciphertext frame is described.

[0291] Figure 5 A schematic diagram of generating a target ciphertext frame provided in an embodiment of the present application. Figure 5 , assuming that the length of the initial ciphertext frame is 128 bits, the length of the frame identifier corresponding to the initial ciphertext frame is n bits, where n is a number greater than zero.

[0292] like Figure 5 As shown, the frame identifier corresponding to the initial ciphertext frame can be added to the head, tail, and half of the initial ciphertext frame respectively to obtain the target ciphertext frame corresponding to the initial ciphertext frame.

[0293] S304. Send at least one target ciphertext frame to the second terminal device.

[0294] The second terminal device may be a terminal device that performs voice communication with the first terminal device.

[0295] In the communication method provided in this embodiment, the first terminal device can determine at least one plaintext frame corresponding to the voice data; can encrypt each plaintext frame through a preset symmetric encryption algorithm to obtain at least one initial ciphertext frame; can add multiple corresponding frame identifiers in each initial ciphertext frame to obtain at least one target ciphertext frame; and can send at least one target ciphertext frame to the second terminal device. In the above method, the first terminal device can encrypt the voice data to be sent to the second terminal device through a symmetric encryption algorithm, thereby reducing the time required for the key negotiation phase and thus reducing the communication delay.

[0296] exist Figure 3 Based on the embodiment, the first terminal device can use different keys to encrypt each plaintext frame. Figure 6 , the communication method provided in the embodiment of the present application is further explained.

[0297] Figure 6 A flowchart of another communication method provided in an embodiment of the present application. The execution subject of the method may be a first terminal device, or a communication device set in the first terminal device. For example, the first terminal device may be a transmitter. The communication device may be implemented by software, or by a combination of software and hardware. For ease of understanding, the following description is made by taking the execution subject as the first terminal device as an example. Figure 6 , the method may include:

[0298] S601: Encode the speech data to obtain a plurality of speech subframes and a subframe identifier corresponding to each speech subframe.

[0299] It should be noted that the specific implementation method of S601 can refer to S301 and will not be repeated here.

[0300] S602: Add a corresponding subframe identifier to the head and tail of each speech subframe to obtain multiple target subframes.

[0301] The multiple target subframes may include: a target subframe corresponding to each voice subframe.

[0302] For any voice subframe, the first terminal device can add a subframe identifier corresponding to the voice subframe to the head and tail of the voice subframe respectively, so as to obtain a target subframe corresponding to the voice subframe.

[0303] S603: Determine at least one plaintext frame corresponding to the voice data according to the multiple target subframes.

[0304] In this embodiment, the first terminal device can determine at least one set from multiple target subframes based on the subframe identifier included in each target subframe, the set including two consecutive target subframes, and the total length of the two consecutive target subframes is the encryption length corresponding to the preset symmetric encryption algorithm; for any set, the target subframes in the set are spliced ​​to obtain the plaintext frames corresponding to the set; wherein, at least one plaintext frame includes the plaintext frame corresponding to each set.

[0305] Specifically, the first terminal device may start from the first target subframe, determine two consecutive target subframes as a set, and obtain at least one set; and may concatenate the two target subframes in each set to obtain a plaintext frame.

[0306] S604: Obtain an initial key and an initial sequence.

[0307] The length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0. That is, the length of the initial sequence can be equal to the length of the plaintext frame, and the length of the initial key can be greater than or equal to the length of the plaintext frame.

[0308] In this embodiment, the length of the plaintext frame and the length of the initial sequence may both be 128 bits. The length of the initial key may be 128 bits, 192 bits, or 256 bits. The initial sequence may be a random sequence with a length of 128 bits. The initial key may be a random key with a length of 128 bits, 192 bits, or 256 bits.

[0309] In this embodiment, there are at least two situations for obtaining the initial key and the initial sequence:

[0310] Case 1: The first terminal device negotiates an initial key and an initial sequence with the second terminal device.

[0311] In this case, the first terminal device and the second terminal device may negotiate an initial sequence with a length of 128 bits and an initial key with a length of 128 bits, 192 bits or 256 bits before voice communication.

[0312] In this case, the first terminal device and the second terminal device can negotiate different initial keys and initial sequences before each communication. That is, the initial keys and initial sequences used in each voice communication can be different, making the communication more secure.

[0313] It should be noted that in this case, the amount of data that needs to be transmitted when the first terminal device and the second terminal device negotiate the initial sequence and the initial key is much smaller than the amount of data that needs to be transmitted when the communicating parties negotiate the key in the public key cryptography system, which makes the communication delay smaller.

[0314] Case 2: The first terminal device obtains the initial key and initial sequence locally.

[0315] In this case, the first terminal device may store the initial key and the initial sequence in advance, and the second terminal device may also store the initial key and the initial sequence in advance. In this way, when the first terminal device and the second terminal device perform voice communication, the first terminal device may encrypt the data sent to the second computing device according to the initial key and the initial sequence, and the second terminal device may decrypt the data obtained from the first computing device according to the initial key and the initial sequence.

[0316] In this case, the first terminal device and the second terminal device do not need to negotiate a key, which further reduces the communication delay.

[0317] S605: Generate a key corresponding to each plaintext frame according to the initial key and the initial sequence.

[0318] In this embodiment, the first terminal device can generate the first key corresponding to the first plaintext frame based on the initial key and the initial sequence; generate the i+1th key corresponding to the i+1th plaintext frame based on the i-th key and the i-th sequence corresponding to the initial sequence, and the i-th sequence corresponding to the initial sequence is a sequence obtained by performing preset processing on the initial sequence according to a preset algorithm; wherein i is 1, 2, 3... in sequence.

[0319] The preset algorithm may be a sequence processing algorithm pre-negotiated by the first terminal device and the second terminal device. After the initial sequence is processed according to the preset algorithm, a new sequence having the same length as the initial sequence may be obtained.

[0320] In a possible implementation, the preset algorithm may be a summation algorithm. Specifically, the initial sequence may represent an initial value. The i-th sequence corresponding to the initial sequence may be a sequence corresponding to the sum of the initial value and i times the fixed value. The fixed value may be set according to actual needs.

[0321] For example, assuming that the initial sequence is a binary value of 1 and the fixed value is 1, then the first sequence corresponding to the initial sequence may be a binary value of 2; and the second sequence corresponding to the initial sequence may be a binary value of 3.

[0322] In this embodiment, when generating the first key corresponding to the first plaintext frame according to the initial key and the initial sequence, the first terminal device can generate a first sub-initial key according to the first part of the initial key and the initial sequence, where the first part of the initial key is the first M bits of the initial key; generate a second sub-initial key according to the second part of the initial key, where the second part of the initial key is the first M bits of the initial key, or the last N bits of the initial key; concatenate the first sub-initial key and the second sub-initial key to obtain an initial concatenated key, and perform a hash operation on the initial concatenated key to generate the first key corresponding to the first plaintext frame.

[0323] Similarly, when generating the i+1th key corresponding to the i+1th plaintext frame according to the i-th key and the i-th sequence corresponding to the initial sequence, the first terminal device can generate a first sub-i-th key according to the first part of the i-th key and the i-th sequence corresponding to the initial sequence, where the first part of the i-th key is the first M bits of the i-th key; generate a second sub-i-th key according to the second part of the i-th key, where the second part of the i-th key is the first M bits of the i-th key, or the last N bits of the i-th key; concatenate the first sub-i-th key and the second sub-i-th key to obtain the i-th concatenated key, and perform a hash operation on the i-th concatenated key to generate the i+1th key corresponding to the i+1th plaintext frame.

[0324] It should be noted that the length of the i-th key is the same as the length of the initial key. If N is equal to zero, the second part of the initial key can be the first M bits of the initial key, and the second part of the i-th key can be the first M bits of the i-th key; if N is not equal to zero, the second part of the initial key can be the last N bits of the initial key, and the second part of the i-th key can be the last N bits of the i-th key.

[0325] Next, combine Fig. 7A and Figure 7B , the first part of the initial key and the second part of the initial key are explained.

[0326] Fig. 7A A schematic diagram of an initial key provided in an embodiment of the present application. Fig. 7A , the length of the initial key can be M bits. Fig. 7A The first M bits of the initial key shown may be the entire initial key. That is, the first part of the initial key may be the entire initial key, and the second part of the initial key may also be the entire initial key.

[0327] Figure 7B Another schematic diagram of the initial key provided in the embodiment of the present application. Figure 7B , the length of the initial key can be M+N bits, where N is not equal to zero. Figure 7B As shown, Figure 7B The first part of the initial key shown may be the first M bits of the initial key, and the second part of the initial key may be the last N bits of the initial key.

[0328] In this embodiment, when generating the first sub-initial key based on the first part of the initial key and the initial sequence, the first terminal device can perform an XOR operation on the first part of the initial key and the initial sequence to obtain a first operation result; and perform a hash operation on the first operation result to obtain a first sub-initial key.

[0329] Specifically, the first operation result can be determined by the following formula:

[0330] First operation result = first part of initial key ⊕ initial sequence

[0331] The first sub-initial key can be determined by the following formula:

[0332] First sub-initial key = HASH [first operation result]

[0333] In this embodiment, when generating the second sub-initial key according to the second part of the initial key, the first terminal device may perform a negation operation on the second part of the initial key to generate the second sub-initial key.

[0334] Specifically, the second sub-initial key can be determined by the following formula:

[0335] Second sub-initial key = the second part of the initial key

[0336] S606 . For any plaintext frame, encrypt the plaintext frame using the key corresponding to the plaintext frame to obtain an initial ciphertext frame corresponding to the plaintext frame.

[0337] The at least one initial ciphertext frame includes an initial ciphertext frame corresponding to each plaintext frame.

[0338] Specifically, the first terminal device can encrypt the i-th plaintext frame using the i-th key corresponding to the i-th plaintext frame to obtain an initial ciphertext frame corresponding to the i-th plaintext frame, where i is 1, 2, 3, ... in sequence until the encryption processing of all plaintext frames is completed.

[0339] S607: Add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame.

[0340] S608. Send the at least one target ciphertext frame to the second terminal device.

[0341] It should be noted that the specific implementation method of S607-S608 can be found in S303-S304, which will not be repeated here.

[0342] In the communication method provided in this embodiment, the first terminal device can encode the voice data to obtain multiple voice subframes and subframe identifiers corresponding to each voice subframe; the corresponding subframe identifier can be added to the head and tail of each voice subframe to obtain multiple target subframes; at least one plaintext frame corresponding to the voice data can be determined based on the multiple target subframes; the initial key and the initial sequence can be obtained; the key corresponding to each plaintext frame can be generated based on the initial key and the initial sequence; each plaintext frame can be encrypted by the key corresponding to each plaintext frame to obtain the initial ciphertext frame corresponding to each plaintext frame; multiple corresponding frame identifiers can be added to each initial ciphertext frame to obtain at least one target ciphertext frame. In the above method, the first terminal device can encrypt the corresponding plaintext frame by the key corresponding to each plaintext frame. In this way, the purpose of encrypting each plaintext frame by different keys can be achieved, so that the communication security is higher.

[0343] Based on any of the above embodiments, Figure 8 , a method for a second terminal device to receive at least one target ciphertext frame is described.

[0344] Figure 8 A flowchart of another communication method provided in an embodiment of the present application. The execution subject of the method may be a second terminal device, or a communication device set in the second terminal device. For example, the second terminal device may be a receiving end. The communication device may be implemented by software, or by a combination of software and hardware. For ease of understanding, the following description is made by taking the execution subject as the second terminal device as an example. Figure 8 , the method may include:

[0345] S801. Receive at least one target ciphertext frame sent by a first terminal device.

[0346] The target ciphertext frame includes an initial ciphertext frame and a plurality of corresponding frame identifiers. The initial ciphertext frame is obtained by encrypting a plaintext frame using a preset symmetric encryption algorithm. The length of the plaintext frame is a decryption length corresponding to the preset symmetric encryption algorithm.

[0347] The preset symmetric encryption algorithm may be an AES encryption algorithm. It should be understood that the decryption length corresponding to the AES encryption algorithm may be 128 bits. Thus, the length of the plaintext frame may be 128 bits.

[0348] S802: For any target ciphertext frame, according to the frame identifier in the target ciphertext frame, an initial ciphertext frame in the target ciphertext frame is decrypted by a preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

[0349] In this embodiment, for any target ciphertext frame, the second terminal device can determine the frame length of the target ciphertext frame; based on the frame length and the frame identifier in the target ciphertext frame, the target ciphertext frame is verified to obtain a verification result, and the verification result is verification passed or verification failed; when the verification result is verification passed, the initial ciphertext frame is extracted from the target ciphertext frame according to the frame length, and the initial ciphertext frame is decrypted through a preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

[0350] Specifically, if the frame length of the target ciphertext frame is within a preset range, and a frame identifier for indicating the order of the target ciphertext frame in at least one ciphertext frame exists in the target ciphertext frame, the second terminal device may determine that the verification result is a passed verification. If the frame length of the target ciphertext frame is not within a preset range, or a frame identifier for indicating the order of the target ciphertext frame in at least one ciphertext frame does not exist in the target ciphertext frame, the second terminal device may determine that the verification result is a failed verification.

[0351] For any target ciphertext frame that passes the verification, the second terminal device can extract the initial ciphertext frame from the target ciphertext frame, and decrypt the initial ciphertext frame using a preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

[0352] The preset symmetric encryption algorithm may be an AES encryption algorithm.

[0353] Specifically, the second terminal device may decrypt the initial ciphertext frame corresponding to the target ciphertext frame by using the AES encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

[0354] In this embodiment, the first terminal device and the second terminal device may negotiate to obtain a key corresponding to the AES encryption algorithm before communicating.

[0355] It should be understood that the encryption key used by the first terminal device is the same as the decryption key used by the second terminal device.

[0356] It should be noted that when the first terminal device and the second terminal device negotiate to obtain the key corresponding to the AES encryption algorithm, the amount of data that needs to be transmitted is much smaller than the amount of data that needs to be transmitted when the communicating parties negotiate the key in the public key cryptography system, which makes the communication delay smaller.

[0357] S803: Determine the voice data according to the plaintext frame corresponding to each target ciphertext frame.

[0358] The plaintext frame may include two consecutive voice subframes and a subframe identifier corresponding to each voice subframe. The subframe identifier may be used to indicate the order of the corresponding voice subframe in multiple voice subframes.

[0359] In this embodiment, the second terminal device can obtain a subframe in each plaintext frame to obtain multiple voice subframes, and can splice the multiple voice subframes according to the subframe identifiers of each voice subframe to obtain voice data.

[0360] In the communication method provided in this embodiment, the second terminal device can receive at least one target ciphertext frame sent by the first terminal device; for any target ciphertext frame, the initial ciphertext frame in the target ciphertext frame can be decrypted by a preset algorithm according to the frame identifier in the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame; and the voice data is determined according to the plaintext frame corresponding to each target ciphertext frame. In the above method, the second terminal device can decrypt the data sent by the first terminal device through a symmetric encryption algorithm, thereby reducing the time required for the key negotiation phase and thus reducing the communication delay.

[0361] exist Figure 8 Based on the embodiment, the following Fig. 9 Taking any target ciphertext frame as an example, a method for decrypting an initial ciphertext frame in the target ciphertext frame by a preset symmetric encryption algorithm according to a frame identifier in the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame is described.

[0362] Fig. 9 A flowchart of another communication method provided in an embodiment of the present application. The execution subject of the method may be a second terminal device, or a communication device set in the second terminal device. For example, the second terminal device may be a receiving end. The communication device may be implemented by software, or by a combination of software and hardware. For ease of understanding, the following description is made by taking the execution subject as the second terminal device as an example. Fig. 9 , the method may include:

[0363] S901. Determine the frame length of the target ciphertext frame.

[0364] After the second terminal device receives the target ciphertext frame sent by the first terminal device, it can determine the frame length of the received target ciphertext frame.

[0365] S902: Determine whether the frame length is within a preset range.

[0366] If yes, execute S903;

[0367] If not, the verification result is determined to be verification failed.

[0368] It should be noted that if the verification result is that the verification fails, the second terminal device can discard the target ciphertext frame.

[0369] If the frame length is within the preset range, the second terminal device may consider that there is no data loss or less data loss in the received target ciphertext frame. If the frame length is not within the preset range, the second terminal device may consider that there is more data loss in the received target ciphertext frame.

[0370] The preset range can be set according to actual needs.

[0371] In this embodiment, assuming that the length of the target ciphertext frame sent by the first terminal device is L, the length of the frame identifier included in the target ciphertext frame sent by the first terminal device is n, and the preset range may be [L, 2n+L / 2].

[0372] S903: Perform verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result.

[0373] In this embodiment, the target ciphertext frame is verified according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result. There are at least the following two situations:

[0374] Case 1: The frame length is equal to the preset length.

[0375] The preset length may be a maximum value of the preset range. For example, if the preset range may be [L, 2n+L / 2], the preset length may be L.

[0376] In this case, the second terminal device can extract multiple frame identifiers at multiple first preset positions in the target ciphertext frame. If at least two frame identifiers are the same among the multiple frame identifiers, the verification result is determined to be passed; if the multiple frame identifiers are different, the verification result is determined to be failed; wherein, the frame identifier in the target ciphertext frame includes multiple frame identifiers.

[0377] The first preset position may be the head of the target ciphertext frame, the tail of the target ciphertext frame, or the middle of the target ciphertext frame.

[0378] The length of the first preset position may be the same as the length of the frame identifier. For example, assuming that the frame length is n bits, the length of the first preset position may be n bits.

[0379] The data at the first preset position may be a frame identifier included in the target ciphertext frame.

[0380] by Figure 5For example, the n bits at the head of the target ciphertext frame can be the first preset position, the n bits at the tail of the target ciphertext frame can be the first preset position, and the n bits in the middle of the target ciphertext frame can be the first preset position. The second terminal device can extract three frame identifiers at the three first preset positions. If at least two of the three frame identifiers are the same, the verification result is determined to be a passed verification; if the three frame identifiers are different, the verification result is determined to be a failed verification.

[0381] Case 2: The frame length is less than the preset length.

[0382] In this case, the second terminal device can extract the first frame identifier at the head of the target ciphertext frame, and extract the second frame identifier at the tail of the target ciphertext frame; if the first frame identifier and the second frame identifier are the same, the verification result is determined to be passed; if the first frame identifier and the second frame identifier are different, the first target position and the second target position are determined according to the frame identifier length and the preset length of the frame identifier, and the third frame identifier is extracted at the first target position, and the fourth frame identifier is extracted at the second target position, and the verification result is determined according to the first frame identifier, the second frame identifier, the third frame identifier and the fourth frame identifier; wherein, the frame identifiers in the target ciphertext frame include the first frame identifier, the second frame identifier, the third frame identifier and the fourth frame identifier.

[0383] In this embodiment, the preset length is L, the frame identifier length of the frame identifier is n, then the first target position can be [(L / 2)+1+n, (L / 2)+2n], and the second target position can be [L-2n-(L / 2)+1, Ln-(L / 2)].

[0384] Next, combine Fig.10 , describing the frame identifier in the target ciphertext frame.

[0385] Fig.10 A schematic diagram of a frame identifier in a target ciphertext frame provided in an embodiment of the present application. Fig.10 , the data on the n bits at the head of the target ciphertext frame can be the first frame identifier, the data on the n bits at the tail of the target ciphertext frame can be the second frame identifier, the data on the (L / 2)+1+n bits to the (L / 2)+2n bits in the target ciphertext frame can be the third frame identifier, and the data on the L-2n-(L / 2)+1 bits to the Ln-(L / 2) bits in the target ciphertext frame can be the fourth frame identifier.

[0386] In this embodiment, when the second terminal device determines the verification result based on the first frame identifier, the second frame identifier, the third frame identifier and the fourth frame identifier, if the first frame identifier and the third frame identifier are the same, or the second frame identifier and the fourth frame identifier are the same, then the verification result is determined to be passed; if the first frame identifier and the third frame identifier are different, and the second frame identifier and the fourth frame identifier are different, then the verification result is determined to be failed.

[0387] S904: When the verification result is that the verification is passed, extract the initial ciphertext frame from the target ciphertext frame according to the frame length.

[0388] In this embodiment, according to different frame lengths of the target ciphertext frame, there are two situations for extracting the initial ciphertext frame from the target ciphertext frame according to the frame length:

[0389] Case 1: The frame length is equal to the preset length.

[0390] In this case, the second terminal device may extract data other than the multiple frame identifiers from the target ciphertext frame, and determine the extracted data as the initial ciphertext frame.

[0391] Case 2: The frame length is less than the preset length.

[0392] In this case, the second terminal device can extract the data after the first frame identifier and before the third frame identifier in the target ciphertext frame, and extract the data after the fourth frame identifier and before the second frame identifier in the target ciphertext frame, and determine the extracted data as the initial ciphertext frame.

[0393] S905. Determine the key corresponding to the target ciphertext frame according to the frame identifier in the target ciphertext frame.

[0394] In this embodiment, when determining the key corresponding to the target ciphertext frame according to the frame identifier in the target ciphertext frame, the second terminal device can obtain an initial key and an initial sequence, where the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0; generate multiple keys according to the initial key and the initial sequence; and determine the key corresponding to the target ciphertext frame from the multiple keys according to the frame identifier in the target ciphertext frame.

[0395] It should be noted that the method for obtaining the initial key and the initial sequence can be referred to S604, which will not be described in detail here.

[0396] When generating multiple keys according to the initial key and the initial sequence, the second terminal device can generate the first key corresponding to the first plaintext frame according to the initial key and the initial sequence; generate the i+1th key according to the i-th key and the i-th sequence corresponding to the initial sequence, where the i-th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset change algorithm; wherein i is 1, 2, 3, ... in sequence.

[0397] It should be noted that the specific process of generating multiple keys can be found in S605 and will not be repeated here.

[0398] When determining the key corresponding to the target ciphertext frame from multiple keys based on the frame identifier in the target ciphertext frame, the second terminal device can determine the target frame identifier based on the frame identifier in the target ciphertext frame, and the target frame identifier is used to indicate the decryption order of the target ciphertext frame, and the generation order of the key corresponding to the target ciphertext frame from multiple keys corresponds to the target frame identifier; wherein the target frame identifier is two identical frame identifiers in the target ciphertext frame.

[0399] Specifically, according to the decryption order indicated by the target frame identifier, the key of the corresponding order among the multiple keys can be determined as the key corresponding to the target ciphertext frame.

[0400] For example, assuming that the target frame identifier indicates that the decryption order of the target ciphertext frame is 3, the third key among the multiple keys may be determined as the key corresponding to the target ciphertext frame.

[0401] S906. Decrypt the initial ciphertext frame according to the key corresponding to the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame.

[0402] In the communication method provided in this embodiment, the second terminal device can determine the frame length of the target ciphertext frame; it can determine whether the frame length is within a preset range. If the frame length is not within the preset range, it can be determined that the verification result is a verification failure; if the frame length is within the preset range, the target ciphertext frame can be verified according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result; the key corresponding to the target ciphertext frame can be determined according to the frame identifier in the target ciphertext frame; the initial ciphertext frame can be decrypted according to the key corresponding to the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame. In the above method, the second terminal device can extract the initial ciphertext frame from the target ciphertext frame, can determine the key corresponding to the target ciphertext frame according to the frame identifier in the target ciphertext frame, and can decrypt through the key pair corresponding to the target ciphertext frame and the initial ciphertext frame corresponding to the target ciphertext frame. Through the above method, the second terminal device can decrypt the target ciphertext frame through a symmetric encryption algorithm, which reduces the time required for the key negotiation phase, thereby reducing the communication delay.

[0403] On the basis of any one of the above embodiments, after obtaining the plaintext frame corresponding to each target ciphertext frame, the voice data can be determined according to the plaintext frame corresponding to each target ciphertext frame.

[0404] Combine the following Fig.11 , a method for the second terminal device to determine voice data according to the plaintext frame corresponding to each target ciphertext frame is described.

[0405] Fig.11 A flowchart of another communication method provided in an embodiment of the present application. The execution subject of the method may be a second terminal device, or a communication device set in the second terminal device. For example, the second terminal device may be a receiving end. The communication device may be implemented by software, or by a combination of software and hardware. For ease of understanding, the following description is made by taking the execution subject as the second terminal device as an example. Fig.11 , the method may include:

[0406] S1101. For any plaintext frame, perform verification processing on the plaintext frame to obtain a verification result, where the verification result is verification passed or verification failed.

[0407] The plaintext frame is verified, and when the verification is obtained, the second terminal device can determine that the first W bits in the plaintext frame are the first subframe identifier, the forward W bits at half of the plaintext frame are the second subframe identifier, the backward W bits at half of the plaintext frame are the third subframe identifier, and the last W bits of the plaintext frame are the fourth subframe identifier; if the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier meet the preset conditions, the verification result is determined to be verification passed; if the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier do not meet the preset conditions, the verification result is determined to be verification failed.

[0408] W may be the length of the subframe identifier included in the plaintext frame. In this embodiment, W may be 5.

[0409] by Figure 4 For example, the second terminal device can determine that the first 5 bits of data in the plaintext frame are the first subframe identifier, the 5 bits of data forward from half of the plaintext frame are the second subframe identifier, the 5 bits of data backward from half of the plaintext frame are the third subframe identifier, and the 5 bits of data after the plaintext frame are the fourth subframe identifier.

[0410] In this embodiment, the preset conditions include at least one of the following: the difference between the fourth subframe identifier and the first subframe identifier is 1; the difference between the third subframe identifier and the second subframe identifier is 1; the first subframe identifier is equal to the second subframe identifier, and the difference between the third subframe identifier and the first subframe identifier is 1; or, the difference between the fourth subframe identifier and the second subframe identifier is 1, and the difference between the third subframe identifier and the first subframe identifier is 1.

[0411] Specifically, if the difference between the fourth subframe identifier and the first subframe identifier is 1; or, the difference between the third subframe identifier and the second subframe identifier is 1; or, the first subframe identifier is equal to the second subframe identifier, and the difference between the third subframe identifier and the first subframe identifier is 1; or, the difference between the fourth subframe identifier and the second subframe identifier is 1, and the difference between the third subframe identifier and the first subframe identifier is 1, the second terminal device can determine that the verification result is verification passed. Otherwise, the second terminal device can determine that the verification result is verification failed.

[0412] It should be noted that if the verification result is that the verification fails, the second terminal device can discard the plaintext frame.

[0413] S1102: For any plaintext frame, when the verification result is verification passed, extract a first voice subframe and a second voice subframe included in the plaintext frame.

[0414] When extracting the first voice subframe and the second voice subframe included in the plaintext frame, the second terminal device can extract the data between the first subframe identifier and the second subframe identifier as the first voice subframe; and extract the data between the third subframe identifier and the fourth subframe identifier as the second voice subframe.

[0415] S1103: Determine voice data according to the first voice subframe and the second voice subframe included in each plaintext frame.

[0416] For any plaintext frame, when determining the voice data based on the first voice subframe and the second voice subframe included in the plaintext frame, the second terminal device can determine the first subframe identifier and / or the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier and / or the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame, and the subframe identifier is used to indicate the order of the corresponding voice subframe in multiple voice subframes; according to the order of each voice subframe in the multiple voice subframes, the first voice subframe and the second voice subframe in each plaintext frame are spliced ​​to obtain the voice data.

[0417] In this embodiment, if the difference between the fourth subframe identifier and the first subframe identifier is 1, the second terminal device may determine the first subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame. If the difference between the third subframe identifier and the second subframe identifier is 1, the second terminal device may determine the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame. If the first subframe identifier is equal to the second subframe identifier, and the difference between the third subframe identifier and the first subframe identifier is 1, the second terminal device may determine the first subframe identifier or the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier or the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame. If the difference between the fourth subframe identifier and the second subframe identifier is 1, and the difference between the third subframe identifier and the first subframe identifier is 1, the second terminal device can determine the first subframe identifier or the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier or the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame.

[0418] Specifically, the second terminal device can extract the first voice subframe and the second voice subframe in each plaintext frame to obtain multiple voice subframes; and can splice the multiple voice subframes according to the order of each voice subframe in the multiple voice subframes to obtain voice data corresponding to at least one ciphertext frame.

[0419] In the communication method provided in this embodiment, for any plaintext frame, the second terminal device can perform verification processing on the plaintext frame, obtain verification processing, and obtain a verification result, the verification result being verification passed or verification failed; for any plaintext frame, when the verification result is verification passed, the first voice subframe and the second voice subframe included in the plaintext frame can be extracted; and the voice data can be determined based on the first voice subframe and the second voice subframe included in each plaintext frame. Through the above method, the second terminal device can determine the voice data corresponding to at least one target ciphertext frame based on the plaintext frame corresponding to each target ciphertext frame, thereby achieving the purpose of determining the voice data.

[0420] Fig.12 The present invention provides a schematic diagram of a communication device according to an embodiment of the present invention. The communication device 10 is applied to a first terminal device, and the device includes a determination module 11, an encryption module 12 and a sending module 13, wherein:

[0421] The determination module 11 is used to determine at least one plaintext frame corresponding to the voice data, the length of the plaintext frame being the encryption length corresponding to the preset algorithm;

[0422] The encryption module 12 is used to encrypt each plaintext frame by using the preset encryption algorithm to obtain at least one initial ciphertext frame, and add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame;

[0423] The sending module 13 is used to send the at least one target ciphertext frame to the second terminal device.

[0424] The communication device provided in this embodiment can be used to execute the method executed by the first terminal device in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.

[0425] In a possible implementation, the determining module 11 is specifically configured to:

[0426] Performing encoding processing on the voice data to obtain a plurality of voice subframes and a subframe identifier corresponding to each voice subframe, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in the plurality of voice subframes;

[0427] At least one plaintext frame corresponding to the voice data is determined according to the multiple voice subframes and the subframe identifiers corresponding to the voice subframes.

[0428] In a possible implementation, the determining module 11 is specifically configured to:

[0429] Adding a corresponding subframe identifier to the head and tail of each speech subframe to obtain multiple target subframes;

[0430] At least one plaintext frame corresponding to the voice data is determined according to the multiple target subframes.

[0431] In a possible implementation, the determining module 11 is specifically configured to:

[0432] Determine, according to the subframe identifier included in each target subframe, at least one set from the multiple target subframes, the set including two consecutive target subframes, and the total length of the two consecutive target subframes is the encryption length corresponding to the preset symmetric encryption algorithm;

[0433] For any set, performing splicing processing on the target subframes in the set to obtain a plaintext frame corresponding to the set;

[0434] The at least one plaintext frame includes a plaintext frame corresponding to each set.

[0435] In a possible implementation, the encryption module 12 is specifically used to:

[0436] Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0;

[0437] Generate a key corresponding to each plaintext frame according to the initial key and the initial sequence;

[0438] For any plaintext frame, encrypt the plaintext frame using the key corresponding to the plaintext frame to obtain an initial ciphertext frame corresponding to the plaintext frame;

[0439] The at least one initial ciphertext frame includes an initial ciphertext frame corresponding to each plaintext frame.

[0440] In a possible implementation, the encryption module 12 is specifically used to:

[0441] Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence;

[0442] Generate an i+1th key corresponding to an i+1th plaintext frame according to the i-th key and the i-th sequence corresponding to the initial sequence, wherein the i-th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset algorithm;

[0443] Herein, the i is 1, 2, 3, ... in sequence.

[0444] In a possible implementation, the encryption module 12 is specifically used to:

[0445] Generate a first sub-initial key according to the first part of the initial key and the initial sequence, where the first part of the initial key is the first M bits of the initial key;

[0446] Generate a second sub-initial key according to the second part of the initial key, where the second part of the initial key is the first M bits of the initial key or the last N bits of the initial key;

[0447] The first sub-initial key and the second sub-initial key are concatenated to obtain an initial concatenated key, and a hash operation is performed on the initial concatenated key to generate a first key corresponding to the first plaintext frame.

[0448] In a possible implementation, the encryption module 12 is specifically used to:

[0449] Performing an XOR operation on the first part of the initial key and the initial sequence to obtain a first operation result;

[0450] Perform a hash operation on the first operation result to obtain the first sub-initial key.

[0451] In a possible implementation, the encryption module 12 is specifically used to:

[0452] Perform a negation operation on the second part of the initial key to generate the second sub-initial key.

[0453] In a possible implementation, the encryption module 12 is specifically used to:

[0454] For any initial ciphertext frame, determine a frame identifier corresponding to the initial ciphertext frame, and add a plurality of corresponding frame identifiers to the initial ciphertext frame to obtain a target ciphertext frame corresponding to the initial ciphertext frame, wherein the frame identifier is used to indicate an encryption order of the corresponding initial ciphertext frame in the at least one initial ciphertext frame;

[0455] The at least one target ciphertext frame includes: a target ciphertext frame corresponding to each initial ciphertext frame.

[0456] In a possible implementation, the encryption module 12 is specifically used to:

[0457] The corresponding frame identifiers are added to the head, middle and tail of the initial ciphertext frame.

[0458] The communication device provided in this embodiment can be used to execute the method executed by the first terminal device in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.

[0459] Fig.13 A schematic diagram of the structure of another communication device provided in an embodiment of the present application. The communication device 20 is applied to a second terminal device, and the device includes a receiving module 21, a decryption module 22 and a determination module 23, wherein:

[0460] The receiving module 21 is used to receive at least one target ciphertext frame sent by the first terminal device, the target ciphertext frame includes an initial ciphertext frame and a plurality of corresponding frame identifiers, the initial ciphertext frame is obtained by encrypting a plaintext frame using a preset algorithm, and the length of the plaintext frame is a decryption length corresponding to the preset algorithm;

[0461] For any target ciphertext frame, the decryption module 22 is used to, according to the frame identifier in the target ciphertext frame, perform decryption processing on the initial ciphertext frame in the target ciphertext frame by using the preset algorithm to obtain a plaintext frame corresponding to the target ciphertext frame;

[0462] The determination module 23 is used to determine the voice data according to the plaintext frame corresponding to each target ciphertext frame.

[0463] The communication device provided in this embodiment can be used to execute the method executed by the second terminal device in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.

[0464] In a possible implementation, the decryption module 22 is specifically used to:

[0465] Determining the frame length of the target ciphertext frame;

[0466] Performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result, wherein the verification result is verification passed or verification failed;

[0467] When the verification result is that the verification is passed, the initial ciphertext frame is extracted from the target ciphertext frame according to the frame length, and the initial ciphertext frame is decrypted by the preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

[0468] In a possible implementation, the decryption module 22 is specifically used to:

[0469] Determining whether the frame length is within a preset range;

[0470] If yes, performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result;

[0471] If not, it is determined that the verification result is verification failure.

[0472] In a possible implementation, the frame length is equal to a preset length, and the decryption module 22 is specifically configured to:

[0473] extracting the plurality of frame identifiers at a plurality of first preset positions in the target ciphertext frame,

[0474] If at least two frame identifiers among the multiple frame identifiers are the same, determining that the verification result is a verification pass;

[0475] If the multiple frame identifiers are not the same, determining that the verification result is verification failure;

[0476] The frame identifier in the target ciphertext frame includes the multiple frame identifiers.

[0477] In a possible implementation, the frame length is less than a preset length, and the decryption module 22 is specifically configured to:

[0478] Extracting a first frame identifier from a header of the target ciphertext frame, and extracting a second frame identifier from a tail of the target ciphertext frame;

[0479] If the first frame identifier and the second frame identifier are the same, determining that the verification result is verification passed;

[0480] If the first frame identifier and the second frame identifier are different, determining a first target position and a second target position according to a frame identifier length of the frame identifier and the preset length, extracting a third frame identifier at the first target position, and extracting a fourth frame identifier at the second target position, and determining the verification result according to the first frame identifier, the second frame identifier, the third frame identifier, and the fourth frame identifier;

[0481] The frame identifier in the target ciphertext frame includes the first frame identifier, the second frame identifier, the third frame identifier and the fourth frame identifier.

[0482] In a possible implementation, the decryption module 22 is specifically used to:

[0483] If the first frame identifier and the third frame identifier are the same, or the second frame identifier and the fourth frame identifier are the same, determining that the verification result is verification passed;

[0484] If the first frame identifier and the third frame identifier are different, and the second frame identifier and the fourth frame identifier are different, it is determined that the verification result is verification failure.

[0485] In a possible implementation, the frame length is equal to a preset length, and the decryption module 22 is specifically configured to:

[0486] Data other than the multiple frame identifiers is extracted from the target ciphertext frame, and the extracted data is determined as the initial ciphertext frame.

[0487] In a possible implementation, the frame length is less than a preset length, and the decryption module 22 is specifically configured to:

[0488] Extract data from after the first frame identifier and before the third frame identifier in the target ciphertext frame, and extract data from after the fourth frame identifier and before the second frame identifier in the target ciphertext frame, and determine the extracted data as the initial ciphertext frame.

[0489] In a possible implementation, the decryption module 22 is specifically used to:

[0490] Determining a key corresponding to the target ciphertext frame according to a frame identifier in the target ciphertext frame;

[0491] The initial ciphertext frame is decrypted according to the key corresponding to the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame.

[0492] In a possible implementation, the decryption module 22 is specifically used to:

[0493] Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0;

[0494] Generate multiple keys according to the initial key and the initial sequence;

[0495] According to the frame identifier in the target ciphertext frame, a key corresponding to the target ciphertext frame is determined from the multiple keys.

[0496] In a possible implementation, the decryption module 22 is specifically used to:

[0497] Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence;

[0498] Generate an (i+1)th key according to the (i)th key and the (i)th sequence corresponding to the initial sequence, wherein the (i)th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset change algorithm;

[0499] Herein, the i is 1, 2, 3, ... in sequence.

[0500] In a possible implementation, the decryption module 22 is specifically used to:

[0501] Determine a target frame identifier according to a frame identifier in the target ciphertext frame, wherein the target frame identifier is used to indicate a decryption order of the target ciphertext frame, and a generation order of a key corresponding to the target ciphertext frame among the multiple keys corresponds to the target frame identifier;

[0502] The target frame identifiers are two identical frame identifiers in the target ciphertext frame.

[0503] In a possible implementation, the determining module 23 is specifically configured to:

[0504] For any plaintext frame, perform verification processing on the plaintext frame to obtain a verification result, where the verification result is verification passed or verification failed;

[0505] For any plaintext frame, when the verification result is verification passed, extracting a first voice subframe and a second voice subframe included in the plaintext frame;

[0506] The voice data is determined according to the first voice subframe and the second voice subframe included in each plaintext frame.

[0507] In a possible implementation, the determining module 23 is specifically configured to:

[0508] Determine that the first W bits in the plaintext frame are the first subframe identifier, the forward W bits at one-half of the plaintext frame are the second subframe identifier, the backward W bits at one-half of the plaintext frame are the third subframe identifier, and the rear W bits of the plaintext frame are the fourth subframe identifier;

[0509] If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier meet a preset condition, determining that the verification result is verification passed;

[0510] If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier do not meet a preset condition, it is determined that the verification result is verification failure.

[0511] In a possible implementation, the preset condition includes at least one of the following:

[0512] The difference between the fourth subframe identifier and the first subframe identifier is 1;

[0513] The difference between the third subframe identifier and the second subframe identifier is 1;

[0514] The first subframe identifier is equal to the second subframe identifier, and the difference between the third subframe identifier and the first subframe identifier is 1; or,

[0515] A difference between the fourth subframe identifier and the second subframe identifier is 1, and a difference between the third subframe identifier and the first subframe identifier is 1.

[0516] In a possible implementation, the determining module 23 is specifically configured to:

[0517] extracting data between the first subframe identifier and the second subframe identifier as a first voice subframe; and,

[0518] Data between the third subframe identifier and the fourth subframe identifier is extracted as a second voice subframe.

[0519] In a possible implementation, the determining module 23 is specifically configured to:

[0520] For any plaintext frame, determine the first subframe identifier and / or the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier and / or the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in multiple voice subframes;

[0521] According to the order of each voice subframe in the plurality of voice subframes, the first voice subframe and the second voice subframe in each plaintext frame are concatenated to obtain voice data.

[0522] The communication device provided in this embodiment can be used to execute the method executed by the second terminal device in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.

[0523] Fig.14 This is a hardware structure diagram of an electronic device provided in an embodiment of the present application. Fig.14 The electronic device 30 may include: a processor 31 and a memory 32, wherein the processor 31 and the memory 32 can communicate; illustratively, the processor 31 and the memory 32 communicate via a communication bus 33, the memory 32 is used to store computer-executable instructions, and the processor 31 is used to call the computer-executable instructions in the memory to execute the method shown in any of the above method embodiments.

[0524] Optionally, the electronic device 30 may further include a communication interface, which may include a transmitter and / or a receiver.

[0525] Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0526] The electronic device 30 may be the first terminal device or the second terminal device described in any of the above embodiments.

[0527] The present application provides a computer-readable storage medium, on which computer-executable instructions are stored; the computer-executable instructions are used to implement the method shown in any of the above method embodiments.

[0528] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the method shown in the above method embodiment.

[0529] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.

[0530] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0531] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0532] These computer program instructions can also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0533] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0534] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

[0535] Those skilled in the art will readily come up with other embodiments of the present application after considering the invention disclosed in the specification and practice. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

Claims

1. A communication method, characterized in that: The method is applied to a first terminal device, and the method includes: Determine at least one plaintext frame corresponding to the voice data, wherein the length of the plaintext frame is an encryption length corresponding to a preset symmetric encryption algorithm; Encrypt each plaintext frame using the preset symmetric encryption algorithm to obtain at least one initial ciphertext frame, and add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame; The at least one target ciphertext frame is sent to the second terminal device.

2. The method according to claim 1, characterized in that: Determining at least one plaintext frame corresponding to the voice data includes: Performing encoding processing on the voice data to obtain a plurality of voice subframes and a subframe identifier corresponding to each voice subframe, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in the plurality of voice subframes; At least one plaintext frame corresponding to the voice data is determined according to the multiple voice subframes and the subframe identifiers corresponding to the voice subframes.

3. The method according to claim 2, characterized in that Determining at least one plaintext frame corresponding to the voice data according to the multiple voice subframes and the subframe identifiers corresponding to the voice subframes includes: Adding a corresponding subframe identifier to the head and tail of each speech subframe to obtain multiple target subframes; At least one plaintext frame corresponding to the voice data is determined according to the multiple target subframes.

4. The method according to claim 3, characterized in that Determining at least one plaintext frame corresponding to the voice data according to the multiple target subframes includes: Determine, according to the subframe identifier included in each target subframe, at least one set from the multiple target subframes, the set including two consecutive target subframes, and the total length of the two consecutive target subframes is the encryption length corresponding to the preset symmetric encryption algorithm; For any set, performing splicing processing on the target subframes in the set to obtain a plaintext frame corresponding to the set; The at least one plaintext frame includes a plaintext frame corresponding to each set.

5. The method according to any one of claims 1 to 4, characterized in that: Each plaintext frame is encrypted by the preset symmetric encryption algorithm to obtain at least one initial ciphertext frame, including: Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0; Generate a key corresponding to each plaintext frame according to the initial key and the initial sequence; For any plaintext frame, encrypt the plaintext frame using the key corresponding to the plaintext frame to obtain an initial ciphertext frame corresponding to the plaintext frame; The at least one initial ciphertext frame includes an initial ciphertext frame corresponding to each plaintext frame.

6. The method according to claim 5, characterized in that Generating a key corresponding to each plaintext frame according to the initial key and the initial sequence, including: Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence; Generate an i+1th key corresponding to an i+1th plaintext frame according to an i-th key and an i-th sequence corresponding to the initial sequence, wherein the i-th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset algorithm; Wherein, the i is 1, 2, 3, ... in sequence.

7. The method according to claim 6, characterized in that Generating a first key corresponding to a first plaintext frame according to the initial key and the initial sequence, comprising: Generate a first sub-initial key according to the first part of the initial key and the initial sequence, where the first part of the initial key is the first M bits of the initial key; Generate a second sub-initial key according to the second part of the initial key, where the second part of the initial key is the first M bits of the initial key or the last N bits of the initial key; The first sub-initial key and the second sub-initial key are concatenated to obtain an initial concatenated key, and a hash operation is performed on the initial concatenated key to generate a first key corresponding to the first plaintext frame.

8. The method according to claim 7, characterized in that Generating a first sub-initial key according to the first part of the initial key and the initial sequence, comprising: Performing an XOR operation on the first part of the initial key and the initial sequence to obtain a first operation result; Perform a hash operation on the first operation result to obtain the first sub-initial key.

9. The method according to claim 6 or 7, characterized in that: The step of generating a second sub-initial key according to the second part of the initial key comprises: Perform a negation operation on the second part of the initial key to generate the second sub-initial key.

10. The method according to any one of claims 1 to 9, characterized in that: Add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame, including: For any initial ciphertext frame, determine a frame identifier corresponding to the initial ciphertext frame, and add a plurality of corresponding frame identifiers to the initial ciphertext frame to obtain a target ciphertext frame corresponding to the initial ciphertext frame, wherein the frame identifier is used to indicate an encryption order of the corresponding initial ciphertext frame in the at least one initial ciphertext frame; The at least one target ciphertext frame includes: a target ciphertext frame corresponding to each initial ciphertext frame.

11. The method according to claim 10, characterized in that Adding multiple corresponding frame identifiers to the initial ciphertext frame includes: The corresponding frame identifiers are added to the head, middle and tail of the initial ciphertext frame.

12. A communication method, characterized in that: The method is applied to a second terminal device, and the method includes: Receive at least one target ciphertext frame sent by the first terminal device, the target ciphertext frame including an initial ciphertext frame and a plurality of corresponding frame identifiers, the initial ciphertext frame being obtained by encrypting a plaintext frame using a preset symmetric encryption algorithm, and the length of the plaintext frame being a decryption length corresponding to the preset symmetric encryption algorithm; For any target ciphertext frame, according to the frame identifier in the target ciphertext frame, an initial ciphertext frame in the target ciphertext frame is decrypted by the preset algorithm to obtain a plaintext frame corresponding to the target ciphertext frame; The voice data is determined according to the plaintext frame corresponding to each target ciphertext frame.

13. The method according to claim 12, characterized in that According to the frame identifier in the target ciphertext frame, the initial ciphertext frame in the target ciphertext frame is decrypted by the preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame, including: Determining a frame length of the target ciphertext frame; Performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result, wherein the verification result is verification passed or verification failed; When the verification result is that the verification is passed, the initial ciphertext frame is extracted from the target ciphertext frame according to the frame length, and the initial ciphertext frame is decrypted by the preset symmetric encryption algorithm to obtain a plaintext frame corresponding to the target ciphertext frame.

14. The method according to claim 13, characterized in that According to the frame length and the frame identifier in the target ciphertext frame, the target ciphertext frame is verified to obtain a verification result, including: Determining whether the frame length is within a preset range; If yes, performing verification processing on the target ciphertext frame according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result; If not, it is determined that the verification result is verification failure.

15. The method according to claim 14, characterized in that The frame length is equal to a preset length; and the target ciphertext frame is verified according to the frame length and a frame identifier in the target ciphertext frame to obtain a verification result, including: extracting a plurality of frame identifiers at a plurality of first preset positions in the target ciphertext frame, If at least two frame identifiers among the multiple frame identifiers are the same, determining that the verification result is a verification pass; If the multiple frame identifiers are not the same, determining that the verification result is verification failure; The frame identifier in the target ciphertext frame includes the multiple frame identifiers.

16. The method according to claim 14, characterized in that The frame length is less than a preset length; and the target ciphertext frame is verified according to the frame length and the frame identifier in the target ciphertext frame to obtain a verification result, including: Extracting a first frame identifier from a header of the target ciphertext frame, and extracting a second frame identifier from a tail of the target ciphertext frame; If the first frame identifier and the second frame identifier are the same, determining that the verification result is verification passed; If the first frame identifier and the second frame identifier are different, determining a first target position and a second target position according to a frame identifier length of the frame identifier and the preset length, extracting a third frame identifier at the first target position, and extracting a fourth frame identifier at the second target position, and determining the verification result according to the first frame identifier, the second frame identifier, the third frame identifier, and the fourth frame identifier; The frame identifier in the target ciphertext frame includes the first frame identifier, the second frame identifier, the third frame identifier and the fourth frame identifier.

17. The method according to claim 16, characterized in that Determining the verification result according to the first frame identifier, the second frame identifier, the third frame identifier, and the fourth frame identifier includes: If the first frame identifier and the third frame identifier are the same, or the second frame identifier and the fourth frame identifier are the same, determining that the verification result is verification passed; If the first frame identifier and the third frame identifier are different, and the second frame identifier and the fourth frame identifier are different, it is determined that the verification result is verification failure.

18. The method according to claim 15, characterized in that The frame length is equal to a preset length; and extracting the initial ciphertext frame from the target ciphertext frame according to the frame length comprises: Data other than the multiple frame identifiers is extracted from the target ciphertext frame, and the extracted data is determined as the initial ciphertext frame.

19. The method according to claim 16 or 17, characterized in that The frame length is less than a preset length; and extracting the initial ciphertext frame from the target ciphertext frame according to the frame length comprises: Extract data from after the first frame identifier and before the third frame identifier in the target ciphertext frame, and extract data from after the fourth frame identifier and before the second frame identifier in the target ciphertext frame, and determine the extracted data as the initial ciphertext frame.

20. The method according to any one of claims 13 to 19, characterized in that: Decrypting the initial ciphertext frame by using the preset algorithm to obtain a plaintext frame corresponding to the target ciphertext frame includes: Determining a key corresponding to the target ciphertext frame according to a frame identifier in the target ciphertext frame; The initial ciphertext frame is decrypted according to the key corresponding to the target ciphertext frame to obtain a plaintext frame corresponding to the target ciphertext frame.

21. The method according to claim 20, characterized in that Determining a key corresponding to the target ciphertext frame according to a frame identifier in the target ciphertext frame includes: Obtain an initial key and an initial sequence, wherein the length of the initial key is M+N bits, the length of the initial sequence is M bits, M is equal to the length of the plaintext frame, and N is an integer greater than or equal to 0; Generate multiple keys according to the initial key and the initial sequence; According to the frame identifier in the target ciphertext frame, a key corresponding to the target ciphertext frame is determined from the multiple keys.

22. The method according to claim 21, characterized in that According to the initial key and the initial sequence, a plurality of keys are generated, including: Generate a first key corresponding to a first plaintext frame according to the initial key and the initial sequence; Generate an (i+1)th key according to the (i)th key and the (i)th sequence corresponding to the initial sequence, wherein the (i)th sequence corresponding to the initial sequence is a sequence obtained by processing the initial sequence according to a preset change algorithm; Wherein, the i is 1, 2, 3, ... in sequence.

23. The method according to claim 21 or 22, characterized in that Determining, according to the frame identifier in the target ciphertext frame, a key corresponding to the target ciphertext frame from among the multiple keys, comprises: Determine a target frame identifier according to a frame identifier in the target ciphertext frame, wherein the target frame identifier is used to indicate a decryption order of the target ciphertext frame, and a generation order of a key corresponding to the target ciphertext frame among the multiple keys corresponds to the target frame identifier; The target frame identifiers are two identical frame identifiers in the target ciphertext frame.

24. The method according to any one of claims 12 to 23, characterized in that: Determine the voice data according to the plaintext frame corresponding to each target ciphertext frame, including: For any plaintext frame, perform verification processing on the plaintext frame to obtain a verification result, where the verification result is verification passed or verification failed; For any plaintext frame, when the verification result is verification passed, extracting a first voice subframe and a second voice subframe included in the plaintext frame; The voice data is determined according to the first voice subframe and the second voice subframe included in each plaintext frame.

25. The method according to claim 24, characterized in that Performing verification processing on the plaintext frame to obtain verification processing includes: Determine that the first W bits in the plaintext frame are the first subframe identifier, the forward W bits at one-half of the plaintext frame are the second subframe identifier, the backward W bits at one-half of the plaintext frame are the third subframe identifier, and the rear W bits of the plaintext frame are the fourth subframe identifier; If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier meet a preset condition, determining that the verification result is verification passed; If the first subframe identifier, the second subframe identifier, the third subframe identifier, and the fourth subframe identifier do not meet a preset condition, it is determined that the verification result is verification failure.

26. The method according to claim 25, characterized in that The preset condition includes at least one of the following: The difference between the fourth subframe identifier and the first subframe identifier is 1; The difference between the third subframe identifier and the second subframe identifier is 1; The first subframe identifier is equal to the second subframe identifier, and a difference between the third subframe identifier and the first subframe identifier is 1; or, A difference between the fourth subframe identifier and the second subframe identifier is 1, and a difference between the third subframe identifier and the first subframe identifier is 1.

27. The method according to any one of claims 24 to 26, characterized in that: Extracting a first voice subframe and a second voice subframe included in the plaintext frame comprises: extracting data between the first subframe identifier and the second subframe identifier as a first voice subframe; and, Data between the third subframe identifier and the fourth subframe identifier is extracted as a second voice subframe.

28. The method according to any one of claims 25-26, characterized in that: Determining voice data according to a first voice subframe and a second voice subframe included in each plaintext frame includes: For any plaintext frame, determine the first subframe identifier and / or the second subframe identifier in the plaintext frame as the subframe identifier corresponding to the first voice subframe in the plaintext frame, and determine the third subframe identifier and / or the fourth subframe identifier in the plaintext frame as the subframe identifier corresponding to the second voice subframe in the plaintext frame, wherein the subframe identifier is used to indicate the order of the corresponding voice subframe in multiple voice subframes; According to the order of each voice subframe in the plurality of voice subframes, the first voice subframe and the second voice subframe in each plaintext frame are concatenated to obtain voice data.

29. A communication device, characterized in that: The device is applied to a first terminal device, and comprises a determination module, an encryption module and a sending module, wherein: The determination module is used to determine at least one plaintext frame corresponding to the voice data, the length of the plaintext frame being the encryption length corresponding to the preset algorithm; The encryption module is used to encrypt each plaintext frame by using the preset encryption algorithm to obtain at least one initial ciphertext frame, and add multiple corresponding frame identifiers to each initial ciphertext frame to obtain at least one target ciphertext frame; The sending module is used to send the at least one target ciphertext frame to the second terminal device.

30. A communication device, characterized in that: The device is applied to a second terminal device, and comprises a receiving module, a decryption module and a determination module, wherein: The receiving module is used to receive at least one target ciphertext frame sent by the first terminal device, the target ciphertext frame includes an initial ciphertext frame and a plurality of corresponding frame identifiers, the initial ciphertext frame is obtained by encrypting a plaintext frame using a preset algorithm, and the length of the plaintext frame is a decryption length corresponding to the preset algorithm; For any target ciphertext frame, the decryption module is used to, according to the frame identifier in the target ciphertext frame, perform decryption processing on the initial ciphertext frame in the target ciphertext frame by using the preset algorithm to obtain a plaintext frame corresponding to the target ciphertext frame; The determination module is used to determine the voice data according to the plaintext frame corresponding to each target ciphertext frame.

31. An electronic device comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 11, or implements the method according to any one of claims 12 to 28.

32. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method according to any one of claims 1 to 11, or to implement the method according to any one of claims 12 to 28.

33. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented, or the method according to any one of claims 12 to 28 is implemented.