Audio Encryption Using Noble Prime Numbers (NPN)

 
 

NPNs can be used to encrypt audio files. Encryption process consists of three steps. First step is to find the right NPN by taking into consideration of data size in the audio file. Second is to select the NPN whose data will be mixed. Third step is to rotate the data by a number less than the current NPN. The resulting mix then is written to the target file. Below there is a detailed explanation. Note that this study is in basic form. One should use this method to develop a new and strong encryption algorithm.

 

 

ENCODE Process

     1. Between 811 and 3259 there are 136 NPNs. Using the audio file size the best NPN is selected. After that NPN is used to mix a p size array.

     2. Mixed array is rotated starting the k 'th element.

 

Example Mixing Process

            1.  

Selected noble prime number is 19. A is the original array and contains some characters.

                       

A=

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

A

B

C

D

E

F

G

H

I

J

K

L

M

N

P

Q

R

S

T

 

 

 

 

 


                     

                    

           1 mod 19 = {1,10,5,12,6,3,11,15,17,18,9,14,7,13,16,8,4,2,1}   (s)

 

  Using (s) constructed mixing array is     {1,10,5,12,6,3,11,15,17,18,9,14,7,13,16,8,4,2,19}

 

                         Mixed array A is : {A,J,E,L,F,C,K,P,R,S,I,N,G,M,Q,H,D,B,T}

 

            2.

                   Then rotation position is selected. Here it's 9

                   We can say . So 9 is selected for rotation.

                         Rotated array A  = {S,I,N,G,M,Q,H,D,B,T,A,J,E,L,F,C,K,P,R}   

 

            Rotated array A is the encrypted array.

 

 

 

DECODE Process

The inverse of encode process is done. first back-rotate process and than back-mix process is done. At the end original data is constructed.      

 

 

            Used variables:

                Asil[] : Contains NPNs.

                 src[] : Source file name.

                 dst[] : Target file name.

             Asil_2[] : Contains selected NPN's residual numbers. This will be used in mix and back-mix process.

                 inD[] : Original data array.

               mix1[] : Contains mixed data in encode process.

               mix2[] : Contains rotated data in encode process.

               copy[] : in the end of audio file there can be data that doesn't exactly fit the inD array.
          Asil_Asal : Number of
NPNs in array Asil[]. In this program it is 136.

                    as :  Selected NPN.

                d_len :  Data size in the audio file.

 

 

 

The Algorithm

 

 

 

 

 

 

 

 

 

 

 


C Source Code

 

Because the source code is too long, you better download it from here and binary from here.

 

Example wave file is here.

Encrypted wave file is here.

 

 
Copyright by Chasan Chouse