Voice encryption method and system based on memristor neural network and S box

Through the voice encryption method based on memristive neural network and S-box, using the combination technology of chaotic sequence and S-box, the problems of slow speed and insufficient security of traditional voice encryption method are solved, and efficient and safe voice data encryption is achieved to meet the needs of meet the needs of real-time communication.

CN118677598APending Publication Date: 2024-09-20QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410945095.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Traditional voice encryption methods are too slow to process large amounts of data and cannot meet the requirements of real-time communication. In particular, there are security threats during the transmission of sensitive information in voice communications.

Method used

Using a voice encryption method based on memristive neural network and S-box, a secure S-box is generated through chaotic sequences, and combined with chaotic index scrambling and S-box diffusion, the audio data is encrypted and diffused to ensure the security of voice data and data Integrity.

Benefits of technology

It improves the security and efficiency of encryption algorithms, enhances the randomness and complexity of data, ensures the confidentiality and attack resistance of data during transmission and storage, and meets the needs of real-time communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677598A
    Figure CN118677598A
Patent Text Reader

Abstract

The invention relates to the technical field of voice encryption, and provides a voice encryption method and system based on a memristor neural network and an S box, and the method comprises the following steps: carrying out the preprocessing of obtained audio data, obtaining a separated audio sequence matrix corresponding to the audio data, and enabling the separated audio sequence matrix to comprise an integer part and a decimal part; generating a chaotic sequence by using a memristor neural network chaotic system, and generating an S box through operation; adjusting MNN parameters of the memristor neural network chaotic system, and generating a plurality of new chaotic sequences; performing S-box replacement and XOR operation by using a new chaotic sequence, and encrypting and diffusing integer part data of the audio sequence matrix; and after the encryption matrixes are combined and subjected to index permutation, the encryption matrixes are added with a decimal array obtained after to-be-processed audio data are preprocessed to obtain a final encrypted ciphertext. The secure S box is generated by using the chaos sequence, and the encryption security and data integrity of the voice data can be ensured by combining chaos index scrambling and S box diffusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field related to voice encryption, and in particular, to a voice encryption method and system based on a memristor neural network and an S-box. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.

[0003] With the rapid development of information technology, voice communication plays an increasingly important role in daily life. Whether it is daily conversation, business communication, or real-time command in the field of public security, voice communication has demonstrated its advantages of efficiency and convenience. However, the openness and susceptibility of voice communication to interception make it face serious security threats, especially in the transmission of sensitive information. This problem is particularly prominent.

[0004] Multimedia information such as voice has the characteristics of large data volume and high redundancy, which makes traditional encryption methods face huge challenges. The inventor found in the research that if the traditional block cipher algorithm AES (Advanced Encryption Standard) or the public key encryption algorithm RSA (Rivest-Shamir-Adleman) is used for encryption, it usually requires a lot of computing resources and time for encryption and decryption. Therefore, in practical applications, these traditional encryption algorithms often show that the encryption and decryption speed is too slow when processing large amounts of voice information, and it is difficult to meet the requirements of real-time communication. Summary of the invention

[0005] In order to solve the above problems, the present disclosure proposes a voice encryption method and system based on a memristor neural network and an S-box. The method uses a chaotic sequence to generate a secure S-box, and combines chaotic index scrambling and S-box diffusion to ensure the encryption security and data integrity of voice data.

[0006] In order to achieve the above objectives, the present disclosure adopts the following technical solutions:

[0007] One or more embodiments provide a voice encryption method based on a memristor neural network and an S-box, comprising the following steps:

[0008] Preprocessing the acquired audio data to obtain a separated audio sequence matrix corresponding to the audio data, wherein the separated audio sequence matrix includes an integer part and a decimal part;

[0009] The chaotic sequence is generated by using the memristor neural network chaotic system, and the S-box is generated by calculation;

[0010] Adjust the MNN parameters of the memristor neural network chaotic system to generate multiple new chaotic sequences;

[0011] The new chaotic sequence is used to perform S-box replacement and XOR operation to encrypt and diffuse the integer part of the audio sequence matrix.

[0012] After merging the encryption matrix and performing index permutation, the final encrypted ciphertext is obtained by adding it to the decimal array obtained after preprocessing the audio data to be processed.

[0013] A further technical solution is to pre-process the acquired audio data to obtain a separated audio sequence matrix corresponding to the audio data, including the following steps:

[0014] Step S2: Process the acquired audio data to obtain a corresponding one-dimensional array A, construct a symbol array B, and divide the one-dimensional array corresponding to the audio into an integer part and a decimal part;

[0015] Step S3: convert the integer part into binary, concatenate it with the symbol array and then split it to obtain an audio sequence matrix;

[0016] A feasible technical solution is as follows: in step S3, the integer part corresponding to the one-dimensional array corresponding to the audio is converted into a binary matrix with at least 8 columns, a symbol array B is added, and the matrix is ​​divided into two binary matrices as the audio sequence matrix to be encrypted.

[0017] Furthermore, the process of dividing into two binary matrices as the audio sequence matrix to be encrypted is as follows:

[0018] When converting the integer part into binary, the integer audio array IA corresponding to the integer part is multiplied by 10 multiple times until it reaches or exceeds the set maximum value, thereby obtaining the range-scaled integer audio array IA′;

[0019] Convert the range-scaled integer audio array IA′ to a binary matrix CA;

[0020] Append the symbol array B to the rightmost column of the matrix CA to obtain a new matrix C;

[0021] C is divided into two matrices, one of which has a binary width of 8 and is denoted as C1, and the other has a binary width of N-7 and is denoted as C2; the two matrices after division are the audio sequence matrices to be encrypted.

[0022] A feasible technical solution is to generate an S-box through integer operation, bitwise AND operation and modular operation on the chaotic sequence in sequence.

[0023] A further technical solution uses a chaotic sequence to perform S-box replacement and XOR operation to encrypt and diffuse data, including the following steps:

[0024] The obtained chaotic sequence is rounded and modulo-operated to obtain multiple random sequences in different ranges;

[0025] Use the first random sequence obtained by the chaotic sequence to perform S-box replacement;

[0026] Perform an XOR operation on the second random sequence obtained by the chaotic sequence, the integer part data of the audio sequence matrix, and the sequence obtained after the S-box replacement to obtain the first encryption matrix and the second encryption sequence;

[0027] A diffusion operation is performed on the second encryption sequence to obtain a third encryption matrix.

[0028] A further technical solution, a method for determining the final encryption array, comprises the following steps:

[0029] Merge the encryption matrices and convert them into decimal arrays to obtain a combined encryption matrix;

[0030] The third random sequence H obtained by the new chaotic sequence is arranged in ascending order, and the combined encryption matrix is ​​scrambled based on the arrangement result to obtain a first ciphertext. The first ciphertext is added to the decimal part obtained after preprocessing the audio data to obtain a final encrypted ciphertext.

[0031] One or more embodiments provide a voice encryption system based on a memristor neural network and an S-box, including:

[0032] A preprocessing module is configured to preprocess the acquired audio data to obtain a separated audio sequence matrix corresponding to the audio data, wherein the separated audio sequence matrix includes an integer part and a decimal part;

[0033] An S-box generation module is configured to generate a chaotic sequence using a memristor neural network chaotic system and generate an S-box through calculation;

[0034] A chaotic sequence generation module is configured to adjust MNN parameters of the memristor neural network chaotic system to generate multiple new chaotic sequences;

[0035] The confusion diffusion module is configured to use the new chaotic sequence to perform S-box replacement and XOR operation, encrypt and diffuse the integer part data of the audio sequence matrix, and obtain an encrypted matrix;

[0036] The ciphertext generation module is configured to merge the encryption matrices, perform index permutation processing, and add the decimal array obtained after preprocessing the audio data to obtain the final encrypted ciphertext.

[0037] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the above-mentioned voice encryption method based on a memristor neural network and an S-box are completed.

[0038] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the steps in the above-mentioned voice encryption method based on a memristor neural network and an S-box are completed.

[0039] Compared with the prior art, the present invention has the following beneficial effects:

[0040] (1) The present invention uses a chaotic sequence generated by a chaotic memristor neural network (MNN) to perform encryption operations. The chaotic sequence is highly random and unpredictable, which greatly enhances the security of the encryption algorithm and is difficult to crack.

[0041] (2) The present disclosure combines multiple levels of encryption mechanisms such as S-box replacement, XOR operation and index replacement in the encryption process. Through confusion and diffusion, the randomness and complexity of encrypted data are improved, ensuring the confidentiality and anti-attack capability of data during transmission and storage.

[0042] (3) The present disclosure optimizes the preprocessing process of audio data, including data symbol identification, separation of integer and decimal parts, and binary conversion. The efficient data preprocessing and conversion process not only improves encryption efficiency, but also ensures the integrity and consistency of data during the encryption process.

[0043] The advantages of the present disclosure and the advantages of additional aspects will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The exemplary embodiments of the present disclosure and the description thereof are used to explain the present disclosure but do not constitute a limitation of the present disclosure.

[0045] Figure 1 It is a flowchart of voice encryption of Embodiment 1 of the present disclosure;

[0046] FIG2( a ) is a chaotic phase diagram of the memristor neural network of Example 1 of the present disclosure at the x1-x2 coordinate;

[0047] FIG2( b ) is a chaotic phase diagram of the memristor neural network of Example 1 of the present disclosure at the x1-x3 coordinates;

[0048] FIG2( c ) is a chaotic phase diagram of the memristor neural network of Example 1 of the present disclosure at the x2-x3 coordinate;

[0049] Figure 3This is a comparison chart of encryption and decryption effects of three different voice segments in the encryption example of Embodiment 1 of the present disclosure;

[0050] Figure 4 This is a diagram showing the effect of the first encrypted speech segment failing to be decrypted due to an incorrect key in the encryption example of Embodiment 1 of the present disclosure;

[0051] Figure 5 is the histogram distribution of three different voice segments before and after encryption in the encryption example of Embodiment 1 of the present disclosure;

[0052] Figure 6 It is a spectrum diagram of three different voice segments before and after encryption in the encryption example of Embodiment 1 of the present disclosure;

[0053] Figure 7 is a distribution diagram of adjacent sample points before and after encryption of three different voice segments in the encryption example of Embodiment 1 of the present disclosure; DETAILED DESCRIPTION

[0054] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.

[0055] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.

[0056] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof. It should be noted that, in the absence of conflict, the various embodiments in the present disclosure and the features in the embodiments can be combined with each other. The embodiments will be described in detail below in conjunction with the accompanying drawings.

[0057] Technical term explanation:

[0058] Memristor Neural Networks: Memristor Neural Networks (MNN) are artificial neural networks that use memristors to simulate synapses. Memristors are special electronic devices whose resistance reflects the relationship between the charge and magnetic flux flowing through the memristor. Memristors have nonlinear resistance characteristics and memory capabilities. Because of the existence of memristors, memristor neural networks can usually exhibit special nonlinear behaviors, such as chaos and hyperchaos. The strength of the memristor is different, and the chaotic characteristics exhibited by the memristor neural network are also different. Therefore, the dynamic behavior of the memristor neural network is very complex.

[0059] S-box: S-box (Substitution-box) is a nonlinear structure that can be used for substitution operations in cryptography. Its main function is to perform nonlinear scrambling and diffusion on the original data. It is also called a vector function or a multi-output Boolean function. Currently, there are many types of S-boxes, including 4×4, 8×8, 16×16 and 8×32. The S-box used in this technology is 16×16.

[0060] Chaos and hyperchaos: Chaos is a random and irregular state of motion exhibited by nonlinear dynamic systems. Chaotic systems are highly sensitive to initial conditions and system parameters, and a very slight change can cause drastic changes in system behavior. Chaotic systems exhibit randomness and unpredictability due to their extremely complex dynamic behavior. Hyperchaos systems refer to systems that are more complex and more difficult to predict than ordinary chaotic systems. Hyperchaotic systems have higher degrees of freedom and more nonlinear terms, and exhibit more complex dynamic behavior, so they have higher complexity and randomness.

[0061] Chaotic sequence: A chaotic sequence is a random sequence generated by a deterministic system. It has the characteristics of nonlinearity, pseudo-randomness, non-periodicity, unpredictability, and sensitivity to initial values. It can be used to generate pseudo-random numbers. The initial value of the chaotic system has a great influence on the generated chaotic sequence.

[0062] Chaotic systems have been widely used in the field of multimedia information encryption due to their initial value sensitivity and pseudo-randomness, but low-dimensional chaotic systems are often used, which have small key space, short period and low complexity. Memristor is a nonlinear component with memory characteristics, which can be used to construct a memristor neural network. Memristor neural networks have high dimensions and can exhibit complex dynamic behaviors, such as chaos and hyperchaos, under different memristor strengths. In addition, the parameter selection of memristor neural networks is relatively flexible and the key space is large. S-box (substitution box) is one of the core components in modern cryptography and is widely used in symmetric encryption algorithms. In the present disclosure, chaotic systems, memristor neural networks and S-boxes are combined to construct an efficient and secure voice encryption scheme. The following is an explanation with specific embodiments.

[0063] Example 1

[0064] In the technical solutions disclosed in one or more embodiments, Figures 1 to 7 As shown, a voice encryption method based on a memristor neural network and an S-box comprises the following steps:

[0065] Step S1: Generate a chaotic sequence using a memristor neural network chaotic system and generate an S-box through calculation;

[0066] Step S2: Process the acquired audio data to obtain a corresponding one-dimensional array A, construct a symbol array B, and divide the one-dimensional array corresponding to the audio into an integer part and a decimal part;

[0067] Step S3: convert the integer part into binary, concatenate it with the symbol array and then split it to obtain an audio sequence matrix;

[0068] Specifically, the integer part is converted into a binary matrix with at least 8 columns, a symbol array is added, and the matrix is ​​divided into two binary matrices as the audio sequence matrix to be encrypted.

[0069] Step S4: adjusting the MNN parameters of the memristor neural network chaotic system to generate multiple new chaotic sequences;

[0070] Specifically, in this embodiment, 5 new chaotic sequences are generated;

[0071] Step S5: Use the new chaotic sequence to perform S-box replacement and XOR operation to encrypt and diffuse the data.

[0072] Step S6: After merging the encryption matrix and performing index permutation, the matrix is ​​added to the decimal array obtained after preprocessing the audio data to be processed to obtain the final encrypted ciphertext.

[0073] The speech encryption scheme based on chaotic memristor neural network (MNN) and S-box proposed in this embodiment. First, the chaotic behavior of memristor neural network under different memristor strengths is studied, and an S-box is generated using MNN. Subsequently, the original speech is preprocessed, including speech data range scaling, symbol modification, sequence separation, etc. The separated sequence is XORed with the chaotic sequence and the sequence generated by the S-box. In addition, another chaotic sequence is used for scrambling operation.

[0074] In this embodiment, a chaotic sequence generated by a chaotic memristor neural network (MNN) is used for encryption operations. The chaotic sequence is highly random and unpredictable, which greatly enhances the security of the encryption algorithm and is difficult to crack; the encryption process combines multi-level encryption mechanisms such as S-box replacement, XOR operation, and index replacement. Through confusion and diffusion, the randomness and complexity of the encrypted data are improved, ensuring the confidentiality and anti-attack ability of the data during transmission and storage.

[0075] In some embodiments, the memristor neural network chaotic system can be expressed as shown in formula (1):

[0076]

[0077] In this formula, x i Corresponding to the capacitance C i The state variable of the upper voltage; Ri is the membrane resistance; W ij is the synaptic weight between the i-th and j-th neurons; n is the number of neurons; I i is the external current; v j is the activation function of the neuron, usually expressed as a hyperbolic tangent function, that is,

[0078] R i =1,C i =1,I i =0, the resistance of the memristor reflects the magnetic flux The relationship between the charge q and the magnetically controlled memristor is used in this embodiment, so Assumptions So |r| represents the memristor strength. When r changes, the system exhibits different dynamic behaviors.

[0079] In step 1, a technical solution that can be implemented is to generate an S-box through integer operation, bitwise AND operation and modulus operation on the chaotic sequence in sequence;

[0080] The rounding operation in step S1 is shown in formula (2):

[0081]

[0082] In this formula, represents the rounding function, y i Represents the five chaotic sequences generated by the chaotic system, s i Represents the chaotic sequence after being enlarged one hundred times, i=1,2,3,4,5.

[0083] The bitwise AND operation and the modulo operation are shown in formula (3):

[0084]

[0085] Here, "bitand" is a MATLAB function that performs a bitwise AND operation on two integers. The value range is [0,255], i=1,2,3,4,5.

[0086] In step S2, optionally, the audio data is obtained as a one-dimensional array, and the audio data is processed to construct a symbol array, as shown in formula (4):

[0087]

[0088] Among them, B represents the symbol array, A represents the audio data, and M represents the length of the audio array;

[0089] In step S2, the method for splitting the one-dimensional array corresponding to the audio data is to first take the absolute value of the one-dimensional array, and then split it into an integer part and a decimal part by rounding. The splitting method can be shown in formula (5):

[0090]

[0091] Among them, IA is the integer part and FA is the decimal part;

[0092] In step S3, the integer part is converted into a binary matrix of at least 8 columns, a symbol array is added, and the matrix is ​​divided into two binary matrices C1 and C2, which are the integer part of the audio sequence matrix.

[0093] Specifically, the process of dividing into two binary matrices as the audio sequence matrix to be encrypted is as follows:

[0094] Step S31, when converting the integer part into binary, multiply the integer audio array IA corresponding to the integer part by 10 multiple times until it reaches or exceeds the set maximum value, to obtain the integer audio array IA′ after range scaling;

[0095] Step S32, converting the range-scaled integer audio array IA′ into a binary matrix CA, with a binary width of N;

[0096] Step S33, append the symbol array B to the rightmost column of the matrix CA to obtain a new matrix C;

[0097] Step S34, divide C into two matrices, one matrix has a binary width of 8, denoted as C1, and the other matrix has a binary width of N-7, denoted as C2; the two matrices after division are the audio sequence matrices to be encrypted.

[0098] In the above scheme, the preprocessing process of audio data is optimized, including data symbol identification, separation of integer and decimal parts, and binary conversion. The efficient data preprocessing and conversion process not only improves encryption efficiency, but also ensures the integrity and consistency of data during the encryption process.

[0099] In step S4, the MNN parameters of the memristor neural network chaos system (MNN) are parameters for controlling the behavior and characteristics of the chaotic system, including: weight parameters, threshold parameters, memristor characteristic parameters, and external input parameters;

[0100] Weight parameters: used to determine the connection strength between neurons in the neural network. Adjusting the weight parameters can change the output characteristics of the neural network, thereby affecting the generation of chaotic sequences.

[0101] Thresholds: used to determine the activation threshold of neurons; adjusting the threshold parameters can change the activation mode of neurons, thereby affecting the behavior of the chaotic system;

[0102] Memristor Parameters: used to describe the conductivity characteristics of the memristor, such as the rate of change of conductivity and nonlinear characteristics; adjusting these parameters can change the response characteristics of the memristor, thereby affecting the dynamic behavior of the neural network;

[0103] External Input Parameters: refers to the external input signal acting on the neural network; adjusting the amplitude and frequency of the external input signal can change the output of the chaotic system.

[0104] like Figures 2(a) to 2(c) As shown in the figure, the chaotic phase diagrams in different coordinate systems, in which x1, x2, and x3 represent the activation states of neurons respectively. In Figure 2(a), the phase diagram of x1 to x2 is shown, showing the dynamic relationship between the first and second neurons; in Figure 2(b), the phase diagram of x1 to x3 is shown, showing the dynamic relationship between the first and third neurons; in Figure 2(c), the phase diagram of x2 to x3 is shown, showing the dynamic relationship between the second and third neurons. These phase diagrams help to understand the complex dynamic behavior of the system under different combinations of variables.

[0105] In step S5, the chaotic sequence is used to perform S-box replacement and XOR operation to encrypt and diffuse the data, including the following steps:

[0106] Step S51, performing rounding and modulo operation on the obtained chaotic sequence to obtain multiple random sequences in different ranges;

[0107] In this embodiment, five chaotic sequences x(i), y(i), z(i), w(i), and h(i) are obtained by adjusting the MNN parameters. The obtained chaotic sequences are processed to obtain random sequences, as shown in formula (6):

[0108]

[0109] Among them, X, Y form a random sequence from 1 to 16 for S box substitution, and Z, W form a random sequence from 0 to 2 N-7 The random sequence of -1 is used to perform XOR operation with the audio sequence, N represents the binary width of the audio sequence C; H is used to confuse the audio sequence. Here, M represents the number of rows of the chaotic sequence, which corresponds to the length of the audio one-dimensional array, has the same numerical value and is represented by the same character.

[0110] Step S52: Perform S-box replacement using the first random sequence obtained by the chaotic sequence;

[0111] Specifically, the first random sequence is a random sequence of 1 to 16 generated by a chaotic sequence;

[0112] Step S53, performing an XOR operation on the second random sequence obtained by the chaotic sequence, the integer part data (C1 and C2) of the audio sequence matrix, and the sequence J(i) obtained after the S-box replacement to obtain the first encryption matrix EC1(i) ​​and the second encryption sequence EC2(i);

[0113] Specifically, the second random sequence is generated by a chaotic sequence from 0 to 2 N-7 -1 random sequence Z, W;

[0114] Step S54, performing a diffusion operation on the second encryption sequence EC2(i) to obtain a third encryption matrix ED2;

[0115] The S-box replacement operation in step S5 can be realized as shown in formula (7):

[0116] J(i)=Sbox (X(i),Y(i)),i=1,2,3,…,M (7)

[0117] The XOR operation is shown in formula (8):

[0118]

[0119] The diffusion operation is shown in formula (9):

[0120]

[0121] in, The horizontal lines represent the binary representations of J, Z and W respectively, and C1 and C2 are the two binary matrices obtained by segmentation in step S3.

[0122] In step S6, the encryption matrix is ​​merged, and then the index permutation process is performed, and the decimal array obtained after the preprocessing of the audio data to be processed is added to obtain the final encrypted ciphertext, which includes the following steps:

[0123] Step S61, merging the encryption matrices and converting them into decimal arrays to obtain a combined encryption matrix E(i);

[0124] Specifically, the third encryption matrix ED2 and the first encryption matrix EC1 are combined into a matrix e, and the matrix e is converted into a decimal matrix E to obtain a combined encryption matrix E(i);

[0125] The binary matrix e is converted into a decimal matrix E, as shown in formula (10):

[0126]

[0127] Among them, E(i) represents the i-th number in the array E, e ij represents the element in the i-th row and j-th column of the matrix e, and N+1 represents the number of columns of the matrix e;

[0128] Step S62, performing chaotic index replacement as follows: arranging the third random sequence H obtained by the new chaotic sequence in ascending order, performing a scrambling operation on the combined encryption matrix E(i) based on the arrangement result to obtain a first ciphertext, adding the first ciphertext and the decimal part obtained after preprocessing the audio data to obtain a final encrypted ciphertext, i.e., a final encryption array;

[0129] Specifically, if H(i) occupies the kth position in ascending order, then:

[0130] EA(k)=E(i),k,i=1,2,3,…,M (11)

[0131] Among them, E(i) represents the i-th number in the array E, and EA(k) represents the k-th number in the array EA. In this way, the array EA is obtained.

[0132] The final ciphertext is EA=EA+FA, where FA represents the decimal part array of |A|. Therefore, the final ciphertext is a real number array.

[0133] Furthermore, it also includes a performance evaluation of encryption performance, including comparing NSCR and UACI, correlation coefficient and information entropy indicators to obtain performance evaluation results.

[0134] Experimental simulation analysis is carried out on the proposed encryption algorithm, and the encryption effect of the algorithm is evaluated through various indicator analyses.

[0135] In step S7, the encryption performance of the algorithm needs to be analyzed by calculating NSCR and UACI. The specific calculation method is shown in formula (12):

[0136]

[0137] Among them, EA(i) and EA′(i) represent the values ​​of the encrypted speech at the i-th data point, which correspond to the encryption results of the original audio before and after a data point is changed. L and b represent the total number of data points of the encrypted audio data and the bit depth of the audio data point, respectively.

[0138] NSCR and UACI are important indicators for measuring the degree of change of encrypted voice signals and their anti-attack capabilities. NSCR (Number of Changing Pixel Rate) is used to characterize the degree of change of encrypted data after a single point change in the original audio data; UACI (Unified Average Changing Intensity) is used to characterize the average intensity of change of encrypted data after a single point change in the original audio data.

[0139] In step S7, the encryption performance of the algorithm needs to be analyzed and the encrypted data correlation coefficient needs to be calculated. The correlation coefficient is used to evaluate the diffusion of the encrypted audio data. The closer the correlation coefficient of the adjacent pixels of the encrypted audio is to 0, the better the performance of the encryption algorithm is. The specific calculation method is shown in formula (13):

[0140]

[0141] In the above formula, x, y are a pair of adjacent sampling points (P, P+1) in the audio file, q is the number of sample points, and r is the number of pairs of sample points. x7 Represents the correlation coefficient between variables x and y.

[0142] In step S7, the encryption performance of the algorithm needs to be analyzed, and the information entropy of the encrypted data needs to be calculated. The information entropy is used to measure the randomness of the encrypted data. The specific calculation method is shown in formula (14):

[0143]

[0144] In the above formula, m i represents the i-th sample value, p(m i ) represents m i The probability of appearing in a speech segment, t represents the binary length of the speech sample point, here t = 8, that is, each speech sample point is processed into 8 bits;

[0145] The closer the information entropy is to the maximum value, the higher the randomness of the encrypted data is, and the better the encryption performance is;

[0146] The method for determining information entropy may include the following steps:

[0147] 1) Count the frequency of each symbol: traverse the encrypted data and count the number of times each symbol appears.

[0148] 2) Calculate the probability of each symbol: Divide the number of occurrences of each symbol by the total length of the data to obtain the probability p(m i );

[0149] 3) Calculate information entropy: Substitute the probability of each symbol into the information entropy formula (14) to calculate the overall information entropy.

[0150] The encryption method process of this embodiment is described below with a specific encryption example;

[0151] Figure 1 This is a flow chart of a voice encryption scheme based on a chaotic memristor neural network (MNN) and an S-box. The specific encryption process is as follows:

[0152] S1: Using chaotic sequence, S-box is generated by integer operation, bitwise AND operation and modulo operation;

[0153] 1.1 First, set the initial value of MNN(1) to x0 = (0, 0.01, 0, 0, 0) and the memristor strength to R = r = -0.5. Use the ode45 function to solve the ordinary differential equation MNN(1) and record the state variables (x1, x2, x3, x4, x5) at t = 100.

[0154] 1.2 Multiply the results (x1, x2, x3, x4, x5) by 100 and round them down to integers, expressed as s1, s2, s3, s4, s5, as shown in formula (2).

[0155] 1.3 Perform bitwise AND operation on s1, s2, s3, s4, s5 to obtain S1, S2, S3, S4, S5; perform modulus operation on S1, S2, S3, S4, S5 to obtain As shown in formula (3). Store in the table And remove any duplicate numbers that occur later in the table.

[0156] 1.4 Repeat the above steps using (x1, x2, x3, x4, x5) as the new initial value x0 of MNN(1) until the number of numbers in the table reaches 256, then terminate the process.

[0157] 1.5 Convert the 256 numbers in the table into a 16×16 matrix to get the final S-box.

[0158] S2: Read the audio data as a one-dimensional array, construct a symbol array, and divide the audio array after taking the absolute value into an integer part and a decimal part. Preprocess the acquired audio data, including performing range scaling, symbol modification, and sequence separation in sequence;

[0159] Specifically, the audio data is read using the "Audioread" function in MATLAB, and then converted into a one-dimensional array A. At the same time, a signed array B (as shown in formula (4)) is constructed, which consists of 0 and 1. The numbers in the audio array A are converted to their absolute values ​​to obtain unsigned audio data. The unsigned audio array |A| is split into an array IA of the integer part and an array FA of the decimal part (as shown in formula (5)).

[0160] S3: Convert the integer part array IA into a binary matrix with at least 8 columns, add the sign array to the right of the binary matrix, and split the resulting new matrix into two binary matrices.

[0161] When converting integers to binary, you need to refer to the maximum value in the integer audio array IA. If the maximum value is less than 2 7 , then iteratively multiply all elements of IA by 10 until the maximum value reaches or exceeds the maximum value 2 7 . This process ensures that the binary representation of each element in IA is at least 8 bits. Record the number of multiplications by 10, which will be used again during decryption. The qualified integer audio array is recorded as IA′, which is then converted into a binary matrix CA. After obtaining the matrix CA, the symbol array B is appended to the rightmost column of the matrix CA to obtain a new matrix C. C is then split into two matrices, one with a binary width of 8, recorded as C1, and the other with a binary width of N-7, recorded as C2.

[0162] S4: Set MNN parameters and generate 5 chaotic sequences.

[0163] The integration time of MNN is set to 20000, the initial value x0 = (0, -0.01, -0.01, 0.01, 0), and the memristor strength R = r = -0.5, and a chaotic sequence is generated on this basis. In order to enhance the randomness, the first 1000 bits of the generated chaotic sequence x, y, z, w, h are discarded, and then the modulus operation is performed on x, y, z, w, h, as shown in formula (6).

[0164] S5: Use chaotic sequences to perform S-box substitution and XOR operations to encrypt and diffuse data.

[0165] Perform S-box replacement on the generated X and Y arrays (as shown in formula (7)), where X(i) represents the row number of the S box and Y(i) represents the column number of the S box, to generate a new array J. Perform an XOR operation on the matrix C1 and J by row to obtain the encrypted result EC1. At the same time, perform an XOR operation on C2 and Z, W to obtain a new matrix EC2. Perform row-by-row diffusion on EC2 to increase confusion, as shown in formula (9).

[0166] S6: After merging the encrypted matrices and performing index permutation, the matrix is ​​added to the decimal part array to obtain the final encrypted array.

[0167] Combine the encrypted ED2 and EC1 into a matrix e, and then convert the matrix e into a decimal array E. Use the chaotic sequence H to perform chaotic index permutation on the array E to obtain the encrypted array EA. First, sort the sequence H in ascending order. If H(i) occupies the kth position in ascending order, then EA(k)=E(i), and the array EA can be obtained. The final ciphertext is EA=EA+FA, where FA represents the decimal part array of |A|. Therefore, the final ciphertext is a real number array.

[0168] S7: Encryption indicator analysis:

[0169] In order to evaluate the effectiveness of the present invention, three different speech segments are used to evaluate the performance of the algorithm. Figure 3 shown. Figure 3 In the figure, the first line is the original speech; the second line is the encrypted speech data; the third line is the decrypted speech data; the results show that the encryption algorithm can effectively encrypt different WAV speech files. There is no obvious similarity between the encrypted speech and the original speech, and the time domain characteristics of the encrypted speech show an ideal uniform distribution. The decryption algorithm can restore the correct original speech without affecting the speech quality.

[0170] The specific contents of the performance evaluation are as follows.

[0171] Figure 4 This is a key sensitivity analysis test diagram. The first encrypted speech is decrypted using the correct key (left) and a slightly different key (right). The first encrypted speech is Figure 3 The first voice data on the left side of the first row in the figure can be found that if the encryption and decryption keys are slightly different, the correct decrypted voice cannot be obtained.

[0172] Figure 5 The figure shows the histogram distribution of three different voices before and after encryption. The first column is the histogram of the three original voices; the second column is the histogram of the encrypted voice data; Figure 5 It can be seen that the original speech presents a normal distribution, which is consistent with the distribution pattern of most speech. After encrypting the original speech, the distribution of the encrypted speech becomes quite uniform, which is very different from the distribution of the original speech. Therefore, the encrypted speech contains almost no information of the original speech, indicating that the proposed encryption algorithm can resist statistical attacks well.

[0173] Figure 6The spectrograms of three different voices before and after encryption are shown. The first column is the spectrogram of the three original voices; the second column is the spectrogram of the encrypted voice data; by comparing the spectrograms of the original voice and the encrypted voice, it can be observed that the encrypted spectrogram is similar to noise and has no obvious frequency feature information. There is no similarity between the spectrograms of the original voice and the encrypted voice, indicating that the encryption algorithm effectively hides the frequency information of the voice.

[0174] The experimental results of three different voices before and after encryption are as follows Figure 7 As shown in the figure. The first row shows the distribution of adjacent sample points of three original speech; the second row shows the adjacent sample points of the encrypted speech data; the adjacent sample points of the original speech are highly correlated and mainly distributed near the straight line y=x. After encryption, all adjacent sample points are evenly distributed. This shows that there is no obvious correlation between the encrypted speech. The proposed encryption algorithm effectively masks the correlation between adjacent sample points and shows an excellent scrambling effect.

[0175] Table 1 shows the corresponding NSCR and UACI detection results. The ideal values ​​of NSCR and UACI are 99.6094% and 33.4635% respectively. When the NSCR and UACI calculation results of an algorithm are closer to the ideal values, it means that the algorithm has a stronger ability to resist differential attacks. It can be seen from Table 1 that the encryption algorithm proposed in this embodiment has a strong defense capability against differential attacks;

[0176] Table 1 NSCR and UACI test results

[0177]

[0178] Table 2 shows the test results of the correlation coefficient of adjacent pixels of speech. Generally, the correlation coefficient of adjacent sampling points of original audio is close to 1, while the correlation coefficient of adjacent pixels of encrypted audio should be close to 0. As can be seen from Table 2, the correlation coefficient of adjacent pixels of encrypted speech in this implementation is relatively close to 0, which further verifies that the algorithm has a good diffusion effect.

[0179] Table 2 Test results of speech adjacent pixel correlation coefficient

[0180]

[0181] For a speech quantized with 8 bits, if the entropy is 8, it means that the speech is completely random. The closer the entropy is to 8, the better the randomness. Table 3 shows the entropy values ​​of three different speech segments before and after encryption. The entropy values ​​of the three encrypted speech segments are very close to the ideal value of 8.

[0182] Table 3 Speech information entropy test results

[0183]

[0184] Finally, a comparison experiment was conducted between the method of this embodiment and the encryption method in the prior art, and the comparison results are shown in Table 4:

[0185] Table 4 Comparison with other voice encryption algorithms

[0186]

[0187] Lima et al: is an audio encryption scheme based on cosine number transform (CNT) proposed by Lima et al. This method meets the main security requirements of secret key cryptography and obtains a correlation coefficient significantly close to 0 and an entropy value close to 16 after encrypting a 16-bit audio signal.

[0188] Sasikaladevi et al: Sasikaladevi et al proposed an audio cryptographic system based on discrete wavelet transform and elliptic curve cryptography. This method showed better protection level of audio signals against different security threats and can be recommended for multi-channel audio processing.

[0189] Kumar et al.: This paper proposes an implementation of a novel chaos-based audio encryption strategy using sine-cosine (SC) mapping, logical sine (LSC) mapping, and double DNA operations.

[0190] It can be seen from Table 4 that the method of this embodiment has strong advantages.

[0191] Example 2

[0192] Based on Example 1, this embodiment provides a voice encryption system based on a memristor neural network and an S-box, including:

[0193] A preprocessing module is configured to preprocess the acquired audio data to obtain a separated audio sequence matrix corresponding to the audio data, wherein the separated audio sequence matrix includes an integer part and a decimal part;

[0194] An S-box generation module is configured to generate a chaotic sequence using a memristor neural network chaotic system and generate an S-box through calculation;

[0195] A chaotic sequence generation module is configured to adjust MNN parameters of the memristor neural network chaotic system to generate multiple new chaotic sequences;

[0196] The confusion diffusion module is configured to use the new chaotic sequence to perform S-box replacement and XOR operation, encrypt and diffuse the integer part data of the audio sequence matrix, and obtain an encrypted matrix;

[0197] The ciphertext generation module is configured to merge the encryption matrices, perform index permutation processing, and add the decimal array obtained after preprocessing the audio data to obtain the final encrypted ciphertext.

[0198] It should be noted here that the various modules in this embodiment correspond one-to-one to the various steps in Example 1, and the specific implementation process is the same, which will not be repeated here.

[0199] Example 3

[0200] This embodiment provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, the steps of the voice encryption method based on the memristor neural network and S-box in Example 1 are completed.

[0201] Example 4

[0202] This embodiment provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps in the voice encryption method based on a memristor neural network and an S-box of Embodiment 1 are completed.

[0203] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

[0204] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.

Claims

1. A voice encryption method based on a memristor neural network and an S-box, characterized in that: The steps include: Preprocessing the acquired audio data to obtain a separated audio sequence matrix corresponding to the audio data, wherein the separated audio sequence matrix includes an integer part and a decimal part; The chaotic sequence is generated by using the memristor neural network chaotic system, and the S-box is generated by calculation; Adjust the MNN parameters of the memristor neural network chaotic system to generate multiple new chaotic sequences; The new chaotic sequence is used to perform S-box replacement and XOR operation, and the integer part of the audio sequence matrix is ​​encrypted and diffused to obtain an encrypted matrix. The encryption matrices are merged, and then the index permutation process is performed, and the final encrypted ciphertext is obtained by adding the decimal array obtained after the preprocessing of the audio data to be processed.

2. The voice encryption method based on memristor neural network and S-box as claimed in claim 1, characterized in that: The preprocessing method comprises the following steps: Process the acquired audio data to obtain a corresponding one-dimensional array A, construct it into a symbol array B, and divide the one-dimensional array corresponding to the audio into an integer part and a decimal part; The integer part is converted into binary, concatenated with the symbol array and then divided to obtain the audio sequence matrix after the integer part is converted.

3. The voice encryption method based on memristor neural network and S-box as claimed in claim 2, characterized in that: Specifically, the integer part corresponding to the one-dimensional array corresponding to the audio is converted into a binary matrix with at least 8 columns, a symbol array B is added, and the matrix is ​​divided into two binary matrices as the audio sequence matrix to be encrypted.

4. The voice encryption method based on memristor neural network and S-box as claimed in claim 3, characterized in that: The process of splitting into two binary matrices as the audio sequence matrix to be encrypted is as follows: When converting the integer part into binary, the integer audio array IA corresponding to the integer part is multiplied by 10 multiple times until it reaches or exceeds the set maximum value, thereby obtaining the range-scaled integer audio array IA′; Convert the range-scaled integer audio array IA′ to a binary matrix CA; Append the symbol array B to the rightmost column of the matrix CA to obtain a new matrix C; C is divided into two matrices, and the two matrices after division are the audio sequence matrices to be encrypted.

5. The voice encryption method based on memristor neural network and S-box as claimed in claim 1, characterized in that: The chaotic sequence is sequentially subjected to integer operation, bitwise AND operation and modular operation to generate S-box.

6. The voice encryption method based on memristor neural network and S-box as claimed in claim 2, characterized in that: Using chaotic sequences to perform S-box replacement and XOR operations to encrypt and diffuse data includes the following steps: The obtained chaotic sequence is rounded and modulo-operated to obtain multiple random sequences in different ranges; Use the first random sequence obtained by the chaotic sequence to perform S-box replacement; Perform an XOR operation on the second random sequence obtained by the chaotic sequence, the integer part data of the audio sequence matrix, and the sequence obtained after the S-box replacement to obtain the first encryption matrix and the second encryption sequence; A diffusion operation is performed on the second encryption sequence to obtain a third encryption matrix.

7. The voice encryption method based on memristor neural network and S-box as claimed in claim 1, characterized in that: The method for determining the final encryption array includes the following steps: Merge the encryption matrices and convert them into decimal arrays to obtain a combined encryption matrix; The third random sequence H obtained by the new chaotic sequence is arranged in ascending order, and the combined encryption matrix is ​​scrambled based on the arrangement result to obtain a first ciphertext. The first ciphertext is added to the decimal part obtained after preprocessing the audio data to obtain a final encrypted ciphertext.

8. A voice encryption system based on a memristor neural network and an S-box, characterized in that: include: A preprocessing module is configured to preprocess the acquired audio data to obtain a separated audio sequence matrix corresponding to the audio data, wherein the separated audio sequence matrix includes an integer part and a decimal part; An S-box generation module is configured to generate a chaotic sequence using a memristor neural network chaotic system and generate an S-box through calculation; A chaotic sequence generation module is configured to adjust MNN parameters of the memristor neural network chaotic system to generate multiple new chaotic sequences; The confusion diffusion module is configured to use the new chaotic sequence to perform S-box replacement and XOR operation, encrypt and diffuse the integer part data of the audio sequence matrix, and obtain an encrypted matrix; The ciphertext generation module is configured to merge the encryption matrices, perform index permutation processing, and add the decimal array obtained after preprocessing the audio data to obtain the final encrypted ciphertext.

9. An electronic device, characterized in that: It comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the voice encryption method based on a memristor neural network and an S-box as described in any one of claims 1 to 7 are completed.

10. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the steps of the voice encryption method based on a memristor neural network and an S-box as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Audio data encryption method based on chaotic sequence and cosine mapping

    CN120074792A