A method for audio encryption and decryption
By dividing the audio data into vocal and background sound parts, encrypting them in features and generating keys, the problem of low audio encryption in the existing technology is solved, and higher audio data security and privacy protection are achieved.
Patent Information
- Application Number
- CN202411022625.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-07-29
AI Technical Summary
In the prior art, the audio encryption method has low encryption level, cannot effectively protect user privacy and security, and is easily cracked.
By dividing the audio data into a vocal part and a background part, each part is characterized by encrypting the keys M1, M2 and M3, and restore the audio data according to the processing parameters during the decryption process to synthesize the complete audio data.
Improve the security and confidentiality of audio data, so that malicious thieves cannot restore the correct audio status even if they crack the file password, effectively protecting user privacy.
Smart Images

Figure CN118555143B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio technology, and in particular to an audio encryption and decryption method. Background Art
[0002] In the information age, the application scenarios of voice communication are becoming more and more extensive, which brings with it the issue of user privacy and security. During the transmission of voice information, once the information is leaked, the user's voice content will be maliciously stolen or tampered with, and personal privacy will not be effectively protected. What's worse, the user's audio biometric characteristics will be used to commit illegal and criminal acts, and the consequences will be unimaginable.
[0003] The traditional mobile phone audio encryption method is to compress and package the audio files, and then encrypt the compressed package. The audio files are still intact in the compressed package, and the degree of encryption is low. Illegal users can easily crack the compression key of the compressed package. Once the audio compressed package is cracked and decompressed, the complete audio data will be leaked, and the security and confidentiality are insufficient.
[0004] Therefore, there is a need for an audio encryption method with a higher degree of encryption and which can more effectively protect user privacy and security. Summary of the invention
[0005] To solve the above problems, the present invention provides an audio encryption and decryption method, which increases the difficulty of decryption by disassembling the audio data and encrypting it using the characteristics of different parts of the audio data. The audio data cannot be correctly decrypted without the complete key, and the audio data is effectively encrypted, which solves the problem that the existing technology has a low encryption level and cannot effectively protect user privacy and security.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] An audio encryption and decryption method comprises the following steps:
[0008] S1. Obtain audio data and divide the audio data into a vocal part and a background sound part;
[0009] S2. Process the vocal part, encrypt the processing parameters, and obtain the key M1; encrypt the vocal part, and generate the key M2 according to the audio properties of the vocal part; encrypt the background sound, and generate the key M3 according to the audio properties of the background sound;
[0010] S3. Decrypt the processing parameters, the vocal part and the background sound according to the key, restore the processing of the vocal part according to the processing parameters, synthesize the restored vocal part with the background sound, and obtain complete audio data.
[0011] Furthermore, in step S2, the vocal part is processed and the processing parameters are encrypted, and its specific implementation method includes: extracting the number of timbre of the vocal part, marking the position of each timbre, obtaining timbre distribution data, converting all timbre into the same timbre, recording the processing of each timbre as timbre processing parameters, encrypting the timbre distribution data and timbre processing parameters, and obtaining the key M1.
[0012] Furthermore, in step S2, the vocal part is encrypted and a key M2 is generated according to the audio attributes of the vocal part. The specific implementation method includes: encrypting the vocal part according to the frequency, number of sampling channels, sampling accuracy and duration of the vocal part, and generating the corresponding key M2.
[0013] Further, in step S2, the background sound is encrypted and a key M3 is generated according to the audio attribute of the background sound. The specific implementation method includes: dividing the background sound into n audio parts to obtain background sound segments. ,…… , number each background sound segment, the numbering formula is:
[0014]
[0015] Among them, f1 represents the maximum frequency in the audio segment, f0 represents the minimum frequency in the audio segment, B represents the signal-to-noise ratio, e represents the exponent, and y represents the audio delay number. Indicates the nth background sound segment;
[0016] Combine the background sound segments with their corresponding numbers, randomly shuffle all the numbered background sound segments, combine all the numbers, and encrypt the background sound segments according to the number combination to generate the key M3.
[0017] Furthermore, in step S1, after the audio data is obtained, the method further includes: performing noise reduction processing on the audio data, and the portion of the audio data removed after the noise reduction processing is noise data.
[0018] Furthermore, in step S2, the process further includes: dividing the noise data into n audio segments to obtain noise segments. ,…… , number each noise segment, and the numbering formula is:
[0019]
[0020] Among them, f1 represents the maximum frequency in the noise segment, f0 represents the minimum frequency in the noise segment, B represents the signal-to-noise ratio, e represents the exponent, and y represents the audio delay number. Indicates the nth noise segment;
[0021] Combine the noise segments with their corresponding numbers, randomly rearrange the order of all the noise segments with numbers, combine all the numbers, and generate the key M4 according to the number combination.
[0022] Furthermore, it also includes decrypting the background sound and noise according to the key. The specific implementation method includes: decrypting the order of each audio segment according to the keys M3 and M4, restoring the order of the audio segments of the background sound and noise according to the segment order to obtain the correct background sound and noise, and aligning and superimposing the background sound and noise in the time domain to obtain the complete background audio.
[0023] Further, in step S3, the processing of the vocal part is restored according to the processing parameters, and its specific implementation method includes: decrypting according to the key M1 to obtain the timbre distribution data and the timbre processing parameters, and restoring the audio timbre of the corresponding position to the original timbre according to the timbre distribution data and the timbre processing parameters to obtain the correct vocal part.
[0024] Furthermore, in step S3, the restored vocal part is synthesized with the background sound to obtain complete audio data, and its specific implementation method includes: aligning and superimposing the background audio and the vocal part in the time domain to obtain complete audio data.
[0025] Furthermore, in step S2, it also includes: in response to the user's input, setting the key M5, and combining the keys M1, M2, M3, M4, and M5 into a key combination M.
[0026] Through the above technical scheme, the present invention has the following beneficial effects: audio data is separated, and the separated audio data is processed and reorganized, encrypted according to the data characteristics of each component after separation, and some processed parameters are added to the key, so that even if a malicious audio data thief cracks the file password by brute force, the file cannot be restored to the correct state, thereby improving the security and confidentiality of the audio data and ensuring the privacy of the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 The figure is a schematic diagram of the overall flow of an audio encryption and decryption method of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] Example 1
[0031] See also Figure 1 , an audio encryption and decryption method, comprising:
[0032] S1. Obtain audio data and divide the audio data into a vocal part and a background sound part;
[0033] S2. Process the vocal part, encrypt the processing parameters, and obtain the key M1; encrypt the vocal part, and generate the key M2 according to the audio properties of the vocal part; encrypt the background sound, and generate the key M3 according to the audio properties of the background sound;
[0034] S3. Decrypt the processing parameters, the vocal part and the background sound according to the key, restore the processing of the vocal part according to the processing parameters, synthesize the restored vocal part with the background sound, and obtain complete audio data.
[0035] In an optional embodiment, in step S2, the vocal part is processed and the processing parameters are encrypted, and its specific implementation method includes: extracting the number of timbre of the vocal part, marking the position of each timbre, obtaining timbre distribution data, converting all timbre into the same timbre, recording the processing of each timbre as timbre processing parameters, encrypting the timbre distribution data and timbre processing parameters, and obtaining the key M1.
[0036] When replacing the timbre of human voice in audio, first extract the number of timbre types in the encrypted audio, one timbre for each human voice, mark and encode different human voice timbres, and store the data. Finally, replace the human voice in the audio with one timbre. If the decryption is not performed correctly, it will be impossible to distinguish the conversation between the human voices, so as to increase privacy.
[0037] The specific processing of the timbre includes: extracting the audio waveform corresponding to the timbre, and compressing and transforming the audio waveform to change the timbre of the speaker.
[0038] In an optional embodiment, after the timbre of the human voice audio is replaced, the speaking speed of the human voice in the audio is adjusted, and the speed adjustment information is compressed, packaged, stored and encrypted together with the timbre distribution data.
[0039] In an optional embodiment, in step S2, the vocal part is encrypted and a key M2 is generated according to the audio attributes of the vocal part. The specific implementation method includes: encrypting the vocal part according to the frequency, number of sampling channels, sampling accuracy and duration of the vocal part, and generating the corresponding key M2.
[0040] The key code is generated through the characteristic data of the audio data, the complexity of the key is enhanced, and the difficulty of cracking the encrypted data is increased.
[0041] In an optional embodiment, in step S2, the background sound is encrypted and a key M3 is generated according to the audio attribute of the background sound. The specific implementation method includes: dividing the background sound into n audio parts to obtain background sound segments. ,…… , number each background sound segment, the numbering formula is:
[0042]
[0043] Among them, f1 represents the maximum frequency in the audio segment, f0 represents the minimum frequency in the audio segment, B represents the signal-to-noise ratio, e represents the exponent, and y represents the audio delay number. Indicates the nth background sound segment;
[0044] Combine the background sound segments with their corresponding numbers, randomly shuffle all the numbered background sound segments, combine all the numbers, and encrypt the background sound segments according to the number combination to generate the key M3.
[0045] Through the above technical means, the audio is segmented. In actual application, it is generally divided into 10 or 15 segments. The more segments there are, the better the confidentiality, and the calculation complexity will also increase accordingly. Optionally, the number of equal divisions can also be greater than this number, and there is no limit to this.
[0046] When generating the key, the frequency and signal-to-noise ratio of each audio segment are used to generate it. When decrypting, the key is used to reversely calculate the segment number of each audio segment according to the formula to restore the audio based on the segment number.
[0047] In an optional embodiment, in step S1, after the audio data is obtained, the method further includes: performing noise reduction processing on the audio data, and the portion of the audio data removed after the noise reduction processing is noise data.
[0048] By noise reduction, the noise data can be separated and the audio data can be divided into more components to better protect the user's privacy.
[0049] In an optional embodiment, in step S2, the step further includes: dividing the noise data into n audio segments to obtain noise segments. ,…… , number each noise segment, and the numbering formula is:
[0050]
[0051] Among them, f1 represents the maximum frequency in the noise segment, f0 represents the minimum frequency in the noise segment, B represents the signal-to-noise ratio, e represents the exponent, and y represents the audio delay number. Indicates the nth noise segment;
[0052] Combine the noise segments with their corresponding numbers, randomly rearrange the order of all the noise segments with numbers, combine all the numbers, and generate the key M4 according to the number combination.
[0053] Similar to key M3, the noise audio is divided into multiple segments. Optionally, the number of equal segments can be 10, 15 or more, which is not specifically limited here.
[0054] In an optional embodiment, the background sound and noise are also decrypted according to the key. The specific implementation method includes: decrypting the order of each audio segment according to the keys M3 and M4, restoring the order of the audio segments of the background sound and noise according to the segment order to obtain the correct background sound and noise, and aligning and superimposing the background sound and noise in the time domain to obtain the complete background audio.
[0055] In an optional embodiment, in step S3, the processing of the vocal part is restored according to the processing parameters, and its specific implementation method includes: decrypting according to the key M1 to obtain the timbre distribution data and the timbre processing parameters, and restoring the audio timbre of the corresponding position to the original timbre according to the timbre distribution data and the timbre processing parameters to obtain the correct vocal part.
[0056] Specifically, during the decryption process, the stored timbre data is matched one by one with the original sound according to the mapping relationship between the timbre tag code and the order of appearance of the timbre in the original audio, and the unified timbre data is replaced. Finally, the speech speed data is restored according to the speed adjustment multiple.
[0057] In an optional embodiment, in step S3, the restored vocal part is synthesized with the background sound to obtain complete audio data, and its specific implementation method includes: aligning and superimposing the background audio and the vocal part in the time domain to obtain complete audio data.
[0058] In an optional embodiment, in step S2, it also includes: in response to the user's input, setting the key M5, and combining the keys M1, M2, M3, M4, and M5 into a key combination M.
[0059] Key M5 is the password set by the user, so that the user can set the password for the entire encrypted file based on the audio encryption process, providing further privacy protection for the user. If the password set by the user is not entered correctly, the complete key content cannot be obtained, and the file cannot be decrypted.
[0060] The embodiment disclosed in this specification is only an example of a unilateral feature of the present invention, and the protection scope of the present invention is not limited to this embodiment, and any other functionally equivalent embodiments fall within the protection scope of the present invention. For those skilled in the art, various other corresponding changes and deformations can be made according to the technical solutions and concepts described above, and all of these changes and deformations should fall within the protection scope of the claims of the present invention.
Claims
1. An audio encryption and decryption method, characterized in that: The following steps are involved: S1. Acquire audio data, perform noise reduction on the audio data, remove the noise data from the audio data after noise reduction, and divide the audio data after noise reduction into the human voice part and the background sound part; S2. Process the vocal part, encrypt the processing parameters, extract the number of timbres of the vocal part, mark the position of each timbre, obtain timbre distribution data, convert all timbre to the same timbre, record the processing of each timbre as a timbre processing parameter, encrypt the timbre distribution data and the timbre processing parameter, and obtain the key M1; encrypt the vocal part according to the frequency of the vocal part, the number of sampling channels, the sampling accuracy and the duration of the vocal part, and generate the corresponding key M2; The background sound is encrypted and a key M3 is generated according to the audio properties of the background sound. The specific implementation method includes: dividing the background sound into n audio parts to obtain background sound segments. ,…… , number each background sound segment, the numbering formula of the background sound segment is for: Where i∈{1, 2, ..., n}, f1 represents the maximum frequency in the audio segment, f0 represents the minimum frequency in the audio segment, B represents the signal-to-noise ratio, e represents the exponent, and y represents the audio delay number. represents the i-th background sound segment; Combine the background sound segments with their corresponding numbers, randomly sort all the background sound segments with numbers, combine all the numbers, and encrypt the background sound segments according to the number combinations to generate a key M3; Divide the noise data into n audio parts to get the noise fragments ,…… , number each noise segment, the numbering formula of the noise segment is for: Where k∈{1, 2, ..., n}, f1 represents the maximum frequency in the noise segment, f0 represents the minimum frequency in the noise segment, B represents the signal-to-noise ratio, e represents the exponent, and y represents the audio delay number. represents the kth noise segment; Combine the noise segments with their corresponding numbers, randomly rearrange the order of all the noise segments with numbers, combine all the numbers, and generate the key M4 according to the number combination; S3. Decrypt according to the key M1 to obtain the timbre distribution data and timbre processing parameters, restore the audio timbre of the corresponding position to the original timbre according to the timbre distribution data and the timbre processing parameters to obtain the correct vocal part, decrypt the fragment order of each audio fragment according to the keys M3 and M4, restore the order of the audio fragments of the background sound and noise according to the fragment order to obtain the correct background sound and noise, align and superimpose the background sound and noise in the time domain to obtain the complete background audio, align and superimpose the background audio with the vocal part in the time domain to obtain complete audio data.
2. The audio encryption and decryption method according to claim 1, characterized in that: In step S2, it also includes: in response to the user's input, setting the key M5, and combining the keys M1, M2, M3, M4, and M5 into a key combination M.
Citation Information
Patent Citations
A low code rate coding and decoding scheme for multi-language circle stereo
CN101166377A
Audio fingerprint generation method and device, electronic equipment and readable storage medium
CN116506681A