Novel Implementation of Audio Encryption Using Pseudorandom Byte Generator

: In this paper, we present an algorithm for encrypting audio ﬁles based on the Ikeda map, a mathematical function of chaos theory. Detailed experimental, security and theoretical analysis is provided on the proposed algorithm using histogram analysis, using different measurements including the signal-to-noise ratio, the peak signal-to-noise ratio, the number of samples change rate and the correlation coefﬁcient. The provided results show a highly secure and strong algorithm against different types of attacks.


Introduction
The fast revolution in communication we are currently experiencing needs faster and more secure means of ensuring the security of audio messages. Nowadays, when everybody has smart-phone in their pocket and at any time has the opportunity to send a different message such as a text or audio message, it is very important to have better options to be more protected. Such fast-paced development is a big challenge when there are many different ways to attack audio data. Audio encryption has applications in online networks, interactive media and healthcare audio systems. Audio files are often larger than image files and common encryption methods such as RSA [1], AES (Rijndael) [2] and Blowfish [3] may not be directly applicable to audio files. The above algorithms require more time and resources when the file is bigger, which makes them inapplicable for audio encryption.
In this paper, our focus is on the encryption of wave audio files. Audio encryption refers to the coding of user data in an audio file. The waveform audio file enjoys the benefits of being a famous uncompressed audio file format, developed by IBM and Microsoft. It is a variant of the resource interchange file format (RIFF) and shares its container-based, tagged file structure. The wave file stores the audio recordings with different sampling rates and bitrates in a single container which consists of two sub-containers: the header part and actual sample data part. By using logical XOR, byte audio samples are encrypted with pseudorandom sequences.
Because of the resistance of the growing number of statistical attack methods, the use of chaotic maps in encryption schemes is becoming increasingly popular. The chaotic dynamical system includes deterministic systems that exhibit random-like, unpredictable behaviour as a result of their sensitivity depending on the starting values. In Reference [4], a novel audio signal encryption algorithm based on a combination of three chaotic maps was presented. In [5], four different voice signals with different running times were sampled and their values were permuted using the chaotic logistic function and the permuted numbers were further separated into four parts to present the novel audio encryption scheme. The use of chaotic functions and DNA coding to confuse and diffuse audio files was presented in [6]. In [7], a novel compressing sensing-based function to simultaneously compress and encrypt audio files was presented. Novel audio encryption with extensive cryptographic analysis was proposed in [8]. In Reference [9], a novel audio encryption scheme based on the Henon-Tent chaotic pseudo-random number array was proposed.
In Reference [10], a noise-tolerant audio encryption technique designed by the application of the S 8 symmetric group and chaotic systems was proposed. Steps for audio signal encryption based on the chaotic Henon map were designed in [11]. In [12], a novel threedimensional chaotic system was proposed for the audio encryption algorithm. Researchers in [13] proposed an algorithm for determining the maximum number of bits that can be used as the generator of a pseudo-random number output including chaos-based functions. In Reference [14], the authors proposed an efficient speech encryption method based on three-dimensional chaotic maps. In [15], the authors presented an audio encryption algorithm using confusion and diffusion based on multi-scroll chaotic function.
The motivation of our research was the ever-growing need for more sophisticated and robust encryption due to the evolution of PCs and network technologies. There is a widespread common belief that the chaos-based encryption set of rules allows to reduce the relation among audio content by increasing the cost of the entropy of the encrypted audio as well as lowering the correlation.
In our opinion, the main contributions of our paper can be summarised as follows: • We applied the pseudo-random number generator based on the Ikeda map [16] to a novel audio encryption scheme; • We examined the proposed algorithm and the results show that it has a very good sample change rate number, desirable signal-to-noise and peak signal-to-noise ratios as well as strong key sensitivity that is able to resist most common theoretical and statistical attacks; • We allow ourselves to make the assumption that the proposed audio encryption is suitable for ensuring the security of different byte-oriented multimedia sources such as images and video files.
In Section 2, we present a well-known pseudo-random byte output generator based on the chaotic Ikeda map. In Section 3, we introduced the novel safe and efficient audio encryption using the chaotic Ikeda map and complete security analysis is given in Section 4. Finally, the paper is concluded in Section 5.

Ikeda Map Used as a Basis for a Pseudo-Random Generator
The main idea is to include the Ikeda map [17,18] in the audio file encryption algorithm, as its behaviour can generate close to random values [16].

Description of the Ikeda Map
The two-dimensional Ikeda map can be calculated using the following equations: where u is parameter and: The Ikeda attractor exists when u ≥ 0.6, as shown in Figure 1. Its bifurcation diagram (in the classical way with respect to parameter c 3 [19]) is shown in Figure 2. This diagram allows us to discover the existence of a period doubling cascade to chaos. The diagram of the Lyapunov exponent (LE) [20] is plotted in Figure 3. It can be seen that the highest value of the LE is 0.18947. One can choose initial values in the interval [−0.5, 1.5].   The chaotic functions realised on a software program will always show dynamical degradation [21]. With respect to [22,23], we designed a pseudorandom byte generator based on two Ikeda functions with a different parameter u, combined with the logical XOR function. All program experiments described in this paper were carried out with double precision IEEE floating-point numbers [24]. It is possible to replace the XOR with feedback with a carry shift register (FCSR) which will randomly switch the Ikeda functions' output values.

Description of the Pseudo-Random Byte Algorithm
The pseudo-random byte generator includes five steps [16]: The initial values and parameters forming the key set for the two Ikeda functions were obtained-x 1,0 , y 1,0 , x 2,0 , y 2,0 , u 1 and u 2 ; 2.
More than 100 iterations of the Ikeda maps were made without retrieving any results; 3.
The work of the algorithm continues with more iterations of the Ikeda maps to calculate and post-process the four real values-x 1,i , y 1,i , x 2,i , y 2,i . They are calculated as follows: where integer(z) returns the integer part of z-truncating the value at the decimal point-abs(z) returns the absolute value of z, and mod(z, w) returns the reminder after division; 4.
Output byte s i is generated when XOR operations are performed between a, b, c, and d: Perform Step 3 until the output stream is reached.
Theoretical and statistical tests were performed to determine the cryptographic security of the proposed generator and can be found in [16].

Novel Implementation of Audio Encryption Scheme
Audio encryption algorithm using the pseudo-random byte algorithm described above is presented in this section.

Proposed Encryption and Decryption Algorithm
These are the steps describing the audio encryption algorithm: 1.
In file A', the header bytes of a input audio file A are moved without cryptographic modifications; 2.
Using logical XOR operation with the same amount of bytes as the bytes in the sample produced by the pseudo-random generator described above the bytes in the sample are encrypted; 3.
Encrypted sample from Step 2 is processed into file A'; 4.
Repeat Steps 2-3 until the end of input file A is reached; 5.
The produced output file A' is the final encrypted audio file. For security reasons, we presented a few overall rounds of the audio encryption algorithm.
The decryption scheme is the same as the encryption algorithm because the proposed cryptographic algorithm is symmetric using the same steps and the same key for audio decryption.

Cryptographic Analysis
An important part of the encryption algorithms is their reliability. It is determined by cryptographic analysis. In this section, we present the results of empirical tests performed using proposed audio encryption algorithm described in the previous section.
Using the C++ programming language, the proposed audio encryption method was implemented. All experimental results discussed in the following subsections were taken by using one iteration of the novel technique.
Nine 2-bytes per sample audio files were encrypted for the security tests. The files were randomly selected from the huge collaborative database Freesound, accessed 1 September 2021 (http://freesound.org). The chosen files are currently stored in WAV format with an audio sample rate of 44.1 kHz.

Waveform Plotting
Waveform plotting represents the amplitude of the audio signal distributed in time [25]. Figure 4 shows the wave amplitude of the plain audio files (Figure 4a,c,e) and the wave amplitude of the same files after encryption (Figure 4b,d,f). The compared waves shown in Figure 4 are completely different, as can be seen, which shows the good properties of the proposed scheme for audio encryption. Waveform plotting was performed using MATLAB (R2021b, MathWorks, Natick, MA, USA).

Correlation Analysis
The correlation coefficient between two audio files is a mathematical relationship between groups of values [26]. To calculate the relationship between audio information between the primary and the encrypted file, it is necessary to compare the values of both files by working with the samples. The correlation coefficient represents the level of correlation and is always in the range of [−1.0, +1.0]. Proximity to 0.0 is considered as a lack of linear connection.
The correlation coefficient can be calculated as follows: where: cov(x, y) = Sample values of the plain and encrypted files are x i and y i , x and y are the mean values of samples, N is the total number of samples and finally cov(x, y) is covariance between both files.
The correlation coefficient results are shown in Table 1. --0.0000900 AES [27] --0.0097100 The values in Table 1 indicate that there is no relation between the original file and the encrypted file. Compared with similar audio encryption techniques, the proposed one has correlation coefficients values close to the ideal value of 0.0.

Number of Sample Change Rate
The number of the sample change rate (NSCR) is a test that determines the quality of encryption algorithms. The test compares the corresponding original sample values and encrypted audio file and shows the difference in percentage. NSCR can be calculated as follows: where: In Equation (12), corresponding sample values of the plain and encrypted files are x i and y i and the total number of samples is N. The obtained test results are shown in Table 2. The numbers are similar to the results of other audio encryption schemes [5,8,27]. 99.998% Ref. [5] 99.998% Ref. [8] 99.998% Ref. [27] 99.998% AES [27] 99.603%

Signal-to-Noise Ratio
The signal-to-noise ratio (SNR) test is excellent for measuring speech signal intelligibility. SNR measurement sets have precise criteria for measuring the performance of optimal signal processing [28] which can be calculated as follows: where x i and y i are the corresponding sample values from the original audio file and the encrypted audio file, and N is the number of samples.

Peak Signal-to-Noise Ratio
Peak signal-to-noise ratio (PSNR) is another way to compute the power of the clean signal against the power of noise [29]. The PSNR is more commonly used in image encryption algorithms [30] and can be used to test the quality of the proposed encryption scheme in this article. PSNR is calculated as follows: where the maximum possible value of audio stream is MAX. In this case, the maximum value can be 65,535. There is possibly a square error between the plain and encrypted files and this mean square error (MSE) can be computed as follows: The SNR and PSNR values for nine different audio files are represented in Table 3.
In this proposed method, we obtained a negative SNR value which shows that the encrypted files are very noisy and the clear signal is destroyed. As can be seen, PSNR values are small, which means that the encrypted audio files have a very high level of noise. Compared with the other audio encryption schemes [5,8,27], we can see that the proposed scheme has comparable and better SNR and PSNR values.  [5] 33.7464 dB 59.7989 dB Ref. [8] −16.0483 dB 1.4524 dB Ref. [27] −133.0000 dB -AES [27] −1.4461 dB -

Speed Performance
To measure the time required to encrypt, we used audio files of different sizes with hardware configuration-2.00 GHz, Intel(R) Core(TM) i3-6006CPU, Fujitsu, 4 GB RAM, Windows 10. In Table 4, we compare the speed of our method with [5,8,31]. The data show that the proposed audio encryption scheme has a satisfactory speed. The AES cipher takes less time than all other algorithms to encrypt audio files.

Encryption/Decryption Key Sensitivity
Another important characteristic of correlation analysis is the key sensitivity test. A good audio encryption scheme should be sensitive with respect to the secret key, that is, a slight modification of the secret key. We encrypted an audio file with key set 1 and then tried to decrypt it with the very slightly modified key set 2: x 1d = 0.62337047692752, y 1d = 0.7415988807484, x 2d = -0.91983014150675, and y 2d = 0.45066640271424. Figure 5a,b present the original and encrypted file a-strange-dream; Figure 5c presents the decrypted file a-strange-dream with different key, Figure 5d is decrypted with the first key set. The proposed audio scheme demonstrates unsuccessful decryption even with a very similar key set. The right decryption needs the entire and correct knowledge of all of the secret key digit.

Conclusions
This paper presents a new design of the algorithm for audio files encryption. The high quality of the algorithm is proven by the tests which we conducted. The waveform plots of the tested audio files demonstrate the changes between the original files and the encrypted files. The number of the sample change rate test and the correlation coefficient verified that the sample values were completely different in the corresponding files. The peak signal-to-noise ratio values show that the encrypted files have a very high noise level-which means that encrypting the audio destroys the data in the original file. Key sensitivity is very high. An encrypted file can only be restored with the original key set and even with a small change in the keys, the original file cannot be restored. Based on the security analysis performed, we can say that the proposed algorithm has excellent audio encryption properties.

Conflicts of Interest:
The authors declare no conflict of interest.