Audio file encryption processing method, device, storage medium and equipment
By grouping and position switching of encrypted data blocks of audio files, the problem of single or high complexity of audio file encryption algorithms in the prior art is solved, and the effect of completing dual encryption with less calculation amount is achieved, which improves the The security and ease of calculation of audio files.
Patent Information
- Application Number
- CN202111621065.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In the prior art, the audio file encryption algorithm is too single or has high computational complexity, resulting in inconvenience to users.
By obtaining multiple encrypted data blocks in the original audio file, dividing them into multiple encrypted packet data, and performing position switching processing in each encrypted packet data, the generation of encrypted audio file is completed.
It realizes dual encryption with less computational volume, improves the security of the encryption algorithm and simplifies the calculation process, and solves the problem of single or high complexity of the algorithm.
Smart Images

Figure CN114282246B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of media file encryption and decryption, and in particular to an encryption processing method, device, storage medium and equipment for audio files. Background Art
[0002] In the field of communication technology, the sender and the receiver perform transmission, recording, storage and other operations through the network during a call; when transmitting, recording and storing audio files, in order to protect the audio content from being stolen, the sent audio files usually need to be encrypted. After receiving the audio file transmitted by the sender, the receiving user decrypts it before playing it.
[0003] However, in the prior art, the encryption methods for audio files include: a streaming encryption algorithm with a too simple key and algorithm, a full encryption algorithm with high computational complexity, and a layered encryption algorithm; the streaming encryption algorithm is too simple and has low security, and the full encryption algorithm and the layered encryption algorithm have relatively complex calculation processes, which brings inconvenience to users.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide an audio file encryption processing method, device, storage medium and equipment to at least solve the technical problem that the encryption algorithm in the prior art is too simple or has high computational complexity.
[0006] According to one aspect of an embodiment of the present invention, there is provided an encryption processing method for an audio file, comprising: obtaining a plurality of encrypted data blocks in an original audio file; dividing each of the encrypted data blocks into a plurality of encrypted packet data, wherein each of the encrypted packet data comprises: a plurality of sampling values; after performing position swapping processing on the plurality of sampling values in each of the encrypted packet data, performing position swapping processing on the plurality of encrypted packet data in each of the encrypted data blocks, to obtain an encrypted audio file.
[0007] Optionally, the obtaining of multiple encrypted data blocks in the original audio file includes: obtaining the sampling rate of the original audio file; and setting N consecutive sampling points in the original audio file as the encrypted data blocks according to the sampling rate, wherein each of the encrypted data blocks is divided into M encrypted packet data, and each of the encrypted packet data has K=N / M sampling points.
[0008] Optionally, the above method swaps the positions of multiple sampling values in each of the above encrypted grouped data in the following manner: swaps the positions of the first sampling value and the K-th sampling value in each of the above encrypted grouped data, and swaps the positions of the J-th sampling value and the K-J+1-th sampling value in each of the above encrypted grouped data.
[0009] Optionally, the above-mentioned position swapping processing is performed on the multiple encrypted grouped data in each of the above-mentioned encrypted data blocks to obtain the above-mentioned encrypted audio file, including: swapping the positions of the first grouped data and the W-th grouped data in the above-mentioned encrypted data block, and swapping the positions of the L-th grouped data and the W-L+1-th grouped data in the above-mentioned encrypted data block, so as to complete the position swapping processing of W grouped data and obtain the above-mentioned encrypted audio file.
[0010] According to another aspect of an embodiment of the present invention, there is also provided an encryption processing device for an audio file, comprising: an acquisition module, used to acquire multiple encrypted data blocks in an original audio file; a division module, used to divide each of the above encrypted data blocks into multiple encrypted packet data, wherein each of the above encrypted packet data includes: multiple sampling values; a processing module, used to perform position swap processing on the multiple encrypted packet data in each of the above encrypted data blocks after performing position swap processing on the multiple sampling values in each of the above encrypted packet data, so as to obtain an encrypted audio file.
[0011] Optionally, the acquisition module includes: an acquisition unit, used to acquire the sampling rate of the original audio file; and a processing unit, used to set N consecutive sampling points in the original audio file as the encrypted data block according to the sampling rate, wherein each of the encrypted data blocks is divided into M encrypted packet data, and each of the encrypted packet data has K=N / M sampling points.
[0012] Optionally, the above-mentioned device performs position swapping processing on multiple sampling values in each of the above-mentioned encrypted grouped data in the following manner: swapping the first sampling value and the K-th sampling value in each of the above-mentioned encrypted grouped data, and swapping the J-th sampling value and the K-J+1-th sampling value in each of the above-mentioned encrypted grouped data.
[0013] Optionally, the processing module is also used to: swap the positions of the first grouped data and the W-th grouped data in the encrypted data block, and swap the positions of the L-th grouped data and the W-L+1-th grouped data in the encrypted data block, so as to complete the position swap processing of W grouped data and obtain the encrypted audio file.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing any one of the above-mentioned audio file encryption processing methods.
[0015] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the above-mentioned audio file encryption processing methods.
[0016] In an embodiment of the present invention, multiple encrypted data blocks in an original audio file are obtained; each of the encrypted data blocks is divided into multiple encrypted grouped data, wherein each of the encrypted grouped data includes: multiple sampling values; after the multiple sampling values in each of the encrypted grouped data are swapped, the multiple encrypted grouped data in each of the encrypted data blocks are swapped to obtain an encrypted audio file, thereby achieving the purpose of file encryption by position swapping, thereby achieving the technical effect of completing double encryption with less calculation amount, and further solving the technical problem that the encryption algorithm in the prior art has too single algorithm or high calculation complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this 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 drawings:
[0018] Figure 1 is a flow chart of an encryption processing method for an audio file according to an embodiment of the present invention;
[0019] Figure 2 is a schematic diagram of an optional single pendulum reciprocating motion model according to an embodiment of the present invention;
[0020] Figure 3 is a schematic diagram of the structure of an optional original audio file according to an embodiment of the present invention;
[0021] Figure 4 is a schematic diagram of the structure of an optional encrypted audio file according to an embodiment of the present invention;
[0022] Figure 5 is a schematic diagram of an optional audio file encryption process according to an embodiment of the present invention;
[0023] Figure 6 The figure is a schematic diagram of the structure of an audio file encryption processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Example 1
[0027] 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 drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a flow chart of an encryption processing method for an audio file according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0029] Step S102, obtaining multiple encrypted data blocks in the original audio file;
[0030] Step S104, dividing each of the above encrypted data blocks into a plurality of encrypted grouped data, wherein each of the above encrypted grouped data includes: a plurality of sampling values;
[0031] Step S106, after performing position swapping processing on the plurality of sampling values in each of the encrypted packet data, performing position swapping processing on the plurality of encrypted packet data in each of the encrypted data blocks, to obtain an encrypted audio file.
[0032] In an embodiment of the present invention, the encryption processing scheme for the audio file provided in the above steps S102 to S106 is executed by a server, and the above server is used to obtain multiple encrypted data blocks in the original audio file; and the above encrypted data blocks are grouped to obtain encrypted grouped data, and each of the above encrypted grouped data contains multiple sampling values; in the encryption process, firstly, the multiple sampling values in the above encrypted grouped data are position-swapped to obtain encrypted encrypted grouped data, and then the encrypted encrypted grouped data are position-swapped to obtain the encrypted encrypted data blocks. After the above two position-swapped processes at different levels, the encrypted audio file is finally obtained.
[0033] It should be noted that the above-mentioned server can be built into the sending end of the above-mentioned audio file. After the server obtains the audio file from the above-mentioned sending end, it adopts the above-mentioned steps to implement data encryption; in the above-mentioned encryption process, a certain buffer needs to be set, and the size of the above-mentioned buffer can be set according to actual conditions, but the minimum must not be less than the size of an encrypted data block.
[0034] It should also be noted that the above-mentioned audio file encryption processing method is designed according to the motion law of the gravity pendulum, such as Figure 2 The above schematic diagram of the simple pendulum reciprocating motion model. The simple pendulum motion is a kind of motion that can produce reciprocating swings. The simple pendulum is an ideal physical model, which consists of an idealized pendulum ball and a cycloid. The cycloid is provided by a thin wire with negligible mass and no stretchability. The density of the pendulum ball is 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 point mass, and the cycloid and the pendulum constitute a simple pendulum.
[0035] As an optional embodiment, Figure 2 As shown, points A, B, and C are three points through which the particles of the simple pendulum pass. In the embodiment of the present invention, the pendulum length and gravity of the simple pendulum are not considered, and points A, B, and C are symmetrical points with the straight line from point B to the origin at the other end of the pendulum line as the straight line. The positions of point A and point C are the same, and there is a symmetrical relationship; therefore, during encryption, if the encrypted packet data retrieved only contains the three sampling points A, B, and C, the sampling values of point A and point C are swapped, and the sampling value of point B remains unchanged; if the sampling points in the retrieved encrypted packet data are an even number of sampling points, such as four sampling points A, B, C, and D, the positions of A and D are swapped, and the positions of B and C are swapped, thereby completing the data position swap in the encrypted packet data; the above-mentioned data position swap in the encrypted packet data can be called a single pendulum.
[0036] Optionally, after the encrypted grouped data is position swapped, the above principle is continued to be used to swap the data positions of the encrypted grouped data, thereby completing the position swap within the encrypted grouped data in the encrypted data block; the above encrypted grouped data position swap within the encrypted data block can be called a double pendulum.
[0037] As an optional embodiment, during the decryption process, the receiving end of the above-mentioned audio information needs to know 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 size of the encrypted data block, the starting position and the ending position of each encrypted packet data in the audio file can be easily calculated, and the number of sampling points in the packet can be further calculated. According to the reverse process of encryption, the encrypted packet data is first swapped in position, and then the data positions of the sampling points in the encrypted packet data are swapped, thereby completing the decryption work.
[0038] It should be noted that the above method can be applied to, but is not limited to, real-time calls of users. When making real-time calls, the call audio data can be encrypted in real time, thereby improving the security of the user's calls.
[0039] Through the embodiments of the present invention, encryption is completed only by swapping the data position, the algorithm calculation is simple, and there is no complicated calculation amount; and the decryption process is also simple. The above encryption algorithm adopts the dual protection of double keys. Only by mastering the double keys (that is, the size of each encrypted packet data and the size of the encrypted data block) can the audio decryption be completed, thereby ensuring the encryption security of the audio file content and achieving the purpose of file encryption by position swapping, thereby achieving the technical effect of completing double encryption with less calculation amount, and further solving the technical problem that the encryption algorithm in the prior art is too single or has high calculation complexity.
[0040] In an optional embodiment, the step of obtaining a plurality of encrypted data blocks in the original audio file includes:
[0041] Step S202, obtaining the sampling rate of the original audio file;
[0042] Step S204: according to the sampling rate, set the N consecutive sampling points in the original audio file as the encrypted data block, wherein each encrypted data block is divided into M encrypted data packets, and each encrypted data packet has K=N / M sampling points.
[0043] In the embodiment of the present invention, after obtaining multiple encrypted data blocks in the original audio file and completing encrypted data grouping to obtain the encrypted grouped data, the sampling rate of the original audio file is obtained; according to the sampling rate, N consecutive sampling points in the original audio file are set as the encrypted data blocks.
[0044] As an optional embodiment, the above-mentioned server sets every N consecutive sampling points of the original audio file as an encrypted data block according to the sampling rate of the original audio, wherein each encrypted data block is divided according to a preset logic and can eventually be divided into M encrypted data groups, and each encrypted data group has K=N / M sampling points.
[0045] It should be noted that the above-mentioned preset logic, that is, the preset grouping rule, is used to divide the above-mentioned encrypted data block into a plurality of encrypted grouped data.
[0046] In an optional embodiment, the above method performs position swapping processing on multiple sampling values in each of the above encrypted packet data in the following manner:
[0047] Step S302: swap the first sampling value and the K-th sampling value in each of the encrypted grouped data, and swap the J-th sampling value and the K-J+1-th sampling value in each of the encrypted grouped data.
[0048] In an embodiment of the present invention, first, a plurality of sampling values in each of the above-mentioned encrypted grouped data are swapped in position, by swapping the first sampling value and the K-th sampling value in each of the above-mentioned encrypted grouped data, and by swapping the J-th sampling value and the K-J+1-th sampling value in each of the above-mentioned encrypted grouped data.
[0049] As an optional embodiment, Figure 3 As shown in the schematic diagram of the original audio file structure, in each encrypted packet data, the first sampling point and the K-th sampling point are swapped, and the J-th sampling point and the K-J+1-th sampling point are swapped, so as to complete the first encryption, and obtain the following Figure 4 The schematic diagram of the encrypted audio file structure is shown.
[0050] It should be noted that if the size of the above audio file is an 8-bit audio file, that is, the sampling value of each sampling point is a byte value, the data of the first byte and the data of the K-J+1th byte in each group can be swapped. If the size of the above audio file is a 16-bit audio file, each sampling point is 16 bits, that is, a double-byte value, then the size of each position swap is two bytes.
[0051] In an optional embodiment, the position swapping process is performed on the plurality of the encrypted grouped data in each of the encrypted data blocks to obtain the encrypted audio file, including:
[0052] Step S402, swapping the positions of the first data group and the W-th data group in the encrypted data block, and swapping the positions of the L-th data group and the W-L+1-th data group in the encrypted data block, to complete the position swapping process of the W data groups, and obtain the encrypted audio file.
[0053] In the embodiment of the present invention, similar to the above-mentioned process of performing position swapping processing on multiple sampling values in each of the above-mentioned encrypted grouped data, the first grouped data and the W-th grouped data in the above-mentioned encrypted data block are swapped, and the L-th grouped data and the W-L+1-th grouped data in the above-mentioned encrypted data block are swapped to complete the position swapping processing of W grouped data and obtain the above-mentioned encrypted audio file.
[0054] As an optional embodiment, if there are W encrypted groups in each encrypted data block, the first group data and the Wth encrypted group data are swapped according to the simple pendulum rule, and the Lth group data and the W-L+1th group data in the above encrypted data block are swapped, thereby completing the second encryption. The encryption process of the above audio file is realized through the above two encryption steps.
[0055] Through the above steps, the encryption and decryption method based on changing the audio sampling point data based on the simple pendulum motion can be realized, such as Figure 5 The encryption process diagram of the audio file shown in the figure uses a server to receive the audio file and obtain an encryption database, group the above-mentioned encrypted data blocks, swap the positions of the sampling values in each group, and after completing the swap of the sampling value positions, the encrypted group data is also swapped to complete the encryption of the audio file, thereby achieving the purpose of file encryption by position swapping, thereby achieving the technical effect of completing double encryption with less calculation amount, and further solving the technical problems in the encryption algorithm in the prior art that the algorithm is too single or the calculation complexity is high.
[0056] Example 2
[0057] According to an embodiment of the present invention, a device embodiment for implementing the encryption processing of the above audio file is also provided. Figure 6 is a schematic diagram of the structure of an audio file encryption processing device according to an embodiment of the present invention. Figure 6 As shown, the above device includes: an acquisition module 60, a division module 62 and a processing module 64, wherein:
[0058] An acquisition module 60, used to acquire multiple encrypted data blocks in the original audio file;
[0059] The division module 62 is used to divide each of the above encrypted data blocks into a plurality of encrypted grouped data, wherein each of the above encrypted grouped data includes: a plurality of sampling values;
[0060] The processing module 64 is used to perform position swapping processing on the plurality of the sampling values in each of the encrypted grouped data and then perform position swapping processing on the plurality of the encrypted grouped data in each of the encrypted data blocks to obtain an encrypted audio file.
[0061] Optionally, the acquisition module includes: an acquisition unit, used to acquire the sampling rate of the original audio file; and a processing unit, used to set N consecutive sampling points in the original audio file as the encrypted data block according to the sampling rate, wherein each of the encrypted data blocks is divided into M encrypted packet data, and each of the encrypted packet data has K=N / M sampling points.
[0062] Optionally, the above-mentioned device performs position swapping processing on multiple sampling values in each of the above-mentioned encrypted grouped data in the following manner: swapping the first sampling value and the K-th sampling value in each of the above-mentioned encrypted grouped data, and swapping the J-th sampling value and the K-J+1-th sampling value in each of the above-mentioned encrypted grouped data.
[0063] Optionally, the processing module is also used to: swap the positions of the first grouped data and the W-th grouped data in the encrypted data block, and swap the positions of the L-th grouped data and the W-L+1-th grouped data in the encrypted data block, so as to complete the position swap processing of W grouped data and obtain the encrypted audio file.
[0064] 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 Example 1, and the instances and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1.
[0065] It should be noted that the preferred implementation of this embodiment can refer to the relevant description in Example 1, which will not be repeated here.
[0066] According to an embodiment of the present invention, an embodiment of a computer-readable storage medium is also provided. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the encryption process of the audio file provided in the above embodiment 1.
[0067] 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.
[0068] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: obtaining multiple encrypted data blocks in the original audio file; dividing each of the above encrypted data blocks into multiple encrypted packet data, wherein each of the above encrypted packet data includes: multiple sampling values; after performing position swapping processing on the multiple sampling values in each of the above encrypted packet data, performing position swapping processing on the multiple encrypted packet data in each of the above encrypted data blocks to obtain an encrypted audio file.
[0069] Optionally, the computer-readable storage medium may also execute program code of the following steps: obtaining the sampling rate of the original audio file; and according to the sampling rate, setting N consecutive sampling points in the original audio file as the encrypted data block, wherein each of the encrypted data blocks is divided into M encrypted packet data, and each of the encrypted packet data has K=N / M sampling points.
[0070] Optionally, the computer-readable storage medium may also execute program code for the following steps: swapping the positions of the first sampling value and the K-th sampling value in each of the encrypted grouped data, and swapping the positions of the J-th sampling value and the K-J+1-th sampling value in each of the encrypted grouped data.
[0071] Optionally, the computer-readable storage medium may also execute the program code of the following steps: swapping the positions of the first grouped data and the W-th grouped data in the encrypted data block, and swapping the positions of the L-th grouped data and the W-L+1-th grouped data in the encrypted data block, so as to complete the position swapping process of the W grouped data and obtain the encrypted audio file.
[0072] According to an embodiment of the present invention, an embodiment of a processor is also provided. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the encryption process of the audio file provided in the above embodiment 1.
[0073] An embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: obtaining multiple encrypted data blocks in an original audio file; dividing each of the above encrypted data blocks into multiple encrypted packet data, wherein each of the above encrypted packet data includes: multiple sampling values; after performing position swapping processing on the multiple sampling values in each of the above encrypted packet data, performing position swapping processing on the multiple encrypted packet data in each of the above encrypted data blocks to obtain an encrypted audio file.
[0074] Optionally, the electronic device may also execute the program code of the following steps: obtaining the sampling rate of the original audio file; and according to the sampling rate, setting N consecutive sampling points in the original audio file as the encrypted data block, wherein each of the encrypted data blocks is divided into M encrypted packet data, and each of the encrypted packet data has K=N / M sampling points.
[0075] Optionally, the electronic device may also execute the following program code steps: swapping the first sampling value and the Kth sampling value in each of the encrypted packet data, and swapping the Jth sampling value and the K-J+1th sampling value in each of the encrypted packet data.
[0076] Optionally, the electronic device may also execute the following program code steps: swapping the positions of the first packet data and the Wth packet data in the encrypted data block, and swapping the positions of the Lth packet data and the W-L+1th packet data in the encrypted data block, so as to complete the position swapping process of the W packets of data and obtain the encrypted audio file.
[0077] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: obtaining multiple encrypted data blocks in an original audio file; dividing each of the above encrypted data blocks into multiple encrypted packet data, wherein each of the above encrypted packet data includes: multiple sampling values; after performing position swapping processing on the multiple sampling values in each of the above encrypted packet data, performing position swapping processing on the multiple encrypted packet data in each of the above encrypted data blocks to obtain an encrypted audio file.
[0078] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0079] In the above 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 can be made to the relevant descriptions of other embodiments.
[0080] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0081] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0082] 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 separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0083] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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 a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment 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.
[0084] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for encrypting an audio file, characterized in that: include: Get multiple encrypted data blocks in the original audio file; Dividing each of the encrypted data blocks into a plurality of encrypted grouped data, wherein each of the encrypted grouped data includes: a plurality of sampling values; After performing position swapping processing on a plurality of the sampling values in each of the encrypted packet data, performing position swapping processing on a plurality of the encrypted packet data in each of the encrypted data blocks to obtain an encrypted audio file; Wherein, obtaining a plurality of encrypted data blocks in the original audio file comprises: obtaining a sampling rate of the original audio file; according to the sampling rate, setting N consecutive sampling points in the original audio file as the encrypted data blocks, wherein each of the encrypted data blocks is divided into M encrypted packet data, and each of the encrypted packet data has K=N / M sampling points; The multiple sampling values in each of the encrypted packet data are swapped in position in the following manner: the first sampling value and the K-th sampling value in each of the encrypted packet data are swapped in position, and the J-th sampling value and the KJ+1-th sampling value in each of the encrypted packet data are swapped in position; The method of performing position swapping processing on the multiple encrypted packet data in each encrypted data block to obtain the encrypted audio file includes: performing position swapping processing on the first packet data and the Wth packet data in the encrypted data block, and performing position swapping processing on the Lth packet data and the W-L+1th packet data in the encrypted data block to complete the position swapping processing on the W packet data to obtain the encrypted audio file.
2. An audio file encryption processing device, characterized in that: include: An acquisition module is used to acquire multiple encrypted data blocks in an original audio file, wherein acquiring multiple encrypted data blocks in an original audio file includes: acquiring a sampling rate of the original audio file; according to the sampling rate, setting N consecutive sampling points in the original audio file as the encrypted data blocks, wherein each of the encrypted data blocks is divided into M encrypted packet data, and each of the encrypted packet data has K=N / M sampling points; A division module, used for dividing each of the encrypted data blocks into a plurality of encrypted grouped data, wherein each of the encrypted grouped data includes: a plurality of sampling values; A processing module, configured to perform position swapping processing on multiple encrypted packet data in each encrypted data block after performing position swapping processing on multiple sampling values in each encrypted packet data to obtain an encrypted audio file, wherein the position swapping processing on multiple sampling values in each encrypted packet data is performed in the following manner: performing position swapping processing on the first sampling value and the K-th sampling value in each encrypted packet data, and performing position swapping processing on the J-th sampling value and the KJ+1-th sampling value in each encrypted packet data; wherein performing position swapping processing on multiple encrypted packet data in each encrypted data block to obtain the encrypted audio file includes: performing position swapping processing on the first packet data and the W-th packet data in the encrypted data block, and performing position swapping processing on the L-th packet data and the W-L+1-th packet data in the encrypted data block, so as to complete the position swapping processing on W packet data to obtain the encrypted audio file.
3. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the encryption processing method of the audio file of claim 1.
4. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the encryption processing method of the audio file of claim 1.
