A bluetooth headset terminal side voice encryption and decryption method and system based on voiceprint key and microframe timing permutation
Patent Information
- Application Number
- CN202611371710.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-05
- Publication Date
- 2026-10-16
AI Technical Summary
但是,在耳机端进行加密面临巨大的硬件资源挑战
[0017]According to specific embodiments provided by the present invention, the following technical effects are disclosed: The Bluetooth headset end-side voice encryption and decryption method and system based on voiceprint key and microframe timing permutation provided by the present invention combines a voiceprint fuzzy extractor, BCH error correction code and ECDH key negotiation to complete the generation of shared root seed and voiceprint binding storage during the pairing phase within the headset security chip. It relies on a synchronized RTC clock and HMAC algorithm, borrowing the TOTP mechanism to derive a one-time permutation key for each time window, and employs Fisher-Yates... The Shuffle algorithm encrypts the memory pointers of 10ms voice microframes by performing a 35-frame window-level temporal permutation. The receiving end reconstructs the inverse permutation sequence to restore the microframe temporal order and eliminates splicing artifacts by using linear or cosine cross-smoothing at frame boundaries to restore continuous speech. This method only swaps pointers without changing the audio sampling points, resulting in extremely low computational overhead. It is compatible with low-power Bluetooth headset hardware and has a high password security strength of 35!. It relies on a one-time key to achieve forward security and resists voiceprint replay attacks. Encryption and decryption are all completed in the headset hardware, avoiding the risk of mobile phone Trojan eavesdropping. At the same time, it is ready to use immediately without requiring users to manually enter passwords, balancing communication security, device power consumption, and user experience.
Smart Images

Figure CN122934237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication security technology, and in particular to a Bluetooth headset-side voice encryption and decryption method and system based on voiceprint key and microframe timing permutation. Background Technology
[0002] With the widespread adoption of mobile communication and wireless network technologies, the privacy and security of voice calls have received increasing attention. In scenarios such as confidential business communications, government communications, and personal privacy protection, preventing eavesdropping on voice calls has become a core requirement. Existing voice encryption solutions primarily rely on software encryption on smartphones (such as various encrypted communication apps).
[0003] However, existing technical solutions have the following technical drawbacks: First, encryption based on mobile phone software is vulnerable to attacks from malware at the underlying level of the mobile operating system. Once a Trojan horse is implanted in a mobile phone, eavesdroppers can directly intercept plaintext voice at the underlying level of audio capture by the microphone or playback by the speaker, thereby bypassing software-level encryption.
[0004] Secondly, with the widespread adoption of TWS (True Wireless Stereo) Bluetooth earbuds, earbuds have become the direct input and output terminals for voice communication. Implementing hardware-level end-to-end voice encryption within the Bluetooth earbuds could completely prevent eavesdropping by mobile malware. However, implementing encryption at the earbud level presents significant hardware resource challenges. Traditional block cipher algorithms (such as AES) or stream ciphers suffer from high computational complexity when processing real-time high-sampling-rate audio streams, leading to substantial power consumption and heat generation in the earbud's main control chip, severely shortening the earbuds' battery life.
[0005] Third, how to securely generate, distribute, and manage encryption keys on Bluetooth headsets without screens and with limited interaction, and how to prevent hard-coded keys from being cracked or static biometrics from being replayed, is also a problem that urgently needs to be solved. Summary of the Invention
[0006] The purpose of this invention is to provide a Bluetooth headset-side voice encryption and decryption method and system based on voiceprint keys and microframe timing permutation. By cleverly transforming "continuous signal encryption" into "macro pointer permutation", high-strength encryption is achieved with extremely low computing power overhead. Furthermore, by combining dynamic time factors, the security risks of static biometrics being vulnerable to replay attacks are addressed.
[0007] To achieve the above objectives, the present invention provides the following solution: A Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation includes the following steps: During the initial pairing phase of the Bluetooth headsets of both parties, the voiceprint public parameters of both parties are exchanged through a plaintext channel, and the shared root seed is calculated separately in the security chip built into each headset. Based on a synchronized time counter and a shared root seed, the one-time permutation key corresponding to the current time window is derived in real time through the HMAC algorithm. A temporal permutation sequence is generated based on a one-time permutation key. The acquired analog speech signal is then framed to generate a permutation window. The microframes within the permutation window are then shuffled in time according to the temporal permutation sequence to obtain an encrypted speech frame stream. The inverse permutation sequence is calculated based on the one-time permutation key, and the encrypted voice frame stream is shuffled in reverse time according to the inverse permutation sequence to obtain the original time sequence of microframes. Cross-smoothing is performed at the boundaries of adjacent microframes in the microframe sequence to obtain the restored continuous speech signal.
[0008] Optionally, during the initial pairing phase of the Bluetooth headsets of both parties, they exchange voiceprint public parameters through a plaintext channel, and calculate a shared root seed within the security chips built into both headsets, including: The system collects the host's voice and extracts voiceprint features, then converts the voiceprint features into a binary feature string. A random BCH codeword is generated within the security chip. The voiceprint public parameters are obtained by performing a bitwise XOR operation between the binary feature string and the random BCH codeword. Both Bluetooth headsets generate temporary private keys and calculate corresponding elliptic curve public keys within their respective security chips, and then exchange the elliptic curve public keys with the voiceprint public parameters via a plaintext channel. Based on our temporary private key and the other party's elliptic curve public key, we calculate the same shared secret through a key negotiation algorithm and map the hash value of the shared secret to the rhythm of the prompt tone. After the user confirms and triggers the interaction command, the shared root seed is calculated through the key derivation function based on the shared secret and voiceprint public parameters. After the shared root seed is symmetrically encrypted using a stable voiceprint key, it is stored in a secure chip. When the wearer's voiceprint verification is successful and the stable voiceprint key is reproduced, the shared root seed is decrypted and used to reconstruct the voiceprint.
[0009] Optionally, when the wearer's voiceprint verification is successful and the stable voiceprint key is reproduced, the specific process of re-decrypting and calling the shared root seed for voiceprint reconstruction includes: Select a BCH code with error correction capability t and generate random codewords within the security chip; The voiceprint public parameters are calculated by performing a bitwise XOR operation between the random codeword and the binary feature string. A hash operation is performed on the random codewords to obtain the stable voiceprint key; The voiceprint is re-acquired to obtain a noisy binary string. When the Hamming distance between the noisy binary string and the binary feature string is less than or equal to t, the voiceprint is reconstructed using the public parameters of the voiceprint through BCH code.
[0010] Optionally, based on a synchronized time counter and a shared root seed, the one-time permutation key corresponding to the current time window is derived in real time using the HMAC algorithm, including: Based on the synchronized RTC clock of both parties and the agreed start time of the call, calculate the window counter value corresponding to the current time window; The window counter value and the context identifier of the call are concatenated to obtain a bit string, and a one-time permutation key is generated by the HMAC algorithm; the key of the HMAC algorithm is a shared root seed; Using a one-time permutation key as a seed, the current time window is expanded using the HMAC algorithm to obtain a pseudo-random bit stream.
[0011] Optionally, a temporal permutation sequence is generated based on the one-time permutation key, the acquired analog speech signal is framed to generate a permutation window, and the microframes within the permutation window are temporally shuffled according to the temporal permutation sequence to obtain an encrypted speech frame stream, including: The analog speech signal acquired by the microphone is divided into frames, N microframes are continuously buffered, and the starting address of each microframe in SRAM is recorded to obtain a microframe pointer array and the current permutation window. The microframe pointer array within the permutation window is expanded using the one-time permutation key to obtain pseudo-random integers. The positions of the elements in the microframe pointer array are then iteratively swapped using the Fisher-Yates Shuffle algorithm to obtain the temporal permutation sequence. The audio data of each microframe is read sequentially according to the address order of the time permutation sequence and sent to the Bluetooth transmission queue to form an encrypted voice frame stream.
[0012] Optionally, the positions of elements in the microframe pointer array are iteratively swapped using the Fisher-Yates Shuffle algorithm to obtain a temporal permutation sequence, including: Iterate backward from the end of the microframe pointer array and extract pseudo-random integers from the pseudo-random bitstream; Calculate the target index for the swap based on pseudo-random integers; The temporal permutation sequence is obtained by swapping the positions of elements in the microframe pointer array according to the target index.
[0013] Optionally, an inverse permutation sequence is calculated based on the one-time permutation key, and the encrypted voice frame stream is shuffled in reverse time according to the inverse permutation sequence to obtain a micro-frame sequence in the original time order, including: Reconstruct the same forward permutation mapping as the sender based on the one-time permutation key at the receiving end; The inverse mapping is obtained by traversing and calculating the encrypted voice frame stream according to the forward permutation mapping. The encrypted voice frames are reordered according to the inverse mapping to obtain a microframe sequence.
[0014] Optionally, cross-smoothing is performed at the boundaries of adjacent microframes in the microframe sequence to obtain the restored continuous speech signal. This includes: selecting multiple samples from the tail of the previous frame and the head of the next frame at the boundaries of adjacent microframes according to the cross-smoothing length, and then weighting and mixing them using a weighting function to obtain the continuous speech signal.
[0015] Optionally, the weighting function can be linear or cosine.
[0016] A Bluetooth headset-side voice encryption and decryption system based on voiceprint key and microframe timing permutation, used to implement the aforementioned Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation, includes: The voiceprint registration and root seed generation module is used to exchange the voiceprint public parameters of both parties through a plaintext channel during the initial pairing phase of the Bluetooth headsets of both parties in a call, and to calculate the shared root seed in the security chip built into each headset. The dynamic permutation key derivation module is used to derive the one-time permutation key corresponding to the current time window in real time based on the synchronous time counter and the shared root seed, using the HMAC algorithm. The edge-side low-power microframe encryption module is used to generate a time-series permutation sequence based on a one-time permutation key, divide the acquired analog speech signal into frames, generate a permutation window, and shuffle the microframes within the permutation window according to the time-series permutation sequence to obtain an encrypted speech frame stream. The end-side inverse permutation module is used to calculate the inverse permutation sequence based on the one-time permutation key, and to perform reverse temporal shuffling on the encrypted voice frame stream based on the inverse permutation sequence to obtain the original time-ordered micro-frame sequence; The audio quality resmoothing module is used to perform cross-smoothing at the boundaries of adjacent microframes in a microframe sequence to obtain the restored continuous speech signal.
[0017] According to specific embodiments provided by the present invention, the following technical effects are disclosed: The Bluetooth headset end-side voice encryption and decryption method and system based on voiceprint key and microframe timing permutation provided by the present invention combines a voiceprint fuzzy extractor, BCH error correction code and ECDH key negotiation to complete the generation of shared root seed and voiceprint binding storage during the pairing phase within the headset security chip. It relies on a synchronized RTC clock and HMAC algorithm, borrowing the TOTP mechanism to derive a one-time permutation key for each time window, and employs Fisher-Yates... The Shuffle algorithm encrypts the memory pointers of 10ms voice microframes by performing a 35-frame window-level temporal permutation. The receiving end reconstructs the inverse permutation sequence to restore the microframe temporal order and eliminates splicing artifacts by using linear or cosine cross-smoothing at frame boundaries to restore continuous speech. This method only swaps pointers without changing the audio sampling points, resulting in extremely low computational overhead. It is compatible with low-power Bluetooth headset hardware and has a high password security strength of 35!. It relies on a one-time key to achieve forward security and resists voiceprint replay attacks. Encryption and decryption are all completed in the headset hardware, avoiding the risk of mobile phone Trojan eavesdropping. At the same time, it is ready to use immediately without requiring users to manually enter passwords, balancing communication security, device power consumption, and user experience. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of the Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to the present invention. Figure 2 This is a schematic diagram of the Bluetooth headset-side encryption and decryption architecture based on voiceprint keys according to the present invention. Figure 3 This is a schematic diagram of the Bluetooth headset-side voice encryption and decryption system based on voiceprint key and microframe timing permutation according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] like Figure 1 and Figure 2 As shown, this invention provides a Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation, comprising the following steps: Step 100: During the initial pairing phase of the Bluetooth headsets of both parties, the voiceprint public parameters of both parties are exchanged through a plaintext channel, and the shared root seed is calculated in the security chip built into each headset. Step 200: Based on the synchronous time counter and the shared root seed, the one-time permutation key corresponding to the current time window is derived in real time using the HMAC algorithm; Step 300: Generate a temporal permutation sequence based on the one-time permutation key, divide the acquired analog speech signal into frames, generate a permutation window, and shuffle the microframes within the permutation window according to the temporal permutation sequence to obtain an encrypted speech frame stream; Step 400: Calculate the inverse permutation sequence based on the one-time permutation key, and shuffle the encrypted voice frame stream in reverse time order based on the inverse permutation sequence to obtain the original time-ordered microframe sequence; Step 500: At the boundaries of adjacent microframes in the microframe sequence, perform cross-smoothing to obtain the restored continuous speech signal.
[0023] In this embodiment, the security chip (SE) in step 100 is externally connected inside the headset via an I2C or SPI bus, possessing physical anti-tampering capabilities at CC EAL 6+ level. After the shared root seed S generated by voiceprint pairing is stored in the SE, it is physically unreadable. All key derivation calculations are performed internally within the SE, and only a one-time substitution key is output to the main control chip. A high-security architecture of "voiceprint root seed + synchronization counter = one-time key" is adopted to address the security vulnerabilities of static biometric features. Specifically, before the first encrypted call, both parties exchange voiceprint public parameters (HelperData) through a plaintext channel. After receiving the user's confirmation command by tapping the side of the headset, each party calculates and generates a shared root seed S (256 bits), which is permanently stored in the security chips of both headsets.
[0024] Specifically, in the process of generating the shared root seed, the fuzzy extractor is combined with the tap confirmation interaction of the screenless headset. This ensures that the root seed is generated independently within the security chips of both devices, never appearing in any channel throughout the process, and is bound to its storage using a stable voiceprint key. Thus, the two problems of key negotiation and human-machine binding are simultaneously solved under screenless and keyboardless interaction conditions. The specific calculation process of the shared root seed is as follows: (1) Extraction of stable voiceprint key (during the registration phase, each party executes independently) The headset captures the main voice and extracts L-dimensional voiceprint features, which are then quantized into a binary string W∈{0,1}. L Select a BCH(L,k,2t+1) code C with error correction capability t, generate a random codeword c∈C within the secure chip, and calculate: HD = W⊕c; R = SHA-256(c); Wherein, HD stands for Voiceprint Public Parameters (HelperData), and R is the user's stable voiceprint key. Since the codeword c is a random quantity generated internally by the security chip and is never output, HD does not reveal any information about W in an information theory sense, and therefore can be exchanged via a plaintext channel; t is the error correction capability of the BCH code, i.e., the maximum number of allowed flipped bits of the voiceprint feature, and its value must be a trade-off between fault tolerance and security strength; k is the information bit length of the BCH code, which determines the remaining entropy for extracting the key.
[0025] (2) Voiceprint reconstruction (performed each time the device is worn for authentication) The noisy texture feature W' was obtained again by re-collection. When the Hamming distance satisfies d... H When (W,W')≤t: c'=Decode_BCH(HD⊕W')=c; R'=SHA-256(c')=R; Among them, Decode_BCH is BCH error correction encoding, which means that even under the condition that the voiceprint has natural fluctuations (such as colds, changes in speech rate, and differences in wearing position), the same key can still be stably reproduced. W and W' are the binary strings of voiceprint features extracted in the registration and authentication stages, respectively, and both have a length of L. c and c' are the random codewords generated in the security chip and their reconstructed values. R is the stable voiceprint key, which exists only inside the security chip and cannot be read out.
[0026] (3) Both parties share confidentiality agreements (to be implemented upon initial pairing) Both parties' earphones generate temporary private keys a and b respectively within the security chip. Using the elliptic curve base point G, they calculate their respective public keys A = a·G and B = b·G, and exchange them along with their respective public parameters HD_A and HD_B through a plaintext channel. Subsequently, each party calculates: Z = a·B = b·A = ab·G; Where Z is the ECDH shared secret.
[0027] (4) User confirmation and root seed solidification Each earphone maps a few low bits of the SHA-256(Z) signal to a rhythmic prompt, allowing the user to auditorily verify if both sides are consistent. After confirmation, the user taps the interaction module on the side of the earphone, and the security chips of both earphones immediately perform calculations. S=HKDF-SHA256(IKM=Z,salt=sort(HD_A,HD_B),info="RootSeed-v1",L_out=256); Here, S is the shared root seed, with a length of 256 bits; KM and salt are the input key material and salt value of HKDF, respectively; sort(·) indicates that the two public parameters are concatenated after being arranged in lexicographical order to ensure that the derived inputs of both parties are completely identical. Since the input Z and salt are the same for both parties, each party calculates the same S, and S itself is never transmitted in the channel. The above knock confirmation also serves to resist man-in-the-middle attacks, and its principle is consistent with the numerical comparison in the Bluetooth standard pairing process.
[0028] (5) Binding storage of root seeds S is not stored in plaintext, but is encrypted with the local voiceprint stable key R and then embedded in the security chip: S_enc=AES-256(R,S); Each time the device is powered on or re-worn, the headset must repeat step (2) to reproduce R in order to decipher S for subsequent key derivation. If the wearer is changed, the Hamming distance between their voiceprint feature and the registered feature exceeds t, the decoding of c' fails, R cannot be reproduced, S_enc cannot be decrypted, and the solidified root seed becomes invalid, thus realizing the binding of the root seed with the wearer's biometrics.
[0029] Since a person's voiceprint is static and unchanging, it is highly vulnerable to recording and replay attacks if used directly as a key. In step 200 of this embodiment, during each encrypted call, both headsets use the internal RTC clock-synchronized counter C, combined with the shared root seed S, to generate a one-time permutation key for the current time window within the SE chip using the HMAC-SHA256 algorithm. This key is destroyed after use, ensuring that even if the key is cracked at a certain point in time, it is impossible to deduce the content of past or future calls (forward security).
[0030] Specifically, the key update cycle is strictly aligned with the voice permutation window cycle, ensuring that each permutation window corresponds to an independent, one-time-use, and self-destructible key. This directly introduces the replay resistance capability of the TOTP mechanism, which derives one-time passwords based on a time counter, into the temporal permutation process of voice frames. The specific calculation process is as follows: (1) Determining the window counter Let T (in milliseconds) be the current time after the RTC clocks of both headsets are synchronized, T_0 be the agreed start time when this call was established, and T_w be the replacement window duration (in this embodiment, T_w = 350ms, i.e., N = 35 10ms microframes). Then, the counter value of the current window is: ; (2) Derivation of a one-time permutation key Calculations are performed inside the security chip: K_n=HMAC-SHA256(S,ENC64(C)‖CTX); Where S is the 256-bit shared root seed and serves as the HMAC key; ENC64(C) indicates that the window counter C is encoded as 8 bytes in big-endian order; CTX is the context identifier for this call, containing the session random number negotiated during call establishment, used to prevent replay across calls; the symbol ‖ indicates bit string concatenation. The one-time permutation key K_n of the nth output window is 256 bits long; This indicates rounding down to the nearest integer.
[0031] It should be noted that in this embodiment, the Bluetooth headset adopts a minimalist design without physical buttons; all interactions are completed through touch and click. The main control chip in the Bluetooth headset is a Bluetooth audio SoC with an ARM Cortex-M4F / M33 core. This chip incorporates the Fisher-Yates Shuffle timing permutation algorithm, requiring only one Fisher-Yates Shuffle operation for a 10ms frame (e.g., only 35 memory address swaps are needed when N=35), avoiding multiplication and addition operations for each audio sample point, making the power consumption of the encryption module almost negligible.
[0032] Specifically, the implementation of the Fisher-YatesShuffle algorithm on a low-power microcontroller is as follows: The starting addresses of the N microframes buffered within the swapping window in the SRAM are set sequentially as p_0, p_1, ..., p_(N-1), forming a pointer array P = [p_0, p_1, ..., p_(N-1)]. In this embodiment, N = 35, each pointer occupies 4 bytes, and the array occupies a total of 4N = 140 bytes.
[0033] The algorithm iterates from the end of the array backwards, performing the following three steps sequentially for i = N-1, N-2, ..., 1: r_i = PRNG_i(K_n); j_i=r_imod(i+1), 0≤j_i≤i; (P[i],P[j_i]) (P[j_i],P[i]); Where i is the index of the current iteration, decreasing from N-1 to 1; K_n is the one-time permutation key for the current time window; PRNG_i(K_n) represents the i-th segment in the pseudo-random bitstream expanded by K_n, and r_i is the unsigned integer corresponding to this segment; j_i is the target index of the i-th iteration; P[i] is the i-th element of the pointer array, pointing to the starting address of the corresponding microframe. The array P' obtained after the iteration is the permutation sequence of this window, and each microframe is read sequentially and sent to the Bluetooth transmission queue. Since j_i takes a uniform value in the interval [0, i], the N! permutations output by this algorithm are strictly equal in probability and have no bias, so the permutation space is N! = 35! ≈ 2. 133 .
[0034] For example, completing a permutation window requires N-1=34 modulo operations and 34 4-byte pointer swaps, without involving any multiplication or addition operations for audio sample points. With a window duration of 350ms, this equates to approximately 97 integer operations and 97 memory swaps per second. In contrast, encrypting the same 16kHz, 16-bit audio stream using AES-128 requires processing approximately 2000 128-bit blocks, approximately 20,000 round transformations, and corresponding S-box lookups per second. The computational complexity differs by more than three orders of magnitude, which is precisely why this invention can run in real-time on low-power Bluetooth SoCs without a hardware encryption engine and with negligible power consumption.
[0035] (3) Expand into the pseudo-random sequence required for the permutation. The Fisher-Yates iteration process built into the main control chip requires N-1 pseudo-random numbers. To avoid maintaining the internal state of the pseudo-random number generator separately in the main control chip, K_n is directly expanded into a bit stream in counting mode: B=HMAC-SHA256(K_n,0x01)‖HMAC-SHA256(K_n,0x02)‖…; Sequentially extract consecutive bit segments from B, and the corresponding unsigned integers are r_i in the Fisher-Yates iteration process. With N=35, a total of 34 random numbers are needed, each taking 32 bits, for a total of 1088 bits. Therefore, taking the first 5 groups of B (1280 bits) is sufficient, and there is no need to iterate and expand to more groups.
[0036] (4) Key destruction When the nth window ends, the security chip immediately clears the registers occupied by K_n and B. Due to the one-way nature of HMAC-SHA256, the leaked K_n cannot be used to deduce the shared root seed S, nor can it deduce K_(n-1) or K_(n+1) of the adjacent window, thus making the process both forward and backward secure.
[0037] (5) Clock deviation tolerance The maximum allowable deviation of the RTC between the two parties is ±T_w / 2. When the C calculated by the receiver is inconsistent with that of the transmitter, the inverse permutation will fail to correctly reconstruct the voice. Therefore, when the receiver detects a reconstruction failure, it substitutes C-1 and C+1 into the K_n calculation process in sequence to derive a new key and retry.
[0038] In this embodiment, step 300 achieves low-power encryption at the transmitting end based on microframe timing permutation and end-side audio quality restoration, specifically including: 1) dividing the voice collected by the microphone into 10ms frames; 2) buffering the memory pointers of 35 consecutive frames (instead of copying audio data); 3) using the one-time key of the current window as a seed, generating a random permutation index of length 35 through the Fisher-Yates Shuffle algorithm; 4) sending the 35 frames of voice data sequentially to the Bluetooth radio frequency module according to the order of the random index.
[0039] Specifically, step 300 replaces the memory pointer of the audio microframe rather than the audio sampling point, ensuring that the encryption process does not touch the sample data at all; simultaneously, its random source is directly taken from the one-time key K_n with the same period as the replacement window, so that each 350ms window corresponds to an independent permutation. The specific implementation process at the sending end is as follows: (1) Frame division and pointer buffer The audio signal captured by the microphone is framed in 10ms increments, with each frame containing M=160 sample points at a sampling rate of 16kHz. 35 frames are continuously buffered, and the starting address of each frame in SRAM is recorded, forming a pointer array P=[p_0,p_1,…,p_34].
[0040] (2) Generate the permutation sequence Calculate the one-time key K_n and the pseudo-random bit stream B expanded from it according to steps (2) and (3) of step 200. Then, iterate and exchange the pointer array P' after permutation according to the Fisher-YatesShuffle algorithm decreasing from i=34 to i=1. The permutation is denoted as the mapping, and the expression is: π:{0,1,…,N-1}→{0,1,…,N-1}, and P'[i]=p_π(i); Where π(i) represents the microframe with original sequence number i being placed in the i-th position of the transmission sequence; N is the number of microframes in the permutation window, which is 35 in this embodiment.
[0041] (3) Send in sequence Microframes are read sequentially at the addresses pointed to by P'[0], P'[1], ..., P'[N-1] and sent to the Bluetooth transmission queue. This process only changes the memory reading order and does not modify the values of any audio sampling points, thus not introducing any quantization error or spectral distortion.
[0042] (4) Window advancement After each permutation window is completed, the window counter C is incremented by 1, and the key K_(n+1) for the next window is regenerated, while K_n is cleared to zero.
[0043] In this embodiment, in step 400, the receiving earphone first buffers the received 35 frames of encrypted voice, and then uses the synchronously generated K_n to calculate the inverse permutation index, thereby restoring the received frames to their original time order; the specific implementation process is as follows: What content is distorted? The specific calculation process is as follows.
[0044] (1) Calculation of inverse permutation index The receiving end reconstructs the forward permutation map π using the same K_n derived synchronously, and its inverse map π (-1) The following formula is obtained through a single iteration: π (-1) (π(i))=i, i=0,1,…,N-1; This involves writing data to an array of length N, with π(i) as the index and i as the value. This calculation requires only N memory writes and no solving or searching operations are needed.
[0045] (2) Restoration of frame order Let F_i be the i-th microframe stored in the receive buffer in arrival order. Then the m-th frame after restoring the original timing sequence is: F'_m=F_(π (-1) (m)), m=0,1,…,N-1; In this embodiment, since the transmitting end directly performs hard segmentation on the 10ms frame, after inverse permutation to restore the order, the boundary between adjacent frames may produce phase discontinuities due to slight truncation errors in sampling accuracy, which are perceived as high-frequency "clicking artifacts." Therefore, step 500 performs short-time cross-fade at the receiving end: at the boundary between two adjacent frames, the last 2 milliseconds of the previous frame and the first 2 milliseconds of the next frame are taken and linearly or cosine-weightedly mixed. Since these two frames are continuous in the original speech, this re-smoothing operation not only losslessly stitches together the waveform but also completely eliminates segmentation artifacts, restoring high-fidelity continuous speech.
[0046] Specifically, step 500 strictly limits the application of cross-smoothing to the boundary of the original adjacent frames after inverse permutation recovery. Since the two frames at this point are already adjacent in the original speech, what is being mixed is the overlapping part of the same continuous waveform, thus eliminating segmentation artifacts without introducing any content distortion; the specific implementation process is as follows: (1) Smooth intersections at the boundary Let the cross-smoothing length be M_f sample points (in this embodiment, M_f = 32, corresponding to 2ms). For two adjacent frames F'_m and F'_(m+1) after inverse permutation, the output sample at their boundary is: y(k)=[1-w(k)]·F'_m(M-M_f+k)+w(k)·F'_(m+1)(k), k=0,1,…,M_f-1; Where M is the number of sample points per frame, which is 160 in this embodiment; the weighting function w(k) is preferably linear or cosine.
[0047] Specifically, for linear form: w(k) = (k + 0.5) / M_f; Cosine form: w(k) = 0.5 - 0.5·cos[π·(k+0.5) / M_f]; Both equations satisfy w(0)≈0 and w(M_f-1)≈1, and w(k)+[1-w(k)]=1 is always true throughout the smooth region. Therefore, the energy is conserved during the mixing process, and no audible gain fluctuations are generated at the frame boundaries. The first derivative of the cosine weighted sum at both ends is zero, and the transition is smoother than that of the linear sum, which can further suppress residual high-frequency artifacts.
[0048] (2) Output The non-overlapping parts of each frame are sequentially spliced with the overlapping parts calculated by the output sample at the boundary to obtain the restored continuous speech, which is then sent to the speaker for playback.
[0049] like Figure 3 As shown, the present invention also provides a Bluetooth headset-side voice encryption and decryption system based on voiceprint key and microframe timing permutation, used to implement the above-mentioned Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation, including: The voiceprint registration and root seed generation module is used to exchange the voiceprint public parameters of both parties through a plaintext channel during the initial pairing phase of the Bluetooth headsets of both parties in a call, and to calculate the shared root seed in the security chip built into each headset. The dynamic permutation key derivation module is used to derive the one-time permutation key corresponding to the current time window in real time based on the synchronous time counter and the shared root seed, using the HMAC algorithm. The edge-side low-power microframe encryption module is used to generate a time-series permutation sequence based on a one-time permutation key, divide the acquired analog speech signal into frames, generate a permutation window, and shuffle the microframes within the permutation window according to the time-series permutation sequence to obtain an encrypted speech frame stream. The end-side inverse permutation module is used to calculate the inverse permutation sequence based on the one-time permutation key, and to perform reverse temporal shuffling on the encrypted voice frame stream based on the inverse permutation sequence to obtain the original time-ordered micro-frame sequence; The audio quality resmoothing module is used to perform cross-smoothing at the boundaries of adjacent microframes in a microframe sequence to obtain the restored continuous speech signal.
[0050] The beneficial effects of this invention are as follows: 1) This invention uses 10ms microframes (containing hundreds of sampling points) as the smallest unit for overall position swapping, requiring only 35 pointer swapping operations every 350ms. This results in an exponential decrease in computational overhead, significantly extending the headphone's battery life. Simultaneously, the permutation space of the 35-frame sliding window is as high as 35!≈2. 133 It fully meets the security strength requirements of modern cryptography against brute-force attacks; 2) Static voiceprint features are used only to generate the "root seed", while the actual encryption uses a one-time key derived from time synchronization (TOTP), which completely eliminates the "replay attack" that is easily suffered by simply using biometric features, and ensures that the key is different for each call and even for each time window, thus achieving perfect forward security of communication. 3) Users do not need to remember or enter any passwords. They can automatically complete identity authentication and encryption simply by wearing the earphone and speaking. This provides an excellent user experience. At the same time, the encryption and decryption process is completed entirely within the earphone hardware, making it completely immune to Trojan eavesdropping from the mobile operating system.
[0051] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0052] Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. Furthermore, those skilled in the art will recognize that, based on the ideas of this invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation, characterized in that, Includes the following steps: During the initial pairing phase of the Bluetooth headsets of both parties, the voiceprint public parameters of both parties are exchanged through a plaintext channel, and the shared root seed is calculated separately in the security chip built into each headset. Based on the synchronous time counter and the shared root seed, the one-time permutation key corresponding to the current time window is derived in real time through the HMAC algorithm. A temporal permutation sequence is generated based on the one-time permutation key. The acquired analog speech signal is then framed to generate a permutation window. The microframes within the permutation window are then shuffled in time according to the temporal permutation sequence to obtain an encrypted speech frame stream. The inverse permutation sequence is calculated based on the one-time permutation key, and the encrypted voice frame stream is shuffled in reverse time according to the inverse permutation sequence to obtain the original time sequence of microframes. At the boundaries of adjacent microframes in the microframe sequence, cross-smoothing is performed to obtain the restored continuous speech signal.
2. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 1, characterized in that, During the initial pairing phase of the Bluetooth headsets of both parties, they exchange voiceprint public parameters through a plaintext channel, and calculate the shared root seed within the security chips built into both headsets, including: The system collects the host's voice and extracts voiceprint features, then converts the voiceprint features into a binary feature string; A random BCH codeword is generated within the security chip. The voiceprint disclosure parameters are obtained by performing a bitwise XOR operation between the binary feature string and the random BCH codeword. Both Bluetooth headsets generate temporary private keys and calculate corresponding elliptic curve public keys within the security chip, and exchange the elliptic curve public keys with the voiceprint public parameters in plaintext. Based on the temporary private key of this party and the elliptic curve public key of the other party, the same shared secret is calculated through a key negotiation algorithm, and the hash value of the shared secret is mapped to the rhythm of the prompt tone; After the user confirms and triggers the interaction command, the shared root seed is calculated using the key derivation function based on the shared secret and the voiceprint public parameters. The shared root seed is symmetrically encrypted using a voiceprint stabilization key and then stored in the security chip. When the wearer's voiceprint verification is successful and the voiceprint stabilization key is reproduced, the shared root seed is decrypted and used to reconstruct the voiceprint.
3. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 2, characterized in that, When the wearer's voiceprint verification is successful and the stable voiceprint key is reproduced, the specific process of re-decrypting and calling the shared root seed to reconstruct the voiceprint includes: Select a BCH code with error correction capability t, and generate a random codeword within the security chip; The random codeword and the binary feature string are XORed bitwise to calculate the voiceprint disclosure parameters. The random codeword is hashed to obtain the stable voiceprint key; A noisy binary string is obtained by re-collecting the voiceprint. When the Hamming distance between the noisy binary string and the binary feature string is less than or equal to t, the voiceprint is reconstructed using the BCH code based on the publicly available voiceprint parameters.
4. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 1, characterized in that, Based on the synchronized time counter and the shared root seed, the one-time permutation key corresponding to the current time window is derived in real time using the HMAC algorithm, including: Based on the synchronized RTC clock of both parties and the agreed start time of the call, calculate the window counter value corresponding to the current time window; The window counter value and the call context identifier are concatenated to obtain a bit string, and the one-time permutation key is generated by the HMAC algorithm; the key of the HMAC algorithm is the shared root seed; Using the one-time permutation key as a seed, the current time window is expanded using the HMAC algorithm to obtain a pseudo-random bit stream.
5. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 4, characterized in that, A temporal permutation sequence is generated based on the one-time permutation key. The acquired analog speech signal is then framed to generate a permutation window. The microframes within the permutation window are then temporally shuffled according to the temporal permutation sequence to obtain an encrypted speech frame stream, including: The analog speech signal acquired by the microphone is divided into frames, N microframes are continuously buffered, and the starting address of each microframe in SRAM is recorded to obtain a microframe pointer array and the current permutation window; The microframe pointer array within the permutation window is expanded according to the one-time permutation key to obtain pseudo-random integers, and the element positions of the microframe pointer array are iteratively swapped using the Fisher-Yates Shuffle algorithm to obtain the temporal permutation sequence; The audio data of each microframe is read sequentially according to the address order of the time-series permutation sequence and sent to the Bluetooth transmission queue to form the encrypted voice frame stream.
6. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 5, characterized in that, The temporal permutation sequence is obtained by iteratively swapping the elements of the microframe pointer array using the Fisher-Yates Shuffle algorithm, including: Iterate backward from the end of the microframe pointer array and extract the pseudo-random integer from the pseudo-random bit stream; Calculate the target index for the exchange based on the pseudo-random integer; The elements in the microframe pointer array are swapped according to the swap target index to obtain the temporal permutation sequence.
7. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 1, characterized in that, The inverse permutation sequence is calculated based on the one-time permutation key, and the encrypted voice frame stream is then shuffled in reverse time according to the inverse permutation sequence to obtain a micro-frame sequence in the original time order, including: Reconstruct the same forward permutation mapping as the sender based on the one-time permutation key at the receiving end; The encrypted voice frame stream is traversed and calculated according to the forward permutation mapping to obtain the inverse mapping; The encrypted voice frames are reordered according to the inverse mapping to obtain the microframe sequence.
8. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 1, characterized in that, At the boundaries of adjacent microframes in the microframe sequence, cross-smoothing is performed to obtain the restored continuous speech signal. This includes: at the boundaries of adjacent microframes, selecting multiple samples from the tail of the previous frame and the head of the next frame according to the cross-smoothing length, and then weighting and mixing them using a weighting function to obtain the continuous speech signal.
9. The Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation according to claim 8, characterized in that, The weighting function is either linear or cosine.
10. A Bluetooth headset-side voice encryption and decryption system based on voiceprint key and microframe timing permutation, used to implement the Bluetooth headset-side voice encryption and decryption method based on voiceprint key and microframe timing permutation as described in any one of claims 1-9, characterized in that, include: The voiceprint registration and root seed generation module is used to exchange the voiceprint public parameters of both parties through a plaintext channel during the initial pairing phase of the Bluetooth headsets of both parties in a call, and to calculate the shared root seed in the security chip built into each headset. The dynamic permutation key derivation module is used to derive the one-time permutation key corresponding to the current time window in real time using the HMAC algorithm based on the synchronization time counter and the shared root seed. The edge-side low-power microframe encryption module is used to generate a time-series permutation sequence based on the one-time permutation key, divide the acquired analog speech signal into frames, generate a permutation window, and shuffle the microframes in the permutation window according to the time-series permutation sequence to obtain an encrypted speech frame stream. The end-side inverse permutation module is used to calculate the inverse permutation sequence based on the one-time permutation key, and to perform inverse temporal scrambling on the encrypted voice frame stream based on the inverse permutation sequence to obtain the original time-ordered microframe sequence; The audio quality resmoothing module is used to perform cross-smoothing processing at the boundaries of adjacent microframes in the microframe sequence to obtain the restored continuous speech signal.