Keywords

1 Introduction

In modern era every computer is connected virtually, so data security becomes main concern of modern life. Cryptography is an important aspect for secure communication to protect important data, so network security is the most important topic of researchers [15].

The proposed technique is a symmetric key cryptography and it is termed as FRSM where the plain text is considered as a stream of binary bits. The input bit stream chopped dynamically into manageable size of blocks such that bits of each block fitted into an even ordered square matrix. Bit positions are shifted to generate the cipher text using the concept of frame rotation of that square matrix. A session key is generated for one time use in a session of transmission using the information of block sizes. The plain text can be regenerated from the cipher text using the session key information during decryption.

Section 2 describes the proposed technique along with the algorithms for encryption, decryption and key generation. Section 3 explains FRSM with an example and Sect. 4 contains the results and analysis. Conclusions are drawn in Sect. 5.

2 Technique

FRSM consider the plain text as a stream of finite number of binary bits. This bit stream is chopped dynamically into blocks with variable sizes. The block size information of any particular session generates the session key. During encryption the bits of the blocks are taken MSB (Most Significant Bit) to LSB (Least Significant Bit) to fit row-wise into an even order (2n × 2n) square matrix. Any square matrix of order 2n can be imagine as n number of square frames where inner most frame is denoted as frame 1 and outer most frame as frame n. Frame k contains 4(2k − 1) number of cells. Cells of each kth frame are shifted by circular fashion along clock-wise direction by k positions. After rotation bits are taken from the square matrix row-wise to form the encrypted block. Cipher text is generated from these encrypted blocks. For decryption the cipher text is considered as a stream of binary bits. Processing the session key the binary bits are sliced into desired sized blocks. The bits of the blocks are taken MSB to LSB to fit row-wise into a square matrix of order 2n. Cells of kth frame of that matrix are shifted circularly along anti clock-wise direction by k positions. Now bits are collected from the square matrix row-wise to form decrypted blocks. Plain text is regenerated from decrypted blocks.

Sections 2.1, 2.2 and 2.3 explain encryption algorithm, decryption algorithm and generation of session key respectively.

2.1 Encryption Algorithm

  • Input: Source stream i.e. plaintext.

  • Output: Encrypted stream i.e. ciphertext.

  • Method: The process takes binary stream and generates encrypted bit stream through a combination of S-Box and P-Box operations.

    1. STEP 1:

      The plain text i.e. the input file is considered as a stream of finite number of binary bits.

    2. STEP 2:

      This binary string chopped dynamically into manageable-sized blocks with different lengths like 4/16/64/144/256/400/… [(4n) 2 for n = 1/2, 1, 2, 3, 4, 5,] as follows:First n 1 no. of bits is considered as x 1 no. of blocks with block length y 1 where n 1  = x 1 * y 1 . Next n 2 no. of bits is considered as x 2 no. of blocks with block length y 2 where n 2  = x 2  * y 2 and so on. Finally n m no. of bits is considered as x m no. of blocks with block length y m (=4) where n m  = x m * y m . So no padding is required.

    3. STEP 3:

      Square matrix of order √y (=2n) is generated for each block of length y. The binary bits of the block are taken from MSB to LSB to fit row-wise into this square matrix.

    4. STEP 4:

      Any square matrix of even order (say 2n × 2n) can be imagine as n number of square frames like frame 1, frame 2, frame 3, ….., frame n where inner most frame is denoted as frame 1 and outer most frame as frame n. Frame k contains total 4(2k − 1) number of cells. Cells of frame k are shifted by circular fashion along clockwise direction by k positions.

    5. STEP 5:

      Bits are taken row-wise from the square matrix to generate the encrypted block of length y.

    6. STEP 6:

      The cipher text is formed converting the encrypted binary string into corresponding characters.

2.2 Decryption Algorithm

  • Input: Encrypted stream i.e. ciphertext and session key.

  • Output: Source stream i.e. plaintext.

  • Method: Process takes encrypted binary stream and generates source stream.

  1. STEP 1:

    The cipher text is considered as a stream of binary bits.

  2. STEP 2:

    Processing the session key information, this binary string breaks into manageable-sized blocks.

  3. STEP 3:

    Square matrix of order √y (2n) is generated for each block of length y. The binary bits of the block are taken from MSB to LSB to fit row-wise into this square matrix.

  4. STEP 4:

    Any square matrix of even order (say 2n × 2n) can be imagine as n number of square frames like frame 1, frame 2, frame 3, …, frame n where inner most frame is denoted as frame 1 and outer most frame as frame n. Frame k contains total 4(2 k1) number of cells. Cells of each frame, say kth frame, are shifted by circular fashion along anti-clockwise direction by k positions.

  5. STEP 5:

    The decrypted binary string is generated taking the bits row-wise from the square matrix.

  6. STEP 6:

    The plain text is regenerated converting the decrypted binary string into corresponding characters.

2.3 Generation of Session Key

FRSM generates a session key for one time use in a particular session of transmission to ensure more security. The input binary bit stream is divided into 16 portions where 1st portion contains 20 % of total file size, 2nd portion contains 20 % of remaining file size and so on. Each portion is divided into x no. of blocks with block length y (=4n * n). The bits of this block are fitted into an even ordered (2n) square matrix where value of n is selected dynamically for first fifteen portions. Finally last (i.e. 16th) portion is divided into x16 no. of block with block length 4 bits (i.e. y16 = 4) and we generate 2 × 2 order matrix. So no padding is required. Total length of the input binary string is  \( = {\text{x}}_{1} *{\text{y}}_{1} + {\text{x}}_{2} *{\text{y}}_{2} + \cdots + {\text{x}}_{{16}} *{\text{y}}_{{16}} \). The value of n for each portion is stored as a character in the key file. So the key file contains fifteen characters.

3 FRSM with an Example

To illustrate FRSM, let us consider the word “Ma”. The bit representation of the above word is ‘0100110101100001’ which are taken from MSB to LSB into a block of length 16. Bits of the block fit row-wise into an even order (=4) square matrix. So matrix is imagined as two square frames, frame 1 and frame 2. Cells of frame 1 and frame 2 are shifted by circular fashion along clock wise direction by one and two positions respectively. Now bits are taken row-wise to form the encrypted binary string. Two 8 bit binary numbers ‘01010110’ and ‘01000101’ are formed from the above encrypted string. The corresponding equivalent decimal values are 86 (≅character ‘V’) and 69 (≅character ‘E’) respectively. So the word “Ma” is encrypted as “VE”. Figure 1 shows the flow diagram of FRSM with the input word “Ma”.

Fig. 1
figure 1

Flow diagram of FRSM with the input word “Ma”

4 Results and Analysis

The comparative study between Triple-DES (168 bits), AES (128 bits) and the proposed technique FRSM has done on twenty files of twelve different types with file sizes varying from 50 bytes to 137 MB (approx.). Results are generated for analysis and comparison of Encryption and Decryption times (in Sect. 4.1), Avalanche, Strict Avalanche and Bit Independence values (in Sect. 4.2), Chi-square values (in Sect. 4.3) and Character frequencies (in Sect. 4.4).

4.1 Analysis of Encryption and Decryption Times

Time taken is the difference between processor clock ticks at the starting and at the end of execution. The lower time indicates the higher speed of execution of the technique. Encryption and decryption times (in milliseconds) of different files calculated for Triple-DES (168 bits), AES (128 bits) and FRSM. Figures 2 and 3 show the graphical representation of encryption and decryption times against the input files respectively. Techniques AES and FRSM take near same time to encrypt and decrypt the files where as TDES takes maximum time for both. In both the figures, the slopes of the curves for TDES are higher for larger source files.

Fig. 2
figure 2

Graphical representation of encryption times against file sizes in logarithmic scale

Fig. 3
figure 3

Graphical representation of decryption times against file sizes in logarithmic scale

4.2 Avalanche, Strict Avalanche and Bit Independence Values

Avalanche, Strict Avalanche and Bit Independence are cryptographic tests which measures the degree of security of cryptographic technique. The bit changes among encrypted bytes for a single bit change in the original message sequence for the entire or a relative large number of bytes. The values of Avalanche, Strict Avalanche and Bit Independence closer to 1.0 indicate the high degree of security. Table 1 shows the Avalanche, Strict Avalanche and Bit Independence values for all three techniques. For maximum files, all three measures using TDES, AES and FRSM are very near equal to 1. This analysis may indicate that FRSM provides very good security.

Table 1 Avalanche and strict avalanche values for TDES, AES and FRSM

4.3 Chi-square Values for Non-homogeneity Test

The large Chi-square values (compared with tabulated values) may confirm the high degree of non-homogeneity between the source and the encrypted streams. Table 2 shows the Chi-square values using Triple-DES (168 bits), AES (128 bits) and proposed FRSM. Average Chi-square values of all twenty files using TDES, AES and FRSM are 34,143,114,516, 32,603,653,699 and 33,190,935,529 respectively. It may indicates the security of FRSM be good and comparable with that of TDES and AES.

Table 2 Chi-square values using TDES, AES and FRSM

4.4 Character Frequencies Test

Analysis of Character frequencies for text file (serial number of file is 4) has been performed for TDES, AES and proposed FRSM. Figure 4a shows the spectrum of frequency distribution of characters in the plain text. Figure 4b–d show the spectrums of frequency distribution of encrypted characters in cipher text using TDES, AES and FRSM. In encrypted files, all characters with ASCII values ranging from 0 to 255 appear with certain frequencies. Therefore it is very difficult to detect the actual message for a cryptanalyst. It may indicate that the degree of security of proposed FRSM is very high and is comparable with that of TDES and AES.

Fig. 4
figure 4

a Graphical representation of the spectrum of frequency distribution of characters for source file. b Graphical representation of the spectrum of frequency distribution of characters for encrypted file using TDES. c Graphical representation of the spectrum of frequency distribution of characters for encrypted file using AES. d Graphical representation of the spectrum of frequency distribution of characters for encrypted file using FRSM

5 Conclusion

The proposed FRSM is simple to understand and easy to implement using various high level languages. The performance of FRSM is quite satisfactory because of high processing speed and the degree of security of FRSM may at par with other standard techniques like Triple DES and AES. So the proposed FRSM technique is comparable with the standard available encryption techniques and it is applicable to ensure good security in message transmission of any form through communication network.