A digital intercom lightweight voice encryption method and device
By combining a lightweight hybrid encryption module with AES, Chacha20 streams, and a double-layer RSAq algorithm, real-time voice encryption is achieved for walkie-talkies. This solves the problem of the STM32F103C6T6 being unable to handle complex encryption algorithms, reduces costs, and improves security and real-time performance.
Patent Information
- Application Number
- CN202510117890.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-01-24
AI Technical Summary
The existing walkie-talkies use the low-performance STM32F103C6T6 microcontroller, which cannot effectively process complex encryption algorithms such as AES, resulting in the need for an external encryption chip, which increases costs. In addition, the existing encryption method cannot perform real-time encryption during information transmission.
A lightweight hybrid encryption module is used, combining the AES encryption algorithm, the ChaCha20 stream encryption algorithm and the double-layer RSAq encryption algorithm to perform double-layer encryption on voice data and keys. The encryption function is implemented in software, which reduces hardware costs and realizes real-time encryption during transmission.
It improves the security and real-time performance of voice data transmission of intercoms, reduces costs, and solves the problem that low-performance development boards require external encryption chips.
Smart Images

Figure CN119993171B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of communication encryption, and particularly relates to a lightweight voice encryption method and device for a digital intercom. BACKGROUND
[0002] The intercom technology collects voice data, transmits the voice data to an encryption module for encryption, and then transmits the encrypted data by a radio frequency module. The overall information transmission mode is similar, and the information cannot be processed during transmission. The information can only be encrypted before transmission and decrypted after reception.
[0003] Currently, the main control MCU used in the intercom related to encryption is a chip with good performance, such as STM32 high-performance voice and signal processing: STM32F7, STM32H7 series, low-power STM32L4, STM32WB series, and STM32F4 series.
[0004] Compared with the above-mentioned chips, the price of STM32F103C6T6 is much lower. STM32F103C6T6 is a microcontroller based on ARM Cortex-M3 core, which has certain computing power, storage capacity and various peripheral interfaces, but its performance is relatively low, especially in processing complex encryption algorithms (such as AES) and real-time voice intercom tasks.
[0005] AES (Advanced Encryption Standard) is a widely used symmetric encryption algorithm with different key lengths (128, 192, 256 bits), and each encryption round in the AES encryption process involves a large number of calculations. Although STM32F103C6T6 supports software acceleration of AES algorithm, its software acceleration function is not comprehensive, and an additional encryption chip is needed to improve the overall hardware encryption performance, but this will increase the cost. SUMMARY
[0006] The application provides a lightweight voice encryption method and device for a digital intercom to solve at least one of the above technical problems in the prior art.
[0007] The application adopts the following technical solution: a lightweight voice encryption method for a digital intercom, comprising the following steps:
[0008] Obtaining encrypted voice data; the encrypted voice data is obtained by a microphone module and obtained through digital-to-analog conversion and PCM format switching;
[0009] The AES encryption algorithm and the chacha20 stream encryption algorithm based on the lightweight hybrid encryption module are used to encrypt the voice data to be encrypted, and the double-layer RSAq encryption algorithm based on the lightweight hybrid encryption module is used to encrypt the AES encryption key.
[0010] The encrypted data and the key are used to trigger the lightweight hybrid decryption module to perform decryption and voice playing through the power amplifier module.
[0011] Preferably, the lightweight hybrid encryption module comprises two layers, i.e., an inner layer and an outer layer, wherein the inner layer adopts a combination of block encryption and byte sequence encryption, i.e., the voice data to be encrypted is encrypted through the AES encryption algorithm and the chacha20 stream encryption algorithm, and the outer layer uses the double-layer RSAq encryption algorithm to encrypt the inner layer key.
[0012] Preferably, the inner layer of the lightweight hybrid encryption module is used to achieve the purpose of data screening, and a counter is built-in. When 10 packets of transmission are reached, chacha20 stream encryption is performed, and AES encryption packet transmission is performed. One round of chahca20 stream encryption and AES encryption is used as one overall inner layer encryption.
[0013] The obtained ciphertext formula is as follows:
[0014]
[0015] c i =E k m i
[0016] wherein c i is ciphertext, m i is block plaintext, the plaintext refers to voice data to be encrypted, x i is a chacha20 stream key seed, E k is an AES encryption function.
[0017] Preferably, the key seed of chacha20 is generated based on a random number. The key seed is updated once for 10 chacha20 encrypted packets each time. Two buffer areas are set up, one is used for updating the chacha20 key seed value, and the other is used for recording the current chacha20 key seed value for data encryption.
[0018] The key seed value of the seed buffer area is updated in the process of sending 10 chacha20 data packets, and is used to update the actual key seed value later. When the count value indicates that 10 chacha20 stream encryption packets have been sent, the value of the seed buffer area is updated to cover the value of the current key seed buffer area.
[0019] Preferably, the double-layer RSAq encryption algorithm is used to encrypt the AES encryption algorithm key before the default permutation number of both parties is used to perform the permutation replacement;
[0020] When the key is generated for the first time, the prime factor p is built-in, and the large prime factor q is generated by using the Miller-Rabin primality test algorithm, and the generated large prime factor q is stored in a file as the prime factor p for next time; on this basis, it is named as RSAq encryption algorithm and placed in the inner layer, and the public key and the modulus length are hidden by combining the structure idea of the symmetric encryption algorithm; the outer layer uses one layer of optimized RSAq for protection.
[0021] Preferably, the modulus length n calculation and the encryption formula are as follows:
[0022] n1=p1×q1
[0023] φ(n1)=(p1-1)×(q1-1)
[0024]
[0025] (e i ,n i )->(e' i ,n' i )
[0026] n2=p2×q2
[0027] φ(n2)=(p2-1)×(q2-1)
[0028]
[0029] Wherein: n is the modulus length value, p is the built-in prime factor, q is the large prime factor generated by the Miller-Rabin primality test algorithm, c i is the ciphertext, m is the plaintext, e is the public key, 1<e<φ(n), and e and φ(n) are relatively prime, when i is 1, all symbols represent the characteristic number of the inner layer encryption algorithm, when i is equal to 2, all symbols represent the characteristic number of the outer layer encryption algorithm, c1 is the ciphertext obtained by the inner layer encryption, and also as the plaintext of the outer layer encryption, the key is that the outer layer RSAq encryption algorithm selects the first 250 bits of the ciphertext obtained by the inner layer RSAq encryption algorithm as the plaintext for encryption, and in subsequent use, the randomness of selecting different length of outer layer plaintext can be increased, and in this paper, the plaintext with a length of 250 bits is used as the outer layer, and mod represents the modulus operation.
[0030] A digital intercom lightweight voice encryption device, comprising a microphone module, an A / D analog-digital conversion module, a PCM encoding and decoding module I, a lightweight hybrid encryption module, a Bluetooth module, a PCM encoding and decoding module II, a D / A digital-analog conversion module, a lightweight hybrid decryption module and a power amplifier module.
[0031] The microphone module is used to acquire voice information of a user, the A / D analog-digital conversion module PC is used to convert a digital signal into an analog signal, the PCM codec module I is used to switch the analog signal into a PCM format, and the lightweight hybrid encryption module is used to encrypt the voice data to be encrypted.
[0032] The lightweight hybrid encryption module is connected with the PCM codec module II through the Bluetooth module, the PCM codec module II is connected and used to switch the PCM format data into an analog signal, the D / A digital-analog conversion module is used to convert the analog signal into a digital signal, the lightweight hybrid decryption module is used to decrypt the encrypted voice data, and the power amplifier module is used to play the decrypted voice.
[0033] Preferably, a preprocessing module is further arranged in front of the lightweight hybrid encryption module, the preprocessing module sets a high threshold value as 4000 and a low threshold value as 100 according to the range of sampling accuracy and the digital sampling value of the overall speaker, and forms a voice data group to be encrypted.
[0034] Compared with the prior art, the present application has the following beneficial effects:
[0035] The present application adopts the method of preprocessing threshold value, reduces the data volume, encrypts the effective data, combines the lightweight hybrid encryption method, and can greatly improve the security and real-time performance of voice data transmission, solves the shortcomings that the development board with low performance needs an additional encryption chip to meet the encryption requirement, and effectively reduces the cost overhead. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0037] Figure 1 It is the overall structure diagram of the present application;
[0038] Figure 2 It is the lightweight hybrid encryption method structure diagram of the present application;
[0039] Figure 3 It is the processor structure diagram of the digital intercom encryption system and device based on Cortex-M of the present application;
[0040] Figure 4 It is the double-layer RSAq encryption algorithm structure diagram involved in the lightweight hybrid encryption method of the present application;
[0041] Figure 5 Score chart for the Cortex-M based digital intercom encryption system of the present application is used;
[0042] Figure 6 Structure block diagram for the double-layer encryption algorithm of the present application is used;
[0043] Figure 7 Actual packet encryption processing schematic diagram DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application are clearly and completely described in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0045] It should be noted that the structures, proportions, sizes, etc. shown in the drawings of the specification are only used to cooperate with the content disclosed in the specification, to be understood and read by those skilled in the art, and do not have technical substantive significance. Any modification of structure, change of proportion relationship, or adjustment of size, without affecting the effects and purposes that can be achieved by the present application, should fall within the scope of the technical content disclosed by the present application. It should be noted that in the specification, relationship terms such as first and second are only used to distinguish one entity from another entity, and do not necessarily require or imply any actual relationship or order between the entities.
[0046] An embodiment is provided by the present application:
[0047] As shown in Figure 1 A digital intercom lightweight voice encryption device includes a microphone module, an A / D analog-digital conversion module, a PCM codec module I, a lightweight hybrid encryption module, a Bluetooth module, a PCM codec module II, a D / A digital-analog conversion module, a lightweight hybrid decryption module, and a power amplifier module. The microphone module is used to obtain voice information issued by a user. The A / D analog-digital conversion module is used to convert a digital signal into an analog signal. The PCM codec module I is used to switch the analog signal into a PCM format. The lightweight hybrid encryption module is used to encrypt voice data to be encrypted. The lightweight hybrid encryption module is connected with the PCM codec module II through the Bluetooth module. The PCM codec module II is connected to switch the PCM format data into an analog signal. The D / A digital-analog conversion module is used to convert the analog signal into a digital signal. The lightweight hybrid decryption module is used to decrypt the encrypted voice data. The power amplifier module is used to play the decrypted voice.
[0048] A preprocessing module is further arranged in front of the lightweight hybrid encryption module, and the preprocessing module sets a high threshold value as 4000 and a low threshold value as 100 according to a range of sampling accuracy and a digital sampling value of an overall speaker, so as to form a set of encrypted voice data.
[0049] The embodiment further includes a lightweight voice encryption method for a digital intercom, comprising the following steps.
[0050] The voice data to be encrypted is obtained by a microphone module, and is obtained through digital-to-analog conversion and PCM format switching; the voice data to be encrypted is encrypted based on an AES encryption algorithm and a chacha20 stream encryption algorithm of the lightweight hybrid encryption module; an AES encryption key is encrypted based on a double-layer RSAq encryption algorithm of the lightweight hybrid encryption module; and the encrypted data and the key are used to trigger a lightweight hybrid decryption module to perform decryption and a power amplifier module to perform voice playing.
[0051] In the double-layer encryption algorithm, when communication is established between two parties, the two parties first send their public keys to each other, and have a default permutation number; after receiving the public keys, the public keys are restored according to the default permutation number, and then the internal and external public keys are stored in a temporary area and used to encrypt the AES key; when a data packet is sent, the AES key encrypted by the double-layer encryption algorithm is marked, and the packet header and the packet tail are set as numbers that do not often coincide, for example, 0xffff and 0xfffe, so as to facilitate different identification processing of different packets; the plaintext is encrypted by the AES encryption algorithm and the chacha20 stream encryption algorithm, and then the AES key is encrypted by the double-layer RSAq encryption algorithm and transmitted to a receiving party; the receiving party decrypts the AES key packet by calling its own private key after receiving the data packet, and decrypts the data packet after obtaining the AES key.
[0052] Preferably, when the AES key is {1234567890abcdef} and the plaintext is "Hello, this is an example data to be encrypted", the double-layer RSAq encryption algorithm encrypts the key as:
[0053] {d iLg6id I60jmCSH / v15eWQI J3hx5U65XVCSOaPmQQ0hg9vYuSHMq+N4LvQsQgYRF9HYzv0QQ6yE1 zGnBFnPOfStxoBNXGPueYVj+332CxPQn6ZrcoH8tO / B / aoifJQJEdr371S0kIey7ZBuMsQiv20v+qUHXmsH l5bPsOr3Vt4vLHcK8+H7C6TxMragS8LFZJha92MM7qdpZAkb+adppE / WRox5f5HCN5wI B / 0bYzjA1 B+1X1mhxHS4vUr7pT2wmmzDI l i92O93vBt+8eZZRAaB+P41 IdW7THgPquuPk0Fpsv4u+9+wcxsTIs07fKAZD382no / TdjyhF7x415xZfgA======$FQyTW+ZPy0YXFv6hbuwurBSck lAM1FwD877jFrLtqRTkmEPjP+DcsuH88I Fwc2au99CKc2bCCzw2NeuHj / M8TXqnX3UWQjAX6ET5vOJARPWGX7z+i8x9 l PfRU4ZI uucohukD6aMbO4L+SFajYjlCJGCcihtP5Ve / Oqs i IOyCWjnEF6s l uMk / ddBR1 i jzQF ZDzcf l T+erSvQ0eLpQURP6Yx33iD16Yo3BeFJ8K5ipT8J l+ / 9tx5GA4dL2MiUu1GD5tpnWZr62Hw9VMvVxq7pJYs7Gm9akgYa9ka0MLtz3bkOB16Xs / Lt / faKQSghbvx7iClWEcnbHCNwLmv2za+kMzw======4u iVJ0mNINKjW8LWK42tSjgjS9jTS3XquL9Qs+ctdSDff76I lZwK+A3eRy6vTL6cI uJe4sXWF / / 6e7sEiYXCLk5HwRiA======},
[0054] The plaintext is encrypted as:
[0055] {bda160ed15e89201 b08be57ff20bebfa3c9352aef6666f87a58b862f985d49fddc772bd82c3750d2a2b5d15ba9085a4f}, the private key and public key of the double-layer encryption algorithm are too long and not shown.
[0056] As Figure 2 shown, the lightweight hybrid encryption module includes two layers of inner and outer, wherein the inner layer selects the combination of block encryption and byte sequence encryption, that is, the voice data to be encrypted is encrypted by AES encryption algorithm and chacha20 stream encryption algorithm, and the outer layer uses double-layer RSAq encryption algorithm to encrypt the inner layer key.
[0057] The principle of RSA encryption algorithm is based on the mathematical fact that "it is easy to multiply two large prime numbers, but it is very difficult to decompose the product into the original prime factors." The generation of public and private keys improves the security coefficient of the key, so the security of the overall RSA encryption algorithm is also quite high in the encryption field. AES encryption algorithm includes key expansion, round key addition, byte substitution, row shift, and column confusion five important parts. The encryption processing of plaintext contains both nonlinear conversion and linear conversion relationship, and itself has high security. Since each step involves the participation of the key, the correlation between the key and the plaintext is relatively strong. When the attacker obtains the key or a part of the sub-key, it greatly reduces the difficulty of cracking the AES encryption algorithm. Therefore, the key of the AES encryption algorithm is considered to be protected. As a relatively low complexity encryption method compared to AES encryption algorithm, chacha20 stream encryption has fast encryption processing speed for data and has a positive effect on real-time processing of data.
[0058] The main association between the outer layer and the inner layer is the key of the inner layer encryption. The double-layer RSAq encryption algorithm is used to encrypt the key of the inner layer due to its high security, and then the encrypted key is transmitted. Both parties improve the security of the key in the AES encryption process by transmitting the encrypted key through the outer layer double-layer RSAq encryption algorithm, so as to achieve the purpose of protecting the inner layer by the outer layer. The inner layer realizes a data filtering part to control the encryption type of the transmission package, and a counter is built-in to achieve 10 package transmission for chacha20 stream encryption, and AES encryption package transmission. One round of chahca20 stream encryption and AES encryption as a whole inner layer encryption;
[0059] The double-layer RSAq encryption algorithm encrypts the AES encryption key, and the ciphertext formula is as follows:
[0060]
[0061] c i =E k m i
[0062] Where: c i is the ciphertext, m i is the group plaintext, and the plaintext refers to the voice data to be encrypted, xi is the chacha20 stream key seed, E k AES encryption function.
[0063] The chacha20 seed itself is generated and updated. When a new chacha20 stream encryption package is received, it means that the counter generated by the chacha20 seed will be updated, and the chacha20 key seed will be updated. When it is the turn of the chacha20 encryption package to be encrypted, the chacha20 key seed can be used to encrypt it directly.
[0064] It is worth noting that before encrypting the AES encryption algorithm key, the double-layer RSAq encryption algorithm first uses the default permutation number of both parties to truncate the key, making it more difficult for crackers to crack it with almost zero execution time. The double-layer RSAq encryption algorithm takes advantage of the fact that RSA prime number generation consumes a lot of time resources and uses space resources to save time resources.
[0065] When the key is first generated, the prime factor p is built in, and the large prime factor q is generated using the Miller-Rabin primality test algorithm. The generated large prime factor q is then stored in a file and used as the next prime factor p. On this basis, it is named the RSAq encryption algorithm and placed in the inner layer. The structural idea of the symmetric encryption algorithm is combined in the middle to hide the public key and modulus length. The outer layer is protected by an optimized RSAq layer to improve security.
[0066] The calculation and encryption formula of the modulus length n are as follows:
[0067] n1=p1×q1
[0068] φ(n1)=(p1-1)×(q1-1)
[0069]
[0070] (e i ,n i )->(e' i ,n' i )
[0071] n2=p2×q2
[0072] φ(n2)=(p2-1)×(q2-1)
[0073]
[0074] Where: n is the modulus length, p is the built-in prime factor, q is the large prime factor generated by the Miller-Rabin primality test algorithm, c iFor ciphertext, m is plaintext, e is public key, 1 < e < φ(n), and e and φ(n) are co-prime, when i is 1, all symbols represent the characteristic number of the inner layer encryption algorithm, when i is 2, all symbols represent the characteristic number of the outer layer encryption algorithm, c1 is the ciphertext obtained by the inner layer encryption, and also the plaintext of the outer layer encryption, the key is to select the first 250 bits of the ciphertext obtained by the inner layer RSAq encryption algorithm as the plaintext for encryption in the outer layer RSAq encryption algorithm, and in subsequent use, the randomness of selecting different lengths of outer layer plaintext can be increased, and in this example, the outer layer plaintext is 250 bits long, mod represents the modulo operation. Figure 6 As shown in the formula (1), the original published modulus n and the public key e are added between the inner layer and the outer layer to confuse the cracker and improve the complexity.
[0075] Referring to Figure 3 , the preferred embodiment is implemented in an actual scenario, a cortex processor is used as a control core, a microphone is used to collect communication voice analog signals, an ADC is used for A / D analog-digital conversion, the collected audio analog signals are converted into PCM digital signals, data packaging of the digital signals is realized by software, and the packaged data is processed by a lightweight hybrid encryption module; in this example, the lightweight hybrid module is completely realized by software, and no additional encryption software chip is needed to realize the software function; the lightweight hybrid encryption method is realized by improving the AES encryption algorithm in the software encryption library Crypto.lib and combining the software-implemented double-layer RSAq encryption algorithm; according to the actual design scenario of the chip main frequency and real-time encryption, the AES encryption algorithm with a 128-bit key length is used, wherein, 4 collected coded data packets are encrypted as one AES encryption packet, and 8 chacha20 encryption packets are encrypted as one chacha20 encryption packet, that is, the AES encryption algorithm uses 128 bits as a group of encrypted data, and the chacha20 stream encryption uses 256 bits as a group of encrypted data; the encrypted data is encrypted, when the audio sampling frequency is 40Mhz, 10 groups of chacha20 stream encryption packets are used, and then one group of AES encryption packets is used for encryption. The flash storage space of the chip is used, 4 temporary storage areas are manually set, and default prime numbers and cyclic prime numbers, as well as communication initial keys and information interaction of both parties are stored.
[0076] During the data transmission process, after each sentence is sampled, the number of analog signals converted into digital signals is set according to the sampling frequency. Therefore, the digital signal data corresponding to each sentence is processed, and the digital signal is divided into AES encryption and stream encryption packets to propose an encryption model with a high security factor. The speed of the AES encryption algorithm is "compensated" by the fast speed of chacha20 stream encryption, and real-time voice encryption is realized on STM32F103. Compared with ordinary XOR encryption, the key seed of chacha20 is derived based on 20 rounds of mathematical operation cycles, which has high randomness and unpredictability. It uses a 256-bit key (32 bytes) and a 64-bit counter (8 bytes). The counter ensures that the key is updated in time and the key seed value will not be repeated. The key seed can be generated using the hardware random number generator. Figure 7 As shown, the present invention saves resources and uses software to generate a random number for the ChaCha20 key seed, ensuring that each key seed update does not cause data delay. Each key seed update is adjusted to be updated once every 10 ChaCha20 encrypted packets. Two buffer areas are established, one for updating the ChaCha20 key seed value and the other for recording the current ChaCha20 key seed value for encrypting data. During the process of sending 10 ChaCha20 data packets, the key seed value in the seed update buffer area is updated for subsequent updating of the actual key seed value. When the count value indicates that 10 ChaCha20 stream encrypted packets have been sent, the value in the updated seed buffer area overwrites the value in the current key seed buffer area.
[0077] like Figure 4 As shown in the figure, it is a single-layer encryption algorithm structure diagram. In the figure, p1 is used as one of the prime factors p for subsequent key generation. When the key is generated for the first time, the prime factors in the temporary storage area are used as p for key generation, reducing the consumption of time resources for generating large prime factors. q is detected and generated using the Miller-Rabin algorithm. Subsequently, the generated q is stored in a file and used as the prime factor p for the next time, maintaining the variability of the overall encryption key.
[0078] The timer is set to operate at 40 MHz, sending a data packet every 25 ms. The encrypted digital signal is then appended with corresponding header and footer markers. After verification, the packet is sent to the Bluetooth transmitter. Once established, the Bluetooth module transmits the data. In practice, the processor core can be an ARM Cortex-M3 or higher, or a processor with a frequency similar to the benchmark, such as the STM32F103C6T6 or higher. It must have a TIMER peripheral and, at the very least, must be able to implement A / D and D / A conversion. Currently, most chips have these features.
[0079] like Figure 5In the preferred embodiment, 100 people are randomly selected to conduct subjective MOS quality evaluation on the communication decryption voice quality.
[0080] The participants were divided into five groups, each with 20 people, who used the intercom communication tool in a relatively peaceful environment. After the cumulative use time reached 12 hours, their feelings about the intercom communication tool processed by this method were collected, and the evaluation scores were averaged. Figure 4 As shown by Figure 4 It can be seen that after using it for a period of time, the five groups of people were relatively satisfied with the use of the communication tools processed by this inventive method.
[0081] The foregoing description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be readily conceived by a person skilled in the art within the technical scope disclosed herein should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A lightweight voice encryption method for digital intercom, characterized in that: The following steps are involved: Acquire the voice data to be encrypted; the voice data to be encrypted is acquired by the microphone module and is obtained through digital-to-analog conversion and PCM format switching; The voice data to be encrypted is encrypted using the AES encryption algorithm and the Chacha20 stream encryption algorithm based on the lightweight hybrid encryption module, and the AES encryption key is encrypted using the double-layer RSAq encryption algorithm based on the lightweight hybrid encryption module; the lightweight hybrid encryption module includes two layers, the inner layer adopts a combination of block encryption and byte order encryption, that is, the voice data to be encrypted is encrypted using the AES encryption algorithm and the Chacha20 stream encryption algorithm, and the outer layer uses the double-layer RSAq encryption algorithm to encrypt the inner layer key; the inner layer of the lightweight hybrid encryption module is used to achieve the purpose of data screening, and a built-in counter is built in. When 10 packets are transmitted using Chacha20 stream encryption, AES encrypted packets are transmitted, and one round of Chahca20 stream encryption and AES encryption is used as an overall inner layer encryption; the obtained ciphertext formula is as follows: , ;in: is the ciphertext, It is a group of plaintext, which refers to the voice data to be encrypted. is the chacha20 stream key seed, It is an AES encryption function; the chacha20 key seed is generated based on a random number, and each key seed update is adjusted to 10 chacha20 encryption packets per update. Two buffers are set up, one for updating the chacha20 key seed value and the other for recording the current chacha20 key seed value to encrypt data; in the process of sending 10 chacha20 data packets, the key seed value in the seed buffer is updated to update the actual key seed value later; when the count value indicates that 10 chacha20 stream encryption packets have been sent, the value in the seed buffer is updated to cover the current key seed value The value of the key seed buffer; before the double-layer RSAq encryption algorithm encrypts the AES encryption algorithm key, it first uses the default permutation number of both parties to truncate the key; when the key is first generated, the prime factor p is built in, and the large prime factor q is generated using the Miller-Rabin primality test algorithm. The generated large prime factor q is subsequently saved in a file and used as the prime factor p for the next time; on this basis, it is named the RSAq encryption algorithm and placed in the inner layer, combining the structural idea of the symmetric encryption algorithm in the middle to hide the public key and modulus length; the outer layer is protected by another layer of optimized RSAq; the modulus length n calculation and encryption formula are as follows: Where: n is the modulus length, p is the built-in prime factor, q is the large prime factor generated by the Miller-Rabin primality test algorithm, is the ciphertext, m is the plaintext, e is the public key, , and e and Coprime, when i is 1, all symbols represent the characteristic numbers of the inner encryption algorithm, when i is 2, all symbols represent the characteristic numbers of the outer encryption algorithm, That is, it serves as the ciphertext obtained by the inner layer encryption and also as the plaintext encrypted by the outer layer. The key is that the outer layer RSAq encryption algorithm selects the first 250 bits of the ciphertext obtained by the inner layer RSAq encryption algorithm as the plaintext to be encrypted. In subsequent use, the outer plaintext of different lengths can be selected to increase randomness. In this article, the examples all use the outer layer plaintext with a length of 250 bits. Represents the modulo operation; The encrypted data and key are used to trigger the lightweight hybrid decryption module for decryption and voice playback through the power amplifier module.
2. A lightweight voice encryption device for a digital intercom, used to implement the lightweight voice encryption method for a digital intercom according to claim 1, characterized in that: It includes microphone module, A / D analog-to-digital conversion module, PCM codec module I, lightweight hybrid encryption module, Bluetooth module, PCM codec module II, D / A digital-to-analog conversion module, lightweight hybrid decryption module and power amplifier module; The microphone module is used to obtain the voice information sent by the user, the A / D analog-to-digital conversion module is used to convert the digital signal into an analog signal, the PCM codec module I is used to switch the analog signal into PCM format, and the lightweight hybrid encryption module is used to encrypt the voice data to be encrypted; The lightweight hybrid encryption module is connected to the PCM codec module II via the Bluetooth module. The PCM codec module II is used to switch PCM format data into analog signals. The D / A digital-to-analog conversion module is used to convert analog signals into digital signals. The lightweight hybrid decryption module is used to decrypt the encrypted voice data. The power amplifier module is used to play the decrypted voice.
3. A lightweight voice encryption device for a digital intercom according to claim 2, characterized in that: A preprocessing module is also provided before the lightweight hybrid encryption module. The preprocessing module sets the high threshold to 4000 and the low threshold to 100 according to the range of sampling accuracy and the digital sampling value of the entire speaker to form a voice data group to be encrypted.
Citation Information
Patent Citations
Realizing method of voice communication identity authentication based on smart phone
CN106060808A
End-to-end encrypted voice communication Bluetooth earphone and voice encryption method thereof
CN115426648A