[go: up one dir, main page]

CN114282246A - Audio file encryption processing method, device, storage medium and device - Google Patents

Audio file encryption processing method, device, storage medium and device Download PDF

Info

Publication number
CN114282246A
CN114282246A CN202111621065.4A CN202111621065A CN114282246A CN 114282246 A CN114282246 A CN 114282246A CN 202111621065 A CN202111621065 A CN 202111621065A CN 114282246 A CN114282246 A CN 114282246A
Authority
CN
China
Prior art keywords
encrypted
audio file
data
packet data
mentioned
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111621065.4A
Other languages
Chinese (zh)
Other versions
CN114282246B (en
Inventor
刘庆祥
董伯平
赵庆明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202111621065.4A priority Critical patent/CN114282246B/en
Publication of CN114282246A publication Critical patent/CN114282246A/en
Application granted granted Critical
Publication of CN114282246B publication Critical patent/CN114282246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种音频文件的加密处理方法、装置、存储介质及设备。其中,该方法包括:获取原始音频文件中的多个加密数据块;将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。本发明解决了现有技术中的加密算法存在算法过于单一或运算复杂度较高的技术问题。

Figure 202111621065

The invention discloses an encryption processing method, device, storage medium and equipment for audio files. Wherein, the method includes: acquiring a plurality of encrypted data blocks in the original audio file; dividing each of the above encrypted data blocks into a plurality of encrypted packet data, wherein each of the above encrypted packet data includes: a plurality of sample values; After performing position swapping processing on a plurality of the sampled values in each of the above encrypted data blocks, performing position swapping processing on a plurality of the above encrypted packet data in each of the above encrypted data blocks to obtain an encrypted audio file. The invention solves the technical problems that the encryption algorithm in the prior art has too single algorithm or high computational complexity.

Figure 202111621065

Description

音频文件的加密处理方法、装置、存储介质及设备Audio file encryption processing method, device, storage medium and device

技术领域technical field

本发明涉及媒体文件加密、解密技术领域,具体而言,涉及一种音频文件的加密处理方法、装置、存储介质及设备。The present invention relates to the technical field of media file encryption and decryption, and in particular, to a method, device, storage medium and device for encryption processing of audio files.

背景技术Background technique

在通讯技术领域,发送方和接收方在的通话过程中通过网络进行传输、记录、存储等操作;在传输、记录、存储音频文件时,为了保护音频内容不被窃取,通常需要对发送的音频文件进行加密,接收方用户在接收到发送方用户传输的音频文件后,先进行解密再进行播放。In the field of communication technology, the sender and the receiver perform operations such as transmission, recording, and storage through the network during the call; when transmitting, recording, and storing audio files, in order to protect the audio content from being stolen, it is usually necessary to send audio files. The file is encrypted. After receiving the audio file transmitted by the sender user, the receiver user decrypts it first and then plays it.

但是,现有技术中,对音频文件加密方式包括:密钥和算法过于单一的流式加密算法、运算复杂度高的完全加密算法以及分层加密算法;流式加密算法过于简单安全性较低,完全加密算法和分层加密算法计算过程较为复杂,给用户带来不便。However, in the prior art, the methods for encrypting audio files include: stream encryption algorithms whose keys and algorithms are too single, full encryption algorithms with high computational complexity, and layered encryption algorithms; stream encryption algorithms are too simple and have low security. , the calculation process of the complete encryption algorithm and the layered encryption algorithm is more complicated, which brings inconvenience to the user.

针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供了一种音频文件的加密处理方法、装置、存储介质及设备,以至少解决现有技术中的加密算法存在算法过于单一或运算复杂度较高的技术问题。Embodiments of the present invention provide an encryption processing method, device, storage medium and device for audio files, so as to at least solve the technical problems of too single algorithm or high computational complexity in the encryption algorithm in the prior art.

根据本发明实施例的一个方面,提供了一种音频文件的加密处理方法,包括:获取原始音频文件中的多个加密数据块;将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。According to an aspect of the embodiments of the present invention, an encryption processing method for an audio file is provided, including: acquiring multiple encrypted data blocks in an original audio file; dividing each of the foregoing encrypted data blocks into multiple encrypted packet data, wherein , each of the above-mentioned encrypted packet data includes: a plurality of sample values; after performing position swapping processing on the plurality of above-mentioned sample values in each of the above-mentioned encrypted data blocks, a plurality of above-mentioned encrypted packets in each of the above-mentioned encrypted data blocks are processed. The data is subjected to position swap processing to obtain an encrypted audio file.

可选的,上述获取原始音频文件中的多个加密数据块,包括:获取上述原始音频文件的采样率;根据上述采样率,将上述原始音频文件中的连续N个采样点设为上述加密数据块,其中,每个上述加密数据块划分为M个上述加密分组数据,每个上述加密分组数据拥有的采样点K=N/M。Optionally, the above-mentioned obtaining of multiple encrypted data blocks in the original audio file includes: obtaining the sampling rate of the above-mentioned original audio file; according to the above-mentioned sampling rate, setting consecutive N sampling points in the above-mentioned original audio file as the above-mentioned encrypted data Each of the above encrypted data blocks is divided into M pieces of the above encrypted packet data, and each of the above encrypted packet data has a sampling point K=N/M.

可选的,上述方法通过如下方式对每个上述加密分组数据中的多个采样值进行位置对换处理:对每个上述加密分组数据中的第一个采样值和第K个采样值进行位置对换,以及对每个上述加密分组数据中的第J个采样值和第K-J+1个采样值进行位置对换。Optionally, the above method performs position swap processing on the plurality of sample values in each of the above-mentioned encrypted packet data in the following manner: the position is performed on the first sample value and the Kth sample value in each of the above-mentioned encrypted packet data. Swapping, and performing position swapping on the J th sample value and the K-J+1 th sample value in each of the above encrypted packet data.

可选的,上述对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到上述加密后音频文件,包括:对上述加密数据块中的第一个分组数据和第W个分组数据进行位置对换,以及对上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,以完成W个分组数据的位置对换处理,得到上述加密后音频文件。Optionally, the above-mentioned position swap processing is performed on a plurality of the above-mentioned encrypted grouped data in each of the above-mentioned encrypted data blocks to obtain the above-mentioned encrypted audio file, including: the first grouped data in the above-mentioned encrypted data block and the Wth The packet data is swapped in position, and the L th packet data and the W-L+1 th packet data in the above-mentioned encrypted data block are swapped in position, so as to complete the position swap processing of the W packet data, and the above encryption is obtained. post audio file.

根据本发明实施例的另一方面,还提供了一种音频文件的加密处理装置,包括:获取模块,用于获取原始音频文件中的多个加密数据块;划分模块,用于将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;处理模块,用于在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。According to another aspect of the embodiments of the present invention, there is also provided an encryption processing device for an audio file, including: an acquisition module for acquiring a plurality of encrypted data blocks in the original audio file; a division module for each of the above The encrypted data block is divided into a plurality of encrypted packet data, wherein each of the above encrypted packet data includes: a plurality of sample values; a processing module configured to perform position matching on the plurality of sample values in each of the above encrypted packet data After the swapping process, a position swapping process is performed on a plurality of the above-mentioned encrypted packet data in each of the above-mentioned encrypted data blocks, so as to obtain an encrypted audio file.

可选的,上述获取模块,包括:获取单元,用于获取上述原始音频文件的采样率;处理单元,用于根据上述采样率,将上述原始音频文件中的连续N个采样点设为上述加密数据块,其中,每个上述加密数据块划分为M个上述加密分组数据,每个上述加密分组数据拥有的采样点K=N/M。Optionally, the above-mentioned acquisition module includes: an acquisition unit for acquiring the sampling rate of the above-mentioned original audio file; and a processing unit for setting consecutive N sampling points in the above-mentioned original audio file as the above-mentioned encryption according to the above-mentioned sampling rate A data block, wherein each encrypted data block is divided into M pieces of the encrypted packet data, and each of the encrypted packet data has a sampling point K=N/M.

可选的,上述装置通过如下方式对每个上述加密分组数据中的多个采样值进行位置对换处理:对每个上述加密分组数据中的第一个采样值和第K个采样值进行位置对换,以及对每个上述加密分组数据中的第J个采样值和第K-J+1个采样值进行位置对换。Optionally, the above-mentioned apparatus performs position swap processing on the plurality of sample values in each of the above-mentioned encrypted packet data in the following manner: the position of the first sample value and the Kth sample value in each of the above-mentioned encrypted packet data is performed. Swapping, and performing position swapping on the J th sample value and the K-J+1 th sample value in each of the above encrypted packet data.

可选的,上述处理模块还用于:对上述加密数据块中的第一个分组数据和第W个分组数据进行位置对换,以及对上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,以完成W个分组数据的位置对换处理,得到上述加密后音频文件。Optionally, the above-mentioned processing module is also used for: the first grouping data and the Wth grouping data in the above-mentioned encrypted data block are exchanged for position, and the Lth grouping data and the Wth grouping data in the above-mentioned encrypted data block are exchanged. -L+1 pieces of packet data are exchanged in position to complete the position exchange process of W pieces of packet data, and the above encrypted audio file is obtained.

根据本发明实施例的另一方面,还提供了一种计算机可读存储介质,上述计算机可读存储介质存储有多条指令,上述指令适于由处理器加载并执行任意一项上述的音频文件的加密处理方法。According to another aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, where the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor of any one of the audio files described above. encryption processing method.

根据本发明实施例的另一方面,还提供了一种电子设备,包括存储器和处理器,上述存储器中存储有计算机程序,上述处理器被设置为运行上述计算机程序以执行任意一项上述的音频文件的加密处理方法。According to another aspect of the embodiments of the present invention, an electronic device is also provided, including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the audio File encryption processing method.

在本发明实施例中,通过获取原始音频文件中的多个加密数据块;将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件,达到了通过位置对换进行文件加密的目的,从而实现了在较少计算量的情况下完成双重加密的技术效果,进而解决了现有技术中的加密算法存在算法过于单一或运算复杂度较高的技术问题。In the embodiment of the present invention, by acquiring multiple encrypted data blocks in the original audio file; each above-mentioned encrypted data block is divided into a plurality of encrypted group data, wherein each of the above-mentioned encrypted group data includes: a plurality of sample values After a plurality of above-mentioned sample values in each above-mentioned encrypted packet data are carried out position swap processing, a plurality of above-mentioned encrypted packet data in each above-mentioned encrypted data block are carried out position swap processing, obtain the audio file after encryption, reach The purpose of file encryption through position swapping is achieved, thereby realizing the technical effect of completing double encryption under the condition of less calculation amount, and solving the problem that the encryption algorithm in the prior art has too single algorithm or high computational complexity. technical problem.

附图说明Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached image:

图1是根据本发明实施例的音频文件的加密处理方法流程图;1 is a flowchart of an encryption processing method for an audio file according to an embodiment of the present invention;

图2是根据本发明实施例的一种可选的单摆往复运动模型示意图;2 is a schematic diagram of an optional single pendulum reciprocating motion model according to an embodiment of the present invention;

图3是根据本发明实施例的一种可选的原始音频文件的结构示意图;3 is a schematic structural diagram of an optional original audio file according to an embodiment of the present invention;

图4是根据本发明实施例的一种可选的加密后的音频文件的结构示意图;4 is a schematic structural diagram of an optional encrypted audio file according to an embodiment of the present invention;

图5是根据本发明实施例的一种可选的音频文件的加密流程示意图;5 is a schematic diagram of an optional encryption process flow of an audio file according to an embodiment of the present invention;

图6是根据本发明实施例的一种音频文件的加密处理装置的结构示意图。FIG. 6 is a schematic structural diagram of an apparatus for encrypting an audio file according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to make those skilled in the art better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Embodiments are part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

实施例1Example 1

根据本发明实施例,提供了一种音频文件的加密处理方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, an embodiment of an encryption processing method for an audio file is provided. It should be noted that the steps shown in the flowchart of the accompanying drawing can be executed in a computer system such as a set of computer-executable instructions, Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that herein.

图1是根据本发明实施例的音频文件的加密处理方法流程图,如图1所示,该方法包括如下步骤:FIG. 1 is a flowchart of an encryption processing method for an audio file according to an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:

步骤S102,获取原始音频文件中的多个加密数据块;Step S102, obtaining multiple encrypted data blocks in the original audio file;

步骤S104,将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;Step S104, dividing each of the above-mentioned encrypted data blocks into a plurality of encrypted packet data, wherein each of the above-mentioned encrypted packet data includes: a plurality of sample values;

步骤S106,在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。Step S106, after performing position swapping processing on a plurality of the above-mentioned sample values in each of the above-mentioned encrypted data blocks, performing positional swapping processing on a plurality of the above-mentioned encrypted packet data in each of the above-mentioned encrypted data blocks to obtain an encrypted audio file. .

在本发明实施例中,上述步骤S102至S106中提供的音频文件的加密处理方案的执行主体为服务器,采用上述服务器获取原始音频文件中的多个加密数据块;并将上述加密数据块进行分组处理,得到加密分组数据,每个上述加密分组数据中存在多个采样值;在加密过程中,首先对上述加密分组数据中的多个采样值进行位置对换处理,得到加密后的加密分组数据,再对加密后的上述加密分组数据进行位置对换处理,得到加密后上述加密数据块,经过上述两次不同层级的位置对换处理后,最终得到加密后音频文件。In the embodiment of the present invention, the executive body of the encryption processing scheme of the audio file provided in the above steps S102 to S106 is a server, and the above server is used to obtain a plurality of encrypted data blocks in the original audio file; and the above encrypted data blocks are grouped processing, to obtain encrypted packet data, each of the above-mentioned encrypted packet data has a plurality of sample values; in the encryption process, first perform position swap processing on the plurality of sample values in the above-mentioned encrypted packet data to obtain encrypted encrypted packet data , and then perform position swapping processing on the encrypted packet data after encryption to obtain the encrypted data block after encryption. After the above-mentioned two position swapping processing at different levels, the encrypted audio file is finally obtained.

需要说明的是,上述服务器可以内置于上述音频文件的发送端,服务器从上述发送端获取到音频文件后采用上述步骤实现数据加密;在上述加密的过程中需要设置一定的缓冲区,上述缓冲区的大小可以根据实际情况进行设定,但最小不得小于一个加密数据块的大小。It should be noted that the above-mentioned server can be built in the transmitting end of the above-mentioned audio file, and the server adopts the above-mentioned steps to realize data encryption after obtaining the audio file from the above-mentioned transmitting end; The size can be set according to the actual situation, but the minimum size should not be less than the size of an encrypted data block.

还需要说明的是,上述音频文件的加密处理方法根据重力单摆的运动规律进行设计,如图2上述的单摆往复运动模型示意图,单摆运动是能够产生往复摆动的一种运动,单摆是一种理想的物理模型,它由理想化的摆球和摆线组成.摆线由质量不计、不可伸缩的细线提供;摆球密度较大,而且球的半径远小于摆线的长度,因此,可以将摆球看作质点,由摆线和摆球构成单摆。It should also be noted that the encryption processing method of the above-mentioned audio file is designed according to the motion law of the gravitational pendulum. It is an ideal physical model, which consists of an idealized pendulum ball and a cycloid. The cycloid is provided by a thin wire with no mass and cannot be stretched; the density of the pendulum ball is relatively large, and the radius of the ball is much smaller than the length of the cycloid, Therefore, the pendulum ball can be regarded as a mass point, and the pendulum is composed of the cycloid and the pendulum ball.

作为一种可选的实施例,仍如图2所示,A、B、C三点是单摆的质点经过的三个点,在本发明实施例中,不考虑单摆的摆长和重力大小,且A、B、C三点是以B点到摆线另一端的原点的直线为对称的点,A点和C点两者的位置是一样,存在对称关系;因而在加密时,若取出的加密分组数据仅仅包含了A、B、C三个采样点,则将A点和C点的采样值进行位置对换,B点采样值不变;若取出的加密分组数据中的采样点为偶数个采样点,例如A、B、C、D四个采样点,这样将A、D位置对换,B、C位置对换,从而完成加密分组数据内的数据位置对换;上述在加密分组数据内的数据位置对换可以称为一重单摆。As an optional embodiment, as shown in FIG. 2 , the three points A, B, and C are the three points that the mass point of the simple pendulum passes through. In this embodiment of the present invention, the pendulum length and gravity of the simple pendulum are not considered. size, and the three points A, B, and C are symmetrical points from point B to the origin of the other end of the cycloid. The positions of point A and point C are the same, and there is a symmetrical relationship; therefore, when encrypting, if The extracted encrypted packet data only contains three sampling points A, B, and C, then the positions of the sampling values of points A and C are exchanged, and the sampling value of point B remains unchanged; if the sampling points in the extracted encrypted packet data are It is an even number of sampling points, such as four sampling points A, B, C, and D. In this way, the positions of A and D are exchanged, and the positions of B and C are exchanged, so as to complete the data position exchange in the encrypted packet data; The data position swap within the packet data can be referred to as a single pendulum.

可选的,上述加密分组数据完成位置对换之后,继续采用上述原理,将加密分组数据进行数据位置对换,从而完成加密数据块内加密分组数据内的位置对换;上述在加密数据块内的加密分组数据位置对换可以称为双重单摆。Optionally, after the above-mentioned encrypted packet data completes the position swap, continue to use the above-mentioned principle to perform data position swap on the encrypted packet data, so as to complete the position swap in the encrypted packet data in the encrypted data block; the above is in the encrypted data block. The encrypted packet data position swap can be called a double pendulum.

作为一种可选的实施例,在解密过程中,上述音频信息的接收端需要掌握每个加密分组数据的大小和加密数据块的大小,根据上述每个加密分组数据的大小和加密数据块的大小可以轻易计算出音频文件中的每个加密分组数据的开始位置和结束位置,并且可以进一步计算出分组内的采样点的个数,按照加密的反过程,先对加密分组数据进行位置对换,然后对加密分组数据内的采样点进行数据位置对换,从而完成解密工作。As an optional embodiment, in the decryption process, the receiving end of the audio information needs to grasp the size of each encrypted packet data and the size of the encrypted data block, according to the size of each encrypted packet data and the encrypted data block. The size can easily calculate the start position and end position of each encrypted packet data in the audio file, and can further calculate the number of sampling points in the packet. According to the reverse process of encryption, the encrypted packet data is first swapped. , and then perform data position exchange on the sampling points in the encrypted packet data to complete the decryption work.

需要说明的是,上述方法可以但不限于应用于用户的实时通话中,在进行实时通话时,可以对通话音频数据进行实时加密,提高了用户通话的安全性。It should be noted that the above method can be applied to, but is not limited to, a user's real-time call. During a real-time call, the call audio data can be encrypted in real time, thereby improving the security of the user's call.

通过本发明实施例,仅仅通过数据位置对换来完成加密,算法计算简单,没有复杂的计算量;并且解密过程同样简单,上述加密算法采用了双密钥的双重保障,只有掌握双密钥(即上述每个加密分组数据的大小和加密数据块的大小)才能完成音频解密,从而保障了音频文件内容的加密安全性,达到了通过位置对换进行文件加密的目的,从而实现了在较少计算量的情况下完成双重加密的技术效果,进而解决了现有技术中的加密算法存在算法过于单一或运算复杂度较高的技术问题。Through the embodiment of the present invention, the encryption is only completed by the data position exchange, the algorithm calculation is simple, and there is no complicated calculation amount; and the decryption process is also simple, the above-mentioned encryption algorithm adopts the double security of the double key, and only masters the double key ( That is, the size of the above-mentioned encrypted packet data and the size of the encrypted data block) can complete the audio decryption, thus ensuring the encryption security of the audio file content, and achieving the purpose of file encryption through The technical effect of double encryption is completed under the condition of computational complexity, thereby solving the technical problems of the encryption algorithm in the prior art that the algorithm is too single or the computational complexity is high.

在一种可选的实施例中,上述获取原始音频文件中的多个加密数据块,包括:In an optional embodiment, the above-mentioned acquisition of multiple encrypted data blocks in the original audio file includes:

步骤S202,获取上述原始音频文件的采样率;Step S202, obtaining the sampling rate of the above-mentioned original audio file;

步骤S204,根据上述采样率,将上述原始音频文件中的连续N个采样点设为上述加密数据块,其中,每个上述加密数据块划分为M个上述加密分组数据,每个上述加密分组数据拥有的采样点K=N/M。Step S204, according to the above-mentioned sampling rate, set consecutive N sampling points in the above-mentioned original audio file as the above-mentioned encrypted data blocks, wherein each of the above-mentioned encrypted data blocks is divided into M pieces of the above-mentioned encrypted packet data, and each of the above-mentioned encrypted packet data Owned sampling points K=N/M.

在本发明实施例中,上述获取原始音频文件中的多个加密数据块并完成加密数据分组,得到加密分组数据后,获取上述原始音频文件的采样率;根据上述采样率,将上述原始音频文件中的连续N个采样点设为上述加密数据块。In the embodiment of the present invention, the above-mentioned obtaining a plurality of encrypted data blocks in the original audio file and completing the encrypted data grouping, after obtaining the encrypted grouping data, the sampling rate of the above-mentioned original audio file is obtained; according to the above-mentioned sampling rate, the above-mentioned original audio file The consecutive N sampling points in are set as the above encrypted data block.

作为一种可选的实施例,上述服务器根据原始音频的采样率,将原始音频文件每连续的N个采样点设为一个加密数据块,其中每个加密数据块中按照预设逻辑进行划分,最终可以分为M个加密数据分组,且每个加密数据分组拥有K=N/M个采样点。As an optional embodiment, according to the sampling rate of the original audio, the server sets each consecutive N sampling points of the original audio file as an encrypted data block, wherein each encrypted data block is divided according to a preset logic, Finally, it can be divided into M encrypted data packets, and each encrypted data packet has K=N/M sampling points.

需要说明的是,上述预设逻辑即预设的分组规则,用于将上述加密数据块划分为多个加密分组数据。It should be noted that the above-mentioned preset logic is a preset grouping rule, which is used to divide the above-mentioned encrypted data block into a plurality of encrypted grouped data.

在一种可选的实施例中,上述方法通过如下方式对每个上述加密分组数据中的多个采样值进行位置对换处理:In an optional embodiment, the above method performs position swapping processing on multiple sample values in each of the above encrypted packet data in the following manner:

步骤S302,对每个上述加密分组数据中的第一个采样值和第K个采样值进行位置对换,以及对每个上述加密分组数据中的第J个采样值和第K-J+1个采样值进行位置对换。Step S302, performing position exchange on the first sample value and the Kth sample value in each of the above-mentioned encrypted packet data, and on the Jth sample value and the K-J+1th sample value in each of the above-mentioned encrypted packet data. The positions of the sampled values are swapped.

在本发明实施例中,首先对每个上述加密分组数据中的多个采样值进行位置对换处理,通过对每个上述加密分组数据中的第一个采样值和第K个采样值进行位置对换,以及对每个上述加密分组数据中的第J个采样值和第K-J+1个采样值进行位置对换。In this embodiment of the present invention, firstly perform position swapping processing on a plurality of sample values in each of the above encrypted packet data, by performing position swapping on the first sample value and the K th sample value in each of the above encrypted packet data Swapping, and performing position swapping on the J th sample value and the K-J+1 th sample value in each of the above encrypted packet data.

作为一种可选的实施例,如图3所示的原始音频文件结构示意图,在每个加密分组数据中,将第一个采样点和第K个采样点进行位置对换,将第J个采样点和第K-J+1个采样点的位置进行对换,从而完成第一次加密,得到如图4所示的加密后的音频文件结构示意图。As an optional embodiment, as shown in the schematic diagram of the original audio file structure shown in FIG. 3 , in each encrypted packet data, the positions of the first sampling point and the Kth sampling point are exchanged, and the Jth sampling point is The positions of the sampling point and the K-J+1th sampling point are exchanged, so as to complete the first encryption, and obtain the schematic diagram of the structure of the encrypted audio file as shown in FIG. 4 .

需要说明的是,若上述音频文件大小为8bit的音频文件,即每个采样点的采样值为一个字节数值,可以将每个组里第1个字节的数据和第K-J+1个字节数据进行对换。若上述音频文件大小为16bit的音频文件,每次采样点为16bit,即双字节数值,则每次进行位置对换的大小为两个字节。It should be noted that, if the above audio file size is an audio file of 8 bits, that is, the sampling value of each sampling point is a byte value, the data of the first byte in each group and the K-J+1 Swap bytes of data. If the size of the above audio file is 16 bits, and each sampling point is 16 bits, that is, a double-byte value, the size of each position swap is two bytes.

在一种可选的实施例中,上述对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到上述加密后音频文件,包括:In an optional embodiment, the above-mentioned position swapping processing is performed on a plurality of the above-mentioned encrypted packet data in each of the above-mentioned encrypted data blocks to obtain the above-mentioned encrypted audio file, including:

步骤S402,对上述加密数据块中的第一个分组数据和第W个分组数据进行位置对换,以及对上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,以完成W个分组数据的位置对换处理,得到上述加密后音频文件。Step S402, the first grouping data and the Wth grouping data in the above-mentioned encrypted data block are exchanged in position, and the Lth grouping data and the W-L+1th grouping data in the above-mentioned encrypted data block are performed. Position swapping is performed to complete the position swapping process of the W pieces of packet data to obtain the above-mentioned encrypted audio file.

在本发明实施例中,与上述对每个上述加密分组数据中的多个采样值进行位置对换处理的流程相似,对上述加密数据块中的第一个分组数据和第W个分组数据进行位置对换,以及对上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,以完成W个分组数据的位置对换处理,得到上述加密后音频文件。In this embodiment of the present invention, similar to the above-mentioned process of performing position swapping on multiple sample values in each of the above-mentioned encrypted packet data, the first packet data and the W-th packet data in the above-mentioned encrypted data block are processed. Position swapping, and performing position swapping to the Lth packet data and the W-L+1 packet data in the above-mentioned encrypted data block, to complete the position swapping process of the W packet data, obtain the above-mentioned encrypted audio file .

作为一种可选的实施例,若每个加密数据块中有W个加密分组分组,同样按照单摆规则,将第一个分组数据和第W个加密分组数据进行位置对换,上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,从而完成第二次加密,通过上述两次加密步骤实现对上述音频文件的加密流程。As an optional embodiment, if there are W encrypted packets in each encrypted data block, also according to the pendulum rule, the positions of the first packet data and the Wth encrypted packet data are exchanged, and the above encrypted data The position of the L th packet data and the W-L+1 th packet data in the block is exchanged, thereby completing the second encryption, and implementing the encryption process of the above audio file through the above two encryption steps.

通过上述步骤,可以实现基于单摆运动更改音频采样点数据的加解密方法,如图5所示的音频文件的加密流程示意图,采用服务器接收音频文件,并获取加密数据库,对上述加密数据块进行分组,对每个分组里的采样值进行位置对换,完成采样值位置对换后,将加密分组数据同样进行位置对换处理,完成音频文件的加密,达到了通过位置对换进行文件加密的目的,从而实现了在较少计算量的情况下完成双重加密的技术效果,进而解决了现有技术中的加密算法存在算法过于单一或运算复杂度较高的技术问题。Through the above steps, an encryption and decryption method for changing audio sampling point data based on pendulum motion can be implemented. As shown in the schematic diagram of the encryption process of audio files as shown in FIG. Grouping, perform position swapping of the sampled values in each group, and after completing the position swapping of the sampled values, the encrypted packet data is also subjected to the position swapping processing, and the encryption of the audio file is completed. The purpose is to achieve the technical effect of completing double encryption under the condition of less calculation amount, thereby solving the technical problems of the encryption algorithm in the prior art that the algorithm is too single or the computational complexity is high.

实施例2Example 2

根据本发明实施例,还提供了一种用于实施上述音频文件的加密处理的装置实施例,图6是根据本发明实施例的一种音频文件的加密处理装置的结构示意图,如图6所示,上述装置包括:获取模块60、划分模块62和处理模块64,其中:According to an embodiment of the present invention, an embodiment of an apparatus for implementing the encryption processing of the audio file is also provided. FIG. 6 is a schematic structural diagram of an apparatus for encryption processing of an audio file according to an embodiment of the present invention, as shown in FIG. 6 . As shown, the above device includes: an acquisition module 60, a division module 62 and a processing module 64, wherein:

获取模块60,用于获取原始音频文件中的多个加密数据块;an acquisition module 60 for acquiring multiple encrypted data blocks in the original audio file;

划分模块62,用于将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;A dividing module 62, configured to divide each of the above-mentioned encrypted data blocks into a plurality of encrypted packet data, wherein each of the above-mentioned encrypted packet data includes: a plurality of sample values;

处理模块64,用于在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。The processing module 64 is configured to perform position swapping processing on a plurality of the above-mentioned encrypted packet data in each of the above-mentioned encrypted data blocks after performing position swapping processing on a plurality of the above-mentioned sample values in each of the above-mentioned encrypted data blocks, to obtain encrypted post audio file.

可选的,上述获取模块,包括:获取单元,用于获取上述原始音频文件的采样率;处理单元,用于根据上述采样率,将上述原始音频文件中的连续N个采样点设为上述加密数据块,其中,每个上述加密数据块划分为M个上述加密分组数据,每个上述加密分组数据拥有的采样点K=N/M。Optionally, the above-mentioned acquisition module includes: an acquisition unit for acquiring the sampling rate of the above-mentioned original audio file; and a processing unit for setting consecutive N sampling points in the above-mentioned original audio file as the above-mentioned encryption according to the above-mentioned sampling rate A data block, wherein each encrypted data block is divided into M pieces of the encrypted packet data, and each of the encrypted packet data has a sampling point K=N/M.

可选的,上述装置通过如下方式对每个上述加密分组数据中的多个采样值进行位置对换处理:对每个上述加密分组数据中的第一个采样值和第K个采样值进行位置对换,以及对每个上述加密分组数据中的第J个采样值和第K-J+1个采样值进行位置对换。Optionally, the above-mentioned apparatus performs position swap processing on the plurality of sample values in each of the above-mentioned encrypted packet data in the following manner: the position of the first sample value and the Kth sample value in each of the above-mentioned encrypted packet data is performed. Swapping, and performing position swapping on the J th sample value and the K-J+1 th sample value in each of the above encrypted packet data.

可选的,上述处理模块还用于:对上述加密数据块中的第一个分组数据和第W个分组数据进行位置对换,以及对上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,以完成W个分组数据的位置对换处理,得到上述加密后音频文件。Optionally, the above-mentioned processing module is also used for: the first grouping data and the Wth grouping data in the above-mentioned encrypted data block are exchanged for position, and the Lth grouping data and the Wth grouping data in the above-mentioned encrypted data block are exchanged. -L+1 pieces of packet data are exchanged in position to complete the position exchange process of W pieces of packet data, and the above encrypted audio file is obtained.

此处需要说明的是,上述获取模块60、划分模块62和处理模块64对应于实施例1中的步骤S102至步骤S106,三个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例1所公开的内容。It should be noted here that the above-mentioned acquisition module 60, division module 62 and processing module 64 correspond to steps S102 to S106 in Embodiment 1, and the three modules have the same examples and application scenarios as the corresponding steps. It is limited to the content disclosed in the above-mentioned Embodiment 1.

需要说明的是,本实施例的优选实施方式可以参见实施例1中的相关描述,此处不再赘述。It should be noted that, for the preferred implementation of this embodiment, reference may be made to the relevant description in Embodiment 1, and details are not repeated here.

根据本发明的实施例,还提供了一种计算机可读存储介质的实施例。可选的,在本实施例中,上述计算机可读存储介质可以用于保存上述实施例1所提供的音频文件的加密处理所执行的程序代码。According to an embodiment of the present invention, there is also provided an embodiment of a computer-readable storage medium. Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be used to store the program code executed by the encryption processing of the audio file provided in the above-mentioned Embodiment 1.

可选的,在本实施例中,上述计算机可读存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

可选的,在本实施例中,计算机可读存储介质被设置为存储用于执行以下步骤的程序代码:获取原始音频文件中的多个加密数据块;将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。Optionally, in this embodiment, a computer-readable storage medium is configured to store program codes for performing the following steps: acquiring multiple encrypted data blocks in the original audio file; dividing each encrypted data block into multiple encrypted data blocks; pieces of encrypted packet data, wherein each of the above encrypted packet data includes: a plurality of sample values; after performing position swapping processing on the plurality of sample values in each of the above encrypted data blocks A plurality of the above-mentioned encrypted packet data are subjected to position exchange processing to obtain an encrypted audio file.

可选的,上述计算机可读存储介质还可以执行如下步骤的程序代码:获取上述原始音频文件的采样率;根据上述采样率,将上述原始音频文件中的连续N个采样点设为上述加密数据块,其中,每个上述加密数据块划分为M个上述加密分组数据,每个上述加密分组数据拥有的采样点K=N/M。Optionally, the above-mentioned computer-readable storage medium can also execute the program code of the following steps: obtain the sampling rate of the above-mentioned original audio file; according to the above-mentioned sampling rate, set consecutive N sampling points in the above-mentioned original audio file as the above-mentioned encrypted data. Each of the above encrypted data blocks is divided into M pieces of the above encrypted packet data, and each of the above encrypted packet data has a sampling point K=N/M.

可选的,上述计算机可读存储介质还可以执行如下步骤的程序代码:对每个上述加密分组数据中的第一个采样值和第K个采样值进行位置对换,以及对每个上述加密分组数据中的第J个采样值和第K-J+1个采样值进行位置对换。Optionally, the above-mentioned computer-readable storage medium can also execute the program code of the following steps: performing position swapping on the first sampling value and the Kth sampling value in each of the above-mentioned encrypted packet data, and performing a position swap on each of the above-mentioned encrypted packet data. The positions of the J-th sampling value and the K-J+1-th sampling value in the packet data are swapped.

可选的,上述计算机可读存储介质还可以执行如下步骤的程序代码:对上述加密数据块中的第一个分组数据和第W个分组数据进行位置对换,以及对上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,以完成W个分组数据的位置对换处理,得到上述加密后音频文件。Optionally, the above-mentioned computer-readable storage medium can also execute the program code of the following steps: the first grouped data and the Wth grouped data in the above-mentioned encrypted data block are exchanged for position, and the above-mentioned encrypted data block is performed. The positions of the L th packet data and the W-L+1 th packet data are exchanged, so as to complete the position exchange processing of the W pieces of packet data, and obtain the above-mentioned encrypted audio file.

根据本发明的实施例,还提供了一种处理器的实施例。可选的,在本实施例中,上述计算机可读存储介质可以用于保存上述实施例1所提供的音频文件的加密处理所执行的程序代码。According to an embodiment of the present invention, an embodiment of a processor is also provided. Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be used to store the program code executed by the encryption processing of the audio file provided in the above-mentioned Embodiment 1.

本申请实施例提供了一种电子设备,设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,处理器执行程序时实现以下步骤:获取原始音频文件中的多个加密数据块;将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。An embodiment of the present application provides an electronic device, the device includes a processor, a memory, and a program stored in the memory and running on the processor. When the processor executes the program, the following steps are implemented: acquiring multiple encrypted data in an original audio file data block; dividing each of the above-mentioned encrypted data blocks into a plurality of encrypted packet data, wherein each of the above-mentioned encrypted packet data includes: a plurality of sample values; After the position swapping process, the position swapping process is performed on a plurality of the above-mentioned encrypted packet data in each of the above-mentioned encrypted data blocks, so as to obtain an encrypted audio file.

可选的,上述电子设备还可以执行如下步骤的程序代码:获取上述原始音频文件的采样率;根据上述采样率,将上述原始音频文件中的连续N个采样点设为上述加密数据块,其中,每个上述加密数据块划分为M个上述加密分组数据,每个上述加密分组数据拥有的采样点K=N/M。Optionally, the above-mentioned electronic device can also execute the program code of the following steps: obtain the sampling rate of the above-mentioned original audio file; according to the above-mentioned sampling rate, set consecutive N sampling points in the above-mentioned original audio file as the above-mentioned encrypted data block, wherein , each of the above-mentioned encrypted data blocks is divided into M pieces of the above-mentioned encrypted packet data, and each of the above-mentioned encrypted packet data has a sampling point K=N/M.

可选的,上述电子设备还可以执行如下步骤的程序代码:对每个上述加密分组数据中的第一个采样值和第K个采样值进行位置对换,以及对每个上述加密分组数据中的第J个采样值和第K-J+1个采样值进行位置对换。Optionally, the above-mentioned electronic equipment can also execute the program code of the following steps: perform position swapping on the first sampling value and the Kth sampling value in each of the above-mentioned encrypted packet data, and perform position swapping on the first sampling value in each of the above-mentioned encrypted packet data; The position of the J-th sampling value and the K-J+1-th sampling value is swapped.

可选的,上述电子设备还可以执行如下步骤的程序代码:对上述加密数据块中的第一个分组数据和第W个分组数据进行位置对换,以及对上述加密数据块中的第L个分组数据和第W-L+1个分组数据进行位置对换,以完成W个分组数据的位置对换处理,得到上述加密后音频文件。Optionally, the above-mentioned electronic equipment can also execute the program code of the following steps: the first grouped data in the above-mentioned encrypted data block and the Wth grouped data are exchanged for position, and the Lth in the above-mentioned encrypted data block is exchanged. The packet data and the W-L+1 th packet data are swapped in position, so as to complete the position swapping process of the W packet data, and the above-mentioned encrypted audio file is obtained.

本申请还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行初始化有如下方法步骤的程序:获取原始音频文件中的多个加密数据块;将每个上述加密数据块划分为多个加密分组数据,其中,每个上述加密分组数据中包括:多个采样值;在对每个上述加密分组数据中的多个上述采样值进行位置对换处理后,对每个上述加密数据块内多个上述加密分组数据进行位置对换处理,得到加密后音频文件。The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program initialized with the following method steps: obtaining a plurality of encrypted data blocks in an original audio file; is divided into a plurality of encrypted packet data, wherein each of the above encrypted packet data includes: a plurality of sample values; A plurality of the above-mentioned encrypted packet data in the encrypted data block are subjected to position swap processing to obtain an encrypted audio file.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.

在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are only illustrative, for example, the division of the units may be a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes .

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, several improvements and modifications can be made. It should be regarded as the protection scope of the present invention.

Claims (10)

1. An encryption processing method for an audio file, comprising:
acquiring a plurality of encrypted data blocks in an original audio file;
dividing each encrypted data block into a plurality of encrypted packet data, wherein each encrypted packet data comprises: a plurality of sampling values;
and after the position conversion processing is carried out on the plurality of sampling values in each encrypted packet data, the position conversion processing is carried out on the plurality of encrypted packet data in each encrypted data block to obtain an encrypted audio file.
2. The method of claim 1, wherein obtaining the plurality of encrypted data blocks in the original audio file comprises:
acquiring the sampling rate of the original audio file;
and setting continuous N sampling points in the original audio file as the encrypted data blocks according to the sampling rate, wherein each encrypted data block is divided into M encrypted packet data, and each encrypted packet data has a sampling point K which is N/M.
3. The method of claim 1, wherein the method performs a permutation of the location of the plurality of samples in each of the encrypted packets by:
and performing position swapping on the first sampling value and the Kth sampling value in each encrypted packet data, and performing position swapping on the J th sampling value and the K-J +1 th sampling value in each encrypted packet data.
4. The method according to claim 1, wherein said performing a location swapping process on a plurality of said encrypted packets in each said encrypted data block to obtain said encrypted audio file comprises:
and performing position swapping on the first grouped data and the W-th grouped data in the encrypted data block, and performing position swapping on the L-th grouped data and the W-L + 1-th grouped data in the encrypted data block to complete position swapping of the W grouped data and obtain the encrypted audio file.
5. An apparatus for encrypting an audio file, comprising:
the acquisition module is used for acquiring a plurality of encrypted data blocks in an original audio file;
a dividing module, configured to divide each encrypted data block into a plurality of encrypted packet data, where each encrypted packet data includes: a plurality of sampling values;
and the processing module is used for performing position conversion processing on the plurality of encrypted grouped data in each encrypted data block after performing position conversion processing on the plurality of sampling values in each encrypted grouped data block to obtain an encrypted audio file.
6. The apparatus of claim 5, wherein the obtaining module comprises:
the acquisition unit is used for acquiring the sampling rate of the original audio file;
and the processing unit is used for setting continuous N sampling points in the original audio file as the encrypted data blocks according to the sampling rate, wherein each encrypted data block is divided into M encrypted packet data, and each encrypted packet data has a sampling point K which is N/M.
7. The apparatus according to claim 5, wherein the apparatus performs the location swapping on the plurality of sample values in each of the encrypted packet data by:
and performing position swapping on the first sampling value and the Kth sampling value in each encrypted packet data, and performing position swapping on the J th sampling value and the K-J +1 th sampling value in each encrypted packet data.
8. The apparatus of claim 5, wherein the processing module is further configured to:
and performing position swapping on the first grouped data and the W-th grouped data in the encrypted data block, and performing position swapping on the L-th grouped data and the W-L + 1-th grouped data in the encrypted data block to complete position swapping of the W grouped data and obtain the encrypted audio file.
9. A computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to execute the method of cryptographic processing of an audio file of any one of claims 1 to 4.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the method of encrypting an audio file according to any one of claims 1 to 4.
CN202111621065.4A 2021-12-27 2021-12-27 Audio file encryption processing method, device, storage medium and equipment Active CN114282246B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111621065.4A CN114282246B (en) 2021-12-27 2021-12-27 Audio file encryption processing method, device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111621065.4A CN114282246B (en) 2021-12-27 2021-12-27 Audio file encryption processing method, device, storage medium and equipment

Publications (2)

Publication Number Publication Date
CN114282246A true CN114282246A (en) 2022-04-05
CN114282246B CN114282246B (en) 2025-01-03

Family

ID=80876798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111621065.4A Active CN114282246B (en) 2021-12-27 2021-12-27 Audio file encryption processing method, device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN114282246B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5974142A (en) * 1993-08-27 1999-10-26 Lucent Technologies, Inc. Secure telecommunications
US20200322243A1 (en) * 2017-12-28 2020-10-08 Huawei Technologies Co., Ltd. Network Quality Measurement Method and Apparatus
CN113411326A (en) * 2021-06-17 2021-09-17 上海明略人工智能(集团)有限公司 Method and device for audio encryption, electronic equipment, system and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5974142A (en) * 1993-08-27 1999-10-26 Lucent Technologies, Inc. Secure telecommunications
US20200322243A1 (en) * 2017-12-28 2020-10-08 Huawei Technologies Co., Ltd. Network Quality Measurement Method and Apparatus
CN113411326A (en) * 2021-06-17 2021-09-17 上海明略人工智能(集团)有限公司 Method and device for audio encryption, electronic equipment, system and readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHENYONG CHEN: "A Novel Scrambling Scheme for Digital Video Encryption", IN PROC.OF PACIFIC-RIM SYMPOSIUM ON IMAGE AND VIDEO TECHNOLOGY(PSIVT), 31 December 2006 (2006-12-31), pages 997 - 1006, XP019052870 *
王栋;: "一种基于格雷码变换和M序列异或的MPEG视频加密算法", 计算机安全, no. 05, 15 May 2010 (2010-05-15), pages 17 - 20 *

Also Published As

Publication number Publication date
CN114282246B (en) 2025-01-03

Similar Documents

Publication Publication Date Title
CN110266682B (en) Data encryption method and device, mobile terminal and decryption method
CN109660555A (en) Content safety sharing method and system based on proxy re-encryption
US7383435B2 (en) Method for encoding and decoding communication data
CN111310222A (en) File encryption method
CN107612683A (en) A kind of encipher-decipher method, device, system, equipment and storage medium
Şatir et al. A symmetric DNA encryption process with a biotechnical hardware
CN106296561A (en) Image encryption method based on hyperchaotic system and device, decryption method and device
CN115766244A (en) Internet of vehicles information encryption method and device, computer equipment and storage medium
CN117278325A (en) A computer network big data security protection method and system
CN104394161A (en) Algorithm reconstruction mechanism based secret key transmission method and system
WO2023059501A1 (en) Statistically private oblivious transfer from cdh
CN108199836A (en) A kind of key and apparatus bound, the method and device of solution binding
CN117938492B (en) Mixed block hash encryption method, device, equipment and medium
CN114282246A (en) Audio file encryption processing method, device, storage medium and device
CN111339562B (en) Order preserving/de-ordering ciphertext recovery method and device
CN104244011A (en) Image compression and encryption algorithm based on chaos
CN113051592A (en) File encryption method and device, electronic equipment and storage medium
CN115664639B (en) Financial asset transaction data transmission encryption method
US11909856B2 (en) Cryptographic data communication apparatus
CN114785530B (en) Chip authentication method, device, device and storage medium
Sivakumar et al. Generation of random key stream using word grid puzzle for the applications of cryptography
CN113971296B (en) ID fuzzification data processing system
Kabir et al. Hardware based realtime, fast and highly secured speech communication using FPGA
CN105897396B (en) For the cryptanalytic methods of SNOW 3G Encryption Algorithm
CN1252663C (en) Calculation device and calculation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant