Vous êtes sur la page 1sur 5

GRD Journals- Global Research and Development Journal for Engineering | Volume 4 | Issue 12 | November 2019

ISSN: 2455-5703

An Analysis of Flipped Cryptographic Block


Cipher Mechanism For Image
Sivasankari Narasimhan
Assistant Professor
Department of Electronics and Communication Engineering
Mepco Schlenk Engineering College, Anna University

Santhosh GJ Venkata Subramanian G


UG Student UG Student
Department of Electronics and Communication Engineering Department of Electronics and Communication Engineering
Mepco Schlenk Engineering College, Anna University Mepco Schlenk Engineering College, Anna University

Abstract
This paper proposes and examines a different encryption algorithm for Cipher Block Chaining mode (CBC) which is designed for
improving the security of a cryptographic algorithm and more resisting cryptanalysis. The size of both block and key are chosen
depending upon the size of the image. The fixed key size will lead to some fuzzy attack, Hence the number of bits in key size is
decided by the size of the plaintext image. The encryption operation is mainly done by flipping. The amount of flipping depends
on the size of the image. The image is divided into four parts, and each part undergone different flipping. This approach makes the
implementation cost less than the current Data Encryption Standard (DES) and Advanced Encryption Standard (AES). The security
analysis process also proves that the proposed algorithm can resist the statistical and differential attacks.
Keywords- Cipher Block Chaining, Mode of Operation, Block Cipher, Entropy, Inversion

I. INTRODUCTION
First, let us discuss the different modes of operation of a block cipher. These are procedural rules for a generic block cipher.
Interestingly, the different modes result in different properties being achieved which add to the security of the underlying block
cipher. Electronic Code Book (ECB) Mode, Cipher Block Chaining (CBC) Mode [4], Cipher Feedback (CFB) [5] Mode, Output
Feedback (OFB) Mode, Counter (CTR) [6] Mode. These different blocks are needed because the information to be transferred is
not upto the fixed number of bits. Some standard algorithms like AES, DES[3] works on 64,128 bits of operation. But the
information to be processed are millions and millions of bits. Hence it is necessary to split them with certain block cipher modes
of operation.
Next let us analyze the advantages and disadvantages of different block cipher modes as per [1]. In electronic codebook
mode, the user takes the first block of plaintext and encrypts it with the key to produce the first block of ciphertext. He then takes
the second block of plaintext and follows the same process with same key and so on so forth. The ECB mode is deterministic, that
is, if plaintext block P1, P2, Pm are encrypted twice under the same key, the output ciphertext blocks produced after encryption
will be the same. In fact, for a given key technically it can be created a codebook of ciphertext for all possible plaintext blocks.
Thus, the operation is analogous to the assignment of code words in a codebook, and hence gets this name.
The operation of CBC mode is portrayed in the following illustration. First the n-bit Initialization Vector (IV) is loaded in register,
and this is XORed with the n-bit plaintext block with data value in register. Then encryption start the result of XOR operation with
underlying block cipher with key K, and this process is continued until all plaintext blocks are processed. For decryption, IV data
is XORed with first ciphertext block decrypted. The first ciphertext block is also fed into to register replacing IV for decrypting
next ciphertext block. But due to avalanche effect of encryption algorithms, the error created in each block is moving further
towards the next blocks.
The operation of CFB mode is processed with the help of shift registers. For example, in the present system, a message
block has a size‘s’ bits where 1 < s < n. The CFB mode requires an initialization vector (IV) as the initial random n-bit input block.
The IV need not be secret. First IV is loaded in the shift register. Then encrypt the data value in top register with underlying block
cipher with key K. The‘s’ number of most significant bits (left bits) of output of encryption is processed and XOR them with‘s’
bit plaintext message block to generate ciphertext block. The ciphertext block is fed into top register by shifting already present
data to the left and continue the operation till all plaintext blocks are processed. This process is continued until the plaintexts are
over. CFB mode is converting a block cipher into a type of stream cipher. The encryption algorithm is used as a key-stream
generator to produce key-stream that is placed in the bottom register. This key stream is then XORed with the plaintext as in case
of stream cipher. In this mode, user decrypts the ciphertext using only the encryption process of the block cipher. The decryption
algorithm of the underlying block cipher is never used. But still the error of transmission gets propagated due to changing of blocks.

All rights reserved by www.grdjournals.com 11


An Analysis of Flipped Cryptographic Block Cipher Mechanism For Image
(GRDJE/ Volume 4 / Issue 12 / 003)

OFB mode involves feeding the successive output blocks from the underlying block cipher back to it. These feedback blocks
provide string of bits to feed the encryption algorithm which act as the key-stream generator as in case of CFB mode. The key
stream generated is XOR-ed with the plaintext blocks. The OFB mode requires an IV as the initial random n-bit input block. The
IV need not be secret.
CTR mode loads the initial counter value in the top register is the same for both the sender and the receiver. It plays the
same role as the IV in CFB (and CBC) mode. The contents of the counter is encrypted with the key and place the result in the
bottom register. The first plaintext block P1 and encrypted key value is XORed with the contents of the bottom register. The result
of this is C1. Similarly the process is continued for further plaintext blocks. The counter value is updated in encryption and
decryption sides. The decryption is the reverse process. The ciphertext block is XORed with the output of encrypted contents of
counter value. After decryption of each ciphertext block counter is updated as in case of encryption.
In this paper it is going to be discussed with flipped encryption in CBC mode and its performance results such as Image
Entropy, Correlation, Number of changing pixel rate (NCPR), Unified averaged changed intensity are analyzed for various images.

II. PROPOSED CIPHER BLOCK CHAINING MODE


A block cipher processes the data blocks of fixed size. Usually, the size of a message is larger than the block size. Hence, the long
message is divided into a series of sequential message blocks, and the cipher operates on these blocks one at a time. Processing of
normal CBC mode is given as per figure 1. Originally it is designed for block ciphers AES, DES

Fig. 1: Cipher block chaining mode

For each blocks, ciphertext is given by


Cj=EK [Cj-1 XOR Pj] (1)
The commonly used block cipher encryption algorithm is DES which uses Feistel cipher functions. Feistel cipher functions mainly
used diffusion and confusion logics that requires more space for operation. Confusion is followed here, the encryption algorithm
is changed as per the quadrants. For first quadrant
EK(pixel)= 255-pixel (2)
For second quadrant EK(pixel)= 127-pixel (3)
For third quadrant EK(pixel)= 63-pixel (4)
For fourth quadrant EK(pixel)= 31-pixel (5)
The decryption operation is followed as per the normal block processing

Fig. 2: CBC block cipher decryption

All rights reserved by www.grdjournals.com 12


An Analysis of Flipped Cryptographic Block Cipher Mechanism For Image
(GRDJE/ Volume 4 / Issue 12 / 003)

DK(Cj) = DK(EK [Cj-1 XOR Pj]) (5)


DK(Cj) = Cj-1 XOR Pj (6)
DK(Cj-1) XOR Cj-1= Cj-1 XOR Cj-1 XOR Pj = Pj (7)
To produce the plaintext Initialization vector is XORed with the first block of plaintext. The IV is a data block that is
same size as cipher block. The IV must be known by both sender and receiver. For obtaining maximum security, the IV should be
protected against unauthorized changes. At first time IV should be sent in Electronic code book Mode encrypted format to the
receiver. If some bits of the IV are changed then the corresponding ciphertext also changed.
With the received bits the image is reconstructed as follows
For first quadrant P1’=DK(pixel)= pixel+255 (8)
For second quadrant P2’= DK(pixel)= pixel+127 (9)
For third quadrant P3’= DK(pixel)= pixel+63 (10)
For fourth quadrant P4’=DK(pixel)= pixel+31 (11)

III. IMPLEMENTATIONS
Our experiments are done using MATLAB 2018a version. The implementation results are shown in figure 3.

Fig. 3: Encryption and decryption of image

The histogram of image is shown in figure 4.

Fig. 4: Image histogram of original and encrypted images

All rights reserved by www.grdjournals.com 13


An Analysis of Flipped Cryptographic Block Cipher Mechanism For Image
(GRDJE/ Volume 4 / Issue 12 / 003)

A. Evaluation Parameters

1) Image Entropy
The encryption algorithm adds extra information to the data so as to make it difficult for the intruder to differentiate between the
original information and the encrypted information. Entropy is defined as
28
H(I) =  P( I i ) log b P( I i ) (12)
i 1
How much entropy is higher, more in formations are present, and hackers cannot find it easily. Image entropy of 0.0003 is obtained.

2) Correlation
Dependency of statistical relationship between two images is said to be correlation. A well designed cipher should not possesses
any relationship with original message.
In our experiment the correlation coefficient is calculated for original fused message and encrypted images. The
correlation coefficient is defined as
cov( x, y )
 x, y  (13)
D( x), D( y )
Where cov(x, y), D(x) and D(y) are covariance and variances of variable x and y directions respectively. For ideal cipher
case γ should be equal to 0 and for the worst case γ will be equal to 1. In our experiment the original image has correlation
coefficient of 0.8831, whereas the encrypted images have 0.6753. Some more parameters defined in [8] are applied for our proposed
algorithm.

3) Number of Changing Pixel Rate (NCPR)


This is the parameter for testing the encryption against differential attacks [7]. As per [2], the range of percentage is [0-100]. When
it is zero it remains that all the pixels are having the same value. Clearly NCPR concentrates on absolute number of pixels which
changes values in differential attacks.

NPCR : N (C 1 , C 2 )  
D(i, j )
x100% (14)
i, j T
Where C1,C2 are the before and after one pixel image in cipher.

0, if C (i, j )  C (i, j )
1 2

D(i, j )    (15)

1, ifC (i, j )  C (i, j ) 
1 2

T denotes the total number of pixels in ciphertext. The average value we obtain for NCPR is 99.95

4) Unified averaged changed intensity (UACI)


UACI concentrates on the averaged difference between two paired ciphertext images.
abs(C 1 (i, j )  C 2 (i, j ))
UACI : U (C 1 , C 2 )   x100% (16)
i, j F .T
Where F is the maximum supported pixel value compatible with the cipher text. In our experiment F is taken as 255. The average
value we obtained from this as 0.0857
The parameters taken for analysis is given in table 1
Correlation NCPR UACI
Correlation
Original Encrypted coefficient Encryption
coefficient
Entropy entropy of time 1 2 3 1 2 3
of original
encrypted
99.8632 0.1501
6.2449 0.0003 0.8831 0.6753 0.000034 s 99.9921 99.9960 0.0547 0.0524

IV. CONCLUSIONS
In this algorithm, a simple encryption method in cipher block chaining method is introduced. Encryption algorithm to do the
operations in a simple manner without the need of S-box is performed for image. Finally the security parameters such as entropy,
correlation, computation time, unified averaged changed intensity, Number of changing pixel rate are calculated. A well-being
analysis shows that the algorithm can effectively resist attacks. Additionally, it provides a running time key selection and high
security. As a future scope, this logic can be implemented for different operating modes and different image encryptions.

All rights reserved by www.grdjournals.com 14


An Analysis of Flipped Cryptographic Block Cipher Mechanism For Image
(GRDJE/ Volume 4 / Issue 12 / 003)

REFERENCES
[1] William Stallings (2005) Cryptography and Network Security (4th Edition) Prentice-Hall, Inc. Upper Saddle River, NJ, USA.
[2] Muhammad Usman, Irfan Ahmedy, M. Imran Aslamy, Shujaat Khanand Usman Ali Shahy (2017), “SIT: A Lightweight Encryption Algorithm for Secure
Internet of Things” International Journal of Advanced Computer Science and Applications, 8(1), pp-1-10. Doi:10.14569/IJACSA.2017.080151.
[3] Author links open overlay panelCai-hongLiuJin-shuiJiZi-longLiu (2013) , Implementation of DES Encryption Arithmetic based on FPGA, AASRI Procedia,
ISSN: 2212-6716, Vol: 5, Page: 209-213,
[4] Y. Huang et al., "Building a block cipher mode of operation with feedback keys," 2013 IEEE International Symposium on Industrial Electronics, Taipei,
2013, pp. 1-4.
[5] R. A. Asmara, A. W. S. B. Johan and R. Ardiansyah, "Cipher feedback mode cryptographic algorithm with gingerbreadman two-dimensional map key
generator on digital image," 2017 11th International Conference on Information & Communication Technology and System (ICTS), Surabaya, 2017, pp. 169-
174.
[6] S. Najjar-Ghabel, S. Yousefi and M. Z. Lighvan, "A high speed implementation counter mode cryptography using hardware parallelism," 2016 Eighth
International Conference on Information and Knowledge Technology (IKT), Hamedan, 2016, pp. 55-60.
[7] https://www.hacking-lab.com/cases/7019-aes-bit-flipping-attack/index.html.
[8] Wu, Yue,(2011) “NPCR and UACI Randomness Tests for Image Encryption” Cyber Journals: Journal of Selected Areas in Telecommunications

All rights reserved by www.grdjournals.com 15

Vous aimerez peut-être aussi