Keywords

1 Introduction

Nowadays, Internet dependency is widely increased for most of the applications such as email communication, ecommerce, social media. Due to this, all the respective tasks have become easier for human. At the same time, the security issues with respect to these applications have extensively increased. In order to protect the information during network communication, one of the important sciences is referred to as cryptography. Cryptography has been used to hide the secret text or to encrypt the secret text from readable to unintelligible form. In terms of cryptography, the secret text is named as plaintext and the unintelligible form is called as ciphertext. To ensure the security of secret messages, the encryption process needs to be more complex so that the cryptanalysts are unable to decrypt the plaintext.

Cryptography techniques are formally divided into two different categories: (1) private key cryptography and (2) public-key cryptography. Various traditional cryptographic techniques were introduced such as Vernam cipher method, stream cipher cryptosystem, fast and secure stream cipher, RC4 stream cipher. However, these techniques are not very secure. There are some other known private and public-key cryptography algorithms such as data encryption standard (DES), triple DES, advanced encryption standard (AES), Diffie–Hellman key exchange algorithm, and RSA. Though the security level of this algorithm is high, however, the estimated time for converting plaintext to secret text is quite large due to its high complexity. In order to diminish these limitations, many researchers have introduced a nature and socio-based optimization techniques such as genetic algorithm (GA) [1,2,3,4], particle swarm optimization (PSO) [5, 6], ant colony optimization (ACO) [7] in various cipher methods [8, 9].

Formerly, GA was implemented by Coppersmith [1] using end-to-end security mechanism incorporated with threshold cryptography and Diffie–Hellman key exchange method to avoid the mobile network nodes. GA provides robust security to validate the nodes entering into the network. GA was also provided to break the mono-alphabetic substitution cipher [3] and to make the network more secure so that the cryptanalyst does not alter the original information/facts. Cryptanalyst can easily decode the information as they know well which ciphertext will be suited to decrypt the information. Therefore, Paul et al. [2] utilized GA incorporated with crossover and mutation which assist to make new ciphertext. Similar GA approach was implemented by Sindhuja and Devi [4] using symmetric key encryption technique for encryption and decryption. Sreelaja and Paib (2009) presented a distributed and decentralized swarm intelligence and ACO [10] approach for encryption. The data encryption standard (DES) was used in PSO to identify the plaintext from ciphertext [6]. This approach was based on two outputs such as particle best and error best, whereas the optimal solution is obtained by identifying the least error. Similar to these techniques, an emerging socio-inspired cohort intelligence (CI) algorithm incorporated with cipher method using the practice of mathematics and computer science is applied to encrypt the secret message. The CI algorithm was proposed by Kulkarni et al. [11] and successfully validated in health care and logistics [12], discrete and mixed variable from truss structure and design engineering domain [13], steganography [14], traveling salesman problem (TSP) [15], and various work domains. Though CI has been applied and validated in different engineering domain [16], however, it is untouched to information security domain yet. Thus, an effort has been put to apply and validate CI in this area which motivated us to develop a new cryptography algorithm.

There are totally four sections proposed in this paper. The organization of this paper is as follows: Proposed work is given in Sect. 2, Results and analysis are done in Sect. 3, conclusion and future scope are mentioned in Sect. 4, and references are written at the end.

2 Proposed Work

In this paper, a novel cryptography algorithm is proposed which is based on a socio-inspired optimization algorithm, i.e., cohort intelligence (CI). The main idea of this algorithm is based on a cohort. Cohort refers to the number of candidates competing with each other to improvise their own behavior. Each candidate is having their own abilities or potentials. During competition, each candidate tries to adapt the few qualities of other candidates or itself to make themselves as a better candidate which enables the cohort to improve its overall behavior. Though CI algorithm is validated to solve different test problems and real-world datasets, however, this algorithm is not applied yet in the information security domain especially in cryptography. Cryptography is one of the important sciences in information security which converts the secret text referred to as plaintext to the transformed text referred to as ciphertext. This is useful to make the secret text secure from different cryptanalysis attacks. There are many cryptographic algorithms available such as advanced encryption standard (AES), data encryption standard (DES), triple DES, Blowfish. AES is found more secure than the other mentioned methods; however, this algorithm is more complex and is dependent upon the number of rounds. Also, the computation time is very large to convert the plaintext to ciphertext. Due to this motivation, CI has been considered for this proposed work. The objective function of the proposed work is selected as the time function as:

$$ f\left( t \right) = t $$
(1)

The flowchart of proposed work is presented in Fig. 1, and it is explained in the following steps.

Fig. 1
figure 1

Ciphertext generation using cohort intelligence algorithm

  • Step 1: Accept the secret text. For example:

    • Secret text: “Cryptography”

  • Step 2: Each character is converted into binary digits such as if the first character of the secret text, i.e., “C” is considered, the binary digits are: 01000011

  • Step 3: Since there are 8 bits in every character, the following pair of bits are united to make a decimal number. For example:

    1. (i)

      First and third pair bits: (00);

    2. (ii)

      Second and fourth pair bits: (10);

    3. (iii)

      Fifth and seventh pair bits: (01);

    4. (iv)

      Sixth and eighth pair bits: (01);

  • Step 4: The respective pair of bits are converted into decimal numbers. Thus, totally four decimal numbers are generated. As referred to step 3, the decimal numbers are:

    • 0 2 1 1.

  • Step 5: In this step, the CI algorithm is applied which considers the cohort as a group of four numbers of candidates. These numbers of candidates are represented as an identity matrix and its different forms. As discussed in Step 4, the total evaluated decimal numbers are 4 for each character; thus, the dimension for each candidate is also considered as 4. The number of matrices by using \( 4 \times 4 \) dimension by considering each pair of bits is \( 4!{\text{i}} . {\text{e}} . 64 \). In order for experimental purpose, we have considered totally four candidates in this paper which are referred to as \( B_{1} \left( {i,j} \right), B_{2} \left( {i,j} \right), B_{3} \left( {i,j} \right), B_{4} \left( {i,j} \right) \) where i denotes the number of rows from 0 to 3 and j denotes the number of columns from 0 to 3. The quality of each candidate is considered as the row number where the matrix value is 1, and it is replaced with the column number to identify the cipher decimal value. For example: \( {\text{if}}\,B\left( {0,2} \right) = 1 \), then 2 is replaced for the decimal number 0. Thus, each decimal number is having its corresponding value when it passes through different matrices. This helps to generate four different ciphertexts. In order to find the optimized ciphertext, the time function \( f\left( t \right) \) is evaluated every time. One should always have less evaluation time to process this algorithm and to convert the plaintext into ciphertext. Since we have applied the same process for four different candidates, there will be four different evaluation time. To get the optimized one, the following points are considered:

  1. a.

    Let us consider the computation time for the secret text to be converted it to ciphertext is \( t1,t2,t3\,{\text{and}}\,t4 \).

  2. b.

    Calculate the probability for computation time for each candidate; i.e.,

$$ \begin{aligned} p_{1} = \frac{t1}{t1 + t2 + t3 + t4},p_{2} = \frac{t2}{t1 + t2 + t3 + t4}, \hfill \\ p_{3} = \frac{t3}{t1 + t2 + t3 + t4},\,{\text{and}}\,p_{4} = \frac{t4}{t1 + t2 + t3 + t4} \hfill \\ \end{aligned} $$
(2)
  1. c.

    Calculate the cumulative probability.

  2. d.

    Apply Roulette wheel approach to evaluate the candidate to be followed by other candidate.

  3. e.

    To adapt the quality of the candidates, a random number from 1 to 4 is generated with respect to every candidate. This number designates the row of the following candidate to be replaced with the same row of the candidate being followed. This enables to generate a new cohort with 4 new candidates and each candidate may have different qualities.

  4. f.

    The same process from step a. to step e. will be repeated till 100 times unless the saturation condition is reached. The total number of 20 runs is considered for experimental purpose.

  5. g.

    The saturation condition exists where no further improvement in qualities of the candidate is identified.

Results and discussions are done in the next section. The size of the secret text and time is considered in the result section.

3 Results Analysis

Results are described in this section. The proposed work was coded in MATLAB (R2011b), and the simulations were run on Windows platform using an Intel(R) Core(TM)2Duo, 2.93 GHz processor speed, and 4 GB RAM. Time analysis with respect to the size of secret text is completed. Totally four cases are considered to capture the minimum time/optimize time taken by the candidate. Also, the total number of function evaluations and the total number of iterations of saturation condition are evaluated for a single run. Totally 20 runs are considered in the proposed work as described in the previous section. Based on the size of secret text, we have considered four cases, i.e., Case 1 for 48 bytes, Case 2 for 264 bytes, Case 3 for 480 bytes, and Case 4 for 3280 bytes. Table 1 depicted the analysis of the obtained solution with respect to evaluated parameters. We have considered five parameters for analyzing our solution. These parameters are standard deviation, minimum time, maximum time, average time, and standard deviation of function evaluations. We could see in Table 1 that the values are increased as we enlarge the secret text size for the different cases. The values against the parameters are considered with respect to 20 runs. These parameters are minimum time, iteration number on which the candidates are converged, and the number of function evaluations. As we could see from Table 1 that the standard deviation of time taken to convert 48 bytes of string (Case 1), i.e., plaintext to cipher text, using CI is quite less and the standard deviation of function evaluation is also 94.72753 which indicates that the proposed method is pretty fast. If we increase the size of secret text from 48 to 264 bytes, Case 2 is considered. We could observe that the standard deviation of time taken from Case 1 to Case 2 is decreased from 0.000227 to 0.00017. The calculated standard deviation for Case 3 is 0.000603, and the standard deviation of function evaluations is increased from Case 2 to 124.5473. Again, the secret text size is increased to 3280 bytes to see the change in the previous cases, and it is observed that the standard deviation of time taken and standard deviation of function evaluations are increased than the previous cases; however, this increment is not very substantial. Convergence plots are also considered and shown for each case as shown in the plot section.

Table 1 Result analysis of obtained solution

Plots are also captured against each case as shown from Figs. 2, 3, 4, and 5. As shown in each plot, two dimensions are considered. X-axis describes the total number of iterations, and Y-axis describes the time taken. In every plot, the converged value of iteration and its corresponding captured time could be seen. In Figs. 2, 3, 4, and 5, one could observe that as we increase the size of the secret text, the encryption time also gets increased.

Fig. 2
figure 2

Convergence plot for optimum solution 48 byte

Fig. 3
figure 3

Convergence plot for optimum solution 264 byte

Fig. 4
figure 4

Convergence plot for optimum solution 480 byte

Fig. 5
figure 5

Convergence plot for optimum solution 3280 byte

4 Conclusion and Future Scope

Due to its results as shown in the previous section, the computation time of the proposed work is very less. Even if we increase the size of the secret text to 3280 bytes, the evaluated parameters are found better than the other similar type of algorithms. Also, this method is found very secure because cryptanalyst needs to identify the optimized matrix as well as the optimized secret bits which makes the entire algorithm more secure. However, the combination of this algorithm and the other existing algorithms can also be tried to make the algorithm more secure and complex. This opens a new door for researchers to work in this direction.