Abstract
Accelerated adventures in computer Science and technology has made digital technology, a need of the day. Academicians, researchers, and technologists are anxious to share their secret data through the communication channel along with its security. The security of data, transmission rate, and error correction capability are the fundamental questions against the data transmission through any algebraic code dependent communication channel. Though, data security is always questioned due to the synchronized encoding and decoding algorithms. In this paper, a novel approach is developed to ensure the data security issues occurred due to synchronized encoding-decoding of a BCH code and for data transmission, a computational technique is designed by which data can be encoded and transmitted by using Field-Linear BCH code or a Ring-Linear BCH code of the same dimension, designed distance and code length. Although the Ring-Linear BCH code is preferable for encoding, on the other hand decoding of data is adept by Field-Linear BCH code. Accordingly, a computational technique of Barlekamp Massey Algorithm is utilized for the purpose. This scheme provides a quick code selection of the desired level of transmission rate and error correction capability during the communication. Thus, it also addresses the dimension issue of primitive BCH code. In addition, for the data security perspective we utilize a BCH code in round key addition and mixed column matrix steps in AES algorithm and then put on this modified AES algorithm to image encryption. The image encryption quality permits to incorporate this alteration in AES.
Introduction
The vital role of digital technology in academic and daily life like online banking, blue tooth, twitter, WhatsApp, Facebook, mobile communication and many social and business accounts has made it a very important subject of the day. For the security of digital data and data recovery, we use cryptography and error correcting codes. Cryptography is the science of protecting the information in computer systems and theory of coding is the science of correcting errors which occur during transmission through the noisy channel. At this time, cryptography has played a vital role in information security, embedded system design, the usage of mobile communication and the internet. Moreover, it is incorporating steps in wide-ranging areas. The number of its users are increasing besides unauthorized users applying the technique to fetch the data. Here the problem of data security arises. To handle such conditions, the data is encrypted with the technique, incomprehensible for the unauthorized user by using error correcting code.
Error correcting codes are very useful to secure the data transmission, particularly the BCH codes [21].
Designing BCH codes, we used the mathematical structures of a Galois field and a Galois ring.
The linear codes over the finite rings have been explained in a sequence of papers by Blake [1, 2]. He introduced the concepts of the BCH codes and special kind of BCH codes which are Reed-Solomon codes, over arbitrary integer residue modulo rings. Spiegel [3, 4] presented that codes over the finite local ring can be defined in terms of codes over the finite field. In continuation, through a
Data can be transferred via any of the scheme of BCH codes over Galois ring or Galois field. This selection of a coding scheme is based on the choice of better code rate or better error correction capability of the selected BCH code. The dimension of two classes of primitive BCH codes are addressed in [21], but in this paper, we calculate computationally the dimension of any length primitive BCH codes. A list of dimensions of the BCH codes are explained in Table 1. The narrow-sense primitive BCH codes form the well-studied subclass of BCH codes, which have been examined in a series of literature, including [8–22]. The reader is referred to [13] for an association between primitive and non-primitive BCH codes. For fast transmission the high code rate is required, however, we can choose the fixed length of the code and optimal error correction capability by changing the designed distance.
For the data security viewpoint, we exploit a BCH code in round key addition and mixed column matrix steps in AES algorithm and then pretend this modified AES algorithm to image encryption. The image encryption quality certificates to include this modification in AES.
This paper is organized as follows: In Section 2, a brief overview of the Galois ring, Galois field, and construction of maximal cyclic subgroup of the group of units of a Galois ring is discussed. In Section 3, an explanation of the special type of the BCH codes through the Galois ring is given, moreover encoding of BCH codes over Galois ring with the computational approach is explained. The dimension of primitive BCH code is also explained in this section. In Section 4, a novel approach to the decoding of BCH codes over Galois field by using Barlekamp-Massey algorithm in computational way is explained. Decoding procedure with the flow chart and pseudo code is explained. Also, the description of Barlekamp-Massey algorithm with the help of example is assured. In Section 5, BCH codes are utilized in Mix column matrix and round key addition steps of the AES algorithm. In Section 6, the application of BCH codes in image encryption and analyses of image encryption technique with comparison to the original AES algorithm are explained. Consequently, Section 7 concludes the findings and future work opportunities. References are presented at the end of the paper.
Maximal cyclic subgroup of the group of units of Galois ring
Unit elements
Let R be a ring with the unity which is commutative. An element u ∈ R is unit if there exists an element v ∈ R such that u · v = 1, here 1 is an identity in R.
Local ring
Let R be a commutative ring with the unity is said to be the local ring if and only if it’s all non-unit elements form an abelian group under addition. For instance, Galois ring is a local ring.
Zero divisors
Let R be a commutative ring with unity. A non-zero element r1 ∈ R is a zero divisor if there exists a non-zero element r2 ∈ R such that r1 · r2 = 0
Basic irreducible polynomial
Let R be a commutative local ring with unity and M be the maximal ideal of R. A polynomial f (x) ∈ R [x] over R is called basic irreducible polynomial if it is an irreducible polynomial over the corresponding field
Galois ring and Galois field
Let
The following theorem is taken from [5, Theorem 2].
Theorem
Let R* be the multiplicative group of units, it has only one maximal cyclic subgroup whose order is relatively prime to p. This cyclic subgroup has order p m - 1.
Example
Let f (x) =1 + x + x3 be the basic irreducible polynomial over
This implies that G7 ={ 1, β, β2, β3, β4, β5, β6 } and all these elements are roots of x7 - 1 modulo 8. If we construct maximal cyclic subgroup of the highest order, then it is a very difficult and time-consuming process to construct manually, so for this problem we have developed an algorithm to find the maximal cyclic subgroup of any finite order and further utilize this maximal cyclic subgroup in the construction of the BCH codes. Our purposed algorithm gives us a very fast calculation of the maximal cyclic subgroup. Nowadays it has many applications in the field of cryptography and coding theory.
Encoding of BCH codes over Galois ring
BCH codes can detect and correct multiple errors.
It is a generalized form of Hamming code. RS (Reed Solomon) codes are a subclass of BCH codes. RS codes are non-binary cyclic codes. Nowadays BCH codes have too many applications in disk drives, satellite communication, compact disk player, DVDs, and two-dimensional bar codes. According to the paper [22], BCH codes are better than RS codes under the binary environment in Rayleigh Fading Communication Channel.
The encoding of BCH codes is used for secure data transmission through the communication channel. The construction of a BCH code in the Galois ring GR (p
k
, m) is same as to the BCH code in GF (p, m) which is explained in [5]. Assume that a BCH code with parameters c, d, n, q, where all these parameters are positive integers such that 2 ≤ d ≤ n with gcd(n, q) =1 where q is power of some prime p and n = p
m
- 1, m is the degree of basic irreducible polynomial f (x) in
If there is mis correction during transmission of the data, then we change the length of BCH code or design distance and select the optimal code for transmission of data which corrects multiple errors. Every detectable error need not be corrected so for this purpose, we select those BCH codes which correct most errors. Table 1 shows the parameters of BCH Codes. In this table dimension of BCH codes are given against different length of primitive BCH code. If we choose a large length of BCH codes, then it corrects multiple errors, but the transmission will be very slow. So, we select the feasible length of code which corrects at most errors with the fast transmission of the data.
Parameters of BCH Codes over GF (2
m
)
Parameters of BCH Codes over GF (2 m )
Let p (x) = x8 + x4 + x3 + x2 + 1 be the basic irreducible polynomial over
Elements of Maximal cyclic subgroup of order 255
Elements of Maximal cyclic subgroup of order 255
By taking LCM of all the minimal polynomials using the maximal cyclic subgroup G255, we get generator polynomial of the BCH code with parameters [255, 9, 33]. Its vectorial form is as under.
This generator polynomial generates a BCH code of 255 length with designed distance 120 over Galois ring GR (8, 8). If we want to construct the BCH codes over Galois field GF (28) then just take modulo 2 to the coefficients of generator polynomial over the Galois field.
Its vectorial form is as under.
Now we can find simply dimension of BCH codes over Galois field with the support of the degree of the generator polynomial. So, the dimension of BCH codes of length 255 over Galois field with designed distance δ = 120 is, k = 255 - 246 = 9 over GF (28). Similarly we can find the dimension of primitive BCH code of any length by using degree of generator polynomial. It is very challenging to construct BCH codes of the large length over Galois ring and Galois field manually so for this problem, we develop an algorithm which reduces the human effort. Our proposed algorithm also gives the dimension of BCH codes over Galois field, corresponding to any designed distance. So, another goal is completed. The dimension of the code gives us, how much length of message can be sent through encoder. If we have sent a k length message through a noisy channel, then attach n - k parity check digits or redundant digits to each block to obtain n length code word. Now the code word can be send through the noisy channel then there are two possibilities in transmitted code word either received word is code word or not, if the received word is not code word then during transmission there must be an error occurred and then receiver request to the transmitter that the word would be retransmitted after correction the error but if the received word is code word then there is no error occur. It is noted that error correction capabilities of word is less than or equal to the error detection. For secure data transmission we encode the message through encoder of BCH code.
By using 2.7 example, suppose we want to find the generator polynomial of BCH code over Galois ring GR (8, 3) for designed distance δ = 4. So, for this construct the minimal polynomial for β I where i = 1, 2, 3. Since β, β2, β4 has the same minimal polynomial so, hence, vectorial form of minimal polynomial is,m1 = 1657
Now β3, β6, β5 have same minimal polynomial so hence its vectorial form is m1 = 1327
Therefore, g = 1111111 is vectorial form of generator polynomial of BCH code corresponding to Galois ring GR (8, 3).
Transmission of message
Now suppose that we want to send message m = 10 to intelligence agency through encoder of Galois ring GR (8, 3) with designed distance δ = 4. For transmission of the data, firstly we encode the message. So, code polynomial is c (x) = m (x) g (x), c = 1111111 this code word can be sent through communication channel. Now if we want to transmit this message 1111111 instead of 10 through communication channel during transmission error may be occurring then we apply decoder of BCH code to correct the errors. Flow chart of the encoding of BCH Codes over Galois ring is given in Fig. 1.

Flow chart of construction of BCH codes over galois ring.
If code word c (x) = c0 + c1x + c2x2 + … + cn-1X-1 is sent through noisy channel, then let error e(x) occurs during transmission so the received code polynomial is r (x) = c (x) + e (x) = r0 + r1x + r2x2 + … rn-1x-1 .
To decode this received polynomial first we find the syndromes by formula S i = r (ξ i ) here i = 1, 2, 3, …, 2t.
Since c (x) is code word so c (ξ i ) =0 therefore, S i = r (ξ i ) = e (ξ i ).
Suppose that e (x) = x11 + x12 + … + x1
ν
here 0 ≤ l1 < l2 < l3 < … l
ν
< n, S1 = r (ξ1) = e (ξ1) = ξ11 + ξ12 + … ξ1
ν
, here ν denotes the errors introduced by the channel.
Here ξ11, ξ12, ξ13, …, + ξ1 ν are unknowns, any method for solving these equations and find the unknowns is called decoding algorithm for BCH codes.
If we find ξ11, ξ12, ξ13, …, + ξ1 ν then powers l1, l2, … , lν denotes the error positions in the received message.
Suppose for simplification γk = ξ
jk
be the error location numbers, here 1 ≤ k ≤ ν.
Now we define error locator polynomial as,
Here the coefficients of x are elementary symmetric functions we defined as,
Remark
The inverses of roots of σ(x) are error location numbers.
We can relate elementary symmetric functions with the syndromes by using the Newton identities as follows,
We decode any received message over Galois field is as follows,
Step 1. Find the syndromes from received polynomial.
Step 2. Calculate Error locator polynomial σ (x).
Step 3. Find error location numbers by finding the inverses of roots of σ (x).
Step 4. Correct the errors.
Our main step is to calculate σ (x) and this can be calculated by Barlekamp Massey (BM) algorithm.
This is a very fast decoding algorithm and it is used for binary and non-binary BCH codes. We start this algorithm by following initial conditions as shown in Table 3.
BM Algorithm
BM Algorithm
Here d μ is nth discrepancy, l μ is the degree of σ μ (x), S1 is first nonzero syndrome, t is error correction capability. The following steps are performed to calculate error locator polynomial (σ2t (x).
Step 1. If d μ = 0 then σμ+1 (x) = σ μ (x) and lμ+1 = l μ .
Step 2. If d μ ≠ 0 then find m < μ such that d m ≠ 0 and m - l m has largest value in last column of the table then,
and
Step 3. To find discrepancy, use formula
After finding the σ2t (X), calculate the roots of this polynomial and take inverses of those roots, we call it error location numbers and powers of the error location numbers shows error positions in received code. To correct these errors, subtract error vector from received vector. If wants to find the message word, then divide corrected code word by generator polynomial g (x).
Suppose that [7, 4] BCH code generated by g (x) = x6 + x5 + x4 + x3 + x2 + x + 1 and a code word c = 1111111 is sent through the channel. Suppose that the error occurs during transmission and received vector is r = 1101111. We want to find the error in this received vector and then determine corrected code word also find the message word.
Here n = 7, k = 2, d = 4 so t = [(d - 1)/2)] = [(4 - 1)/2)] =1 and
First, we construct Galois field for decoding of BCH codes.
Step 1:
Calculate syndromes by using the formula S i = r (α i ) here i = 1, 2, 3.
S1 = r (α) =1 + α + α3 + α4 + α5 + α6 mod (1 +α + α3) = α2 (from the elements of Galois field)
S2 = r (α2) = α2 + α = α4
S3 = r (α3) = α2 + 1 = α6
Step 2:
Now we use Barlekamp Massey Algorithm to find error locator polynomial σ (x) σ (x).
This algorithm starts with following initial conditions,
In this Algorithm we use the following formulas,
lμ+1 = max(lμ, lm + μ - m)
To find σ1 (x) put μ = 0 and m = -1 in formula (1).
Also put n = 0 and m = -1 in formula (2) then
Now find d1 = ?
Put μ = 0 in formula (2) we get,
Since d1 = 0 so σ2 (x) = σ1 (x) and l2 = l1 this implies that σ2 (x) =1 + α2x and l2 = 1.
Now we find d2 = ? ?
Put μ = 1 in formula (2) then
Now the required error locator polynomial is shown in the last row of the Table 4.
BM Algorithm
BM Algorithm
Hence, σ2t (x) = σ2 (x) =1 + α2x is the error locating polynomial.
Step 3: Find the roots of error locating polynomial by substituting the non-zero elements of Galois field, here Galois field is GF (23) so by substituting α, α2, α3, α4, α5, α6, α7 we get α5 as a root of error locator polynomial. Now to find the error location number we take inverses of this roots so (α5) -1 = α2 this implies that α2 is the error location numbers and power 2 shows that error position in received vector. The error vector is e (x) = x2.
Step 4: The corrected code polynomial is
c (x) = r (x) - e (x), so
c = 1111111 is corrected code word.
To find message word divide the corrected code polynomial by generated polynomial,
This implies that u = 10 is original message word of k = 2 length which was transmitted after encoding through noisy channel. It is very difficult and time-consuming process to encode message over Galois ring and decode our message of large length manually. So, for this problem we develop an algorithm with the help of computer language C# which gives us output without human effort. Our proposed algorithm gives the fast transmission of data to the communication channel. Existing software Magma and MATLAB works for some small length of BCH code over Galois field and Galois ring, but this novel scheme gives transmission of data through Galois ring and recovers data through Galois field with the computational approach. For encoding the message, we use Galois ring and for decoding the received message we used Galois field. The pseudo codes of Barlekamp Massey decoding algorithm are explained in algorithm1, algorithm2, algorithm3 and flow chart of algorithms are displayed in Fig. 2,

Flow chart of decoding of BCH codes using barlekamp massey algorithm.
In AES algorithm, mixed column matrix is an MDS (maximum distance separable) matrix which is constructed using Galois field GF (28). We also constructed in our article BCH codes over Galois field GF (28) So, we utilize BCH codes in the construction of mixed column matrix. That’s why we choose AES.
AES algorithm consists of four steps, Substitute byte Shift Rows Mix Columns Add Round Keys
We modified the AES algorithm with the help of BCH codes have the following steps.
Step 1. Convert 128 bits of data into 16 data bytes and write these 16 bytes in a 4 * 4 state matrix.
Step 2. The generator polynomial of BCH code is used as a round key. This key is served as the secret key and the current state matrix is XOR with this key in each add round key step.
Step 3. Now the entries of the current state matrix are substituted with the S-box entries.
Step 4: Then perform the circular shift on each row of the current state matrix. Row 0 is shifted 0 byte left, row 1 is shifted 1 byte left, row 2 is shifted 2 bytes left and row 3 shifted 3 bytes left and so on.
Step 5: Now the current state matrix is multiplied with the mix column matrix which is constructed by using the BCH code. The multiplication is modulo multiplication with respect to the corresponding Galois field.
Step 2 to Step 5 comprises a round. Repeat these steps ten times for AES-128 encryption results for image data. We call this proposed scheme is AES-C.
Construction of round keys by using BCH codes
By using the proposed algorithm of encoding of BCH codes over Galois ring and Galois field we construct generator polynomial of BCH codes in example 3.1 with parameters [n = 255, k = 9, δ = 120] as follows, the coefficients of generator polynomials are,
Take 128-bits from these coefficients as a key which is used as a round key in AES algorithm.
10011110 11101000 10100001 00100000 11110010 11001010 01001010 11111011 00010011 01101100 11111100 01011011 10001110 11111110 10011100 00101111
In decimal form: 158 232 161 32 242 202 74 251 19 108 252 91 142 254 156 47
Construction of mixed column matrix using BCH Code
By using proposed scheme of BCH code, we construct the mixed column matrix for AES algorithm. Then this matrix is used for security of image data. Matrix A is the mix column matrix which is constructed with the help of example 3.1 over BCH code [n = 255, k = 9, δ = 120].
This mixed column matrix creates diffusion in the AES algorithm. Using our newly designed matrix A and Key in AES algorithm in the image encryption scheme, we observe better results for the security of image data as compared to the original AES algorithm. The analyses of the quality of proposed scheme are explained in the next step. For this, we apply different attacks on encrypted image quality.
Statistical analyses of image encryption
Texture, along with color, is one of the most advantageous features of material defining the look of its surface. The modest analysis is stimulating as it is established to be related to the way the human visual system perceives texture, a very first line to texture, and it is broadly used in image segmentation. By this process is possible to compute, among others, five features which are proposed to describe texture: Contrast, Homogeneity, Correlation, Energy and Entropy.
Contrast
Contrast is a measure used to classify objects in an image. A strong encryption method produces a high level of contrast. It is the difference in color or in luminance that makes an object distinguishable. It is determined by the difference in brightness and color of the object and other objects within the same field of view.
Correlation
For encryption effect of the proposed method, we perform correlation analysis on both the plain and the encrypted images. It is quite clear that for efficient encryption, the correlation of the encrypted image should be reduced as compared to the plain image. The correlation coefficient is given by,
Energy
In this analysis, we measure the energy of the encrypted images as processed by various S-boxes. This measure gives the sum of squared elements in the gray level co-occurrence matrix ∑i,jp (i, j) 2, Where p (i, j) is the number of gray-level co-occurrence matrices. Energy describes the quality of encryption.
Homogeneity
Gray level co-occurrence matrix (GLCM) shows the ability of arrangements of pixel brightness results in tabular form. The closeness of the distribution in the (GLCM) to its diagonal is measured through the homogeneity analysis. If the homogeneity is small as much possible then encryption is better.
Entropy
Entropy is a statistical measure of randomness that can be used to characterize the texture of the image. Entropy is defined as
Application of BCH Code in image encryption
Now we utilize the modified AES-C for the image encryption scheme. Figure 3 shows that original Lena image, Figs. 4, and 5 shows encrypted image by original AES and modified AES-C respectively. From Figs. 4 & 5 and Table 5, it is analyzed that, the encrypted image by AES-C is better than encrypted image by AES. The detail is explained in next section.

Original lena image.

Image by AES.

Image by AES-C.
Statistical analyses of 256 × 256 Lena ciphered image under AES and AES-C
The statistical analyses of encrypted Lena image by using original AES algorithm and proposed algorithm
AES-C are shown in Table 5.
The Table 5 shows that the comparison of encryption technique with original AES algorithm and proposed AES algorithm (AES-C) for three different channels (Red, Green, Blue). The results of proposed scheme AES-C are better in each channel because correlation and energy are close to zero in each case as compared original AES algorithm and homogeneity by the proposed scheme (AES-C) is decreases in each channel. If Contrast is greater then it means that image encryption quality is strong. It is observed that contrast is greater by AES-C as compared to original AES algorithm in each channel, and the most important part of the quality of image encryption technique is an entropy, in each channel proposed AES-C gives entropy close to 8 which give high security of our secret image. it is concluded that the proposed scheme is better as compared to the original AES algorithm. Using this scheme, we encrypt the image then send it through a channel by using BCH codes over Galois ring and channel may be noisy, so the error may occur during transmission so for this problem we used computational scheme of BCH codes over Galois field which corrects errors during transmission. We apply the encoding scheme to each block of 128 bits of pixels of the encrypted image and then decode the received vector by using the computational technique of Barlekamp Massey Algorithm. If data loss during the transmission then decoder of BCH code corrects the error, so this causes high security to the data. It means that if there is an error in encrypted data during transmission then there is no secure decryption. So, for this purpose we apply decoder of BCH codes which corrects the errors in encrypted data and then we can decrypt the data and attain original message.
Histogram analyses
An image histogram illustrates how pixels in an image are distributed by graphing the number of pixels at each color intensity level. The histogram of the encrypted image is uniform and significantly different from the respective histograms of the original image and hence does not provide any clue to employ any statistical attack on the proposed image encryption.
Figure 6 Shows that the histogram analyses of original and encrypted image by proposed encryption algorithm (AES-C) through different channels (Red, Green, Blue). The histogram analyses show that the histogram of the ciphered image is uniform and is significantly different from the original image. The encryption algorithm has covered up all the characters of the plain image and has complicated the statistical relationship between the plain image and its ciphered version. So, from the histogram and statistical analyses, we conclude that our proposed encryption scheme is better than as compared to the original AES algorithm.

Histogram through RGB (Red, Green, Blue) channel.
The following are the outcomes of the study, The link between two types of BCH codes over Galois ring and Galois field is developed computationally in such a way that the data can be transmitted through either by BCH codes over Galois ring or BCH codes over Galois field. Then a transmitted code can be decoded using the computational approach of Barlekamp Massey algorithm for Galois field-based BCH code. The number of codewords in the BCH code over Galois ring is greater than the BCH code over the Galois field. Therefore, we, have a variety of messages that can be transmitted through the communication channel. We can correct maximum errors of BCH codes computationally by changing the designed distance in the input algorithm because the minimum distance is always greater than or equal to designed distance. Our proposed algorithm gives the faster output of Barlekamp Massey algorithm. It is a convenient technique to use for encoding and decoding the messages. This novel approach gives us generator polynomial of BCH codes over Galois ring of each degree as desired without human effort which can be used for the security of data. With the proposed computational technique, construction of generator polynomial of BCH code also gives the dimension of the code, so another goal is achieved. We modified the AES algorithm using the BCH codes which gives better results of image encryption scheme and enhance the security level. Hence, with the help of different tests, it is concluded that our proposed scheme gives better image encryption results as compared to the original AES algorithm. In future we can use this scheme for video, audio and text encryption and Security can be increased by BCH codes if we use different MDS (maximum distance separable) matrices which are constructed over BCH codes for each round in mixed column operation step of AES-C algorithm. This will create more diffusion in the proposed algorithm.
