0% found this document useful (0 votes)
47 views

Image Encryption Based On AES Stream Cipher in Counter Mode

The document discusses image encryption using AES in Counter (CTR) mode. It proposes using AES-CTR with an initialization vector (IV) for image encryption. AES-CTR has advantages like being easy to implement, supporting parallelization, and only requiring the AES encryption operation for both encryption and decryption. It also discusses using linear feedback shift registers (LFSRs) to modify the AES algorithm and generate pseudo-random numbers to improve security. The paper aims to develop software for image encryption using AES-CTR mode with an explicit IV and LFSRs.

Uploaded by

ReferatScoala
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Image Encryption Based On AES Stream Cipher in Counter Mode

The document discusses image encryption using AES in Counter (CTR) mode. It proposes using AES-CTR with an initialization vector (IV) for image encryption. AES-CTR has advantages like being easy to implement, supporting parallelization, and only requiring the AES encryption operation for both encryption and decryption. It also discusses using linear feedback shift registers (LFSRs) to modify the AES algorithm and generate pseudo-random numbers to improve security. The paper aims to develop software for image encryption using AES-CTR mode with an explicit IV and LFSRs.

Uploaded by

ReferatScoala
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Image Encryption based on AES Stream Cipher in Counter Mode

May Thet Khaing, Zin May Aye


University of Computer Studies (Mawlamyine)
[email protected], [email protected]

Abstract Encryption consists of 10 rounds of processing for


128 bit keys, 12 rounds for 192 bit keys, and 14
With the first evolution of digital data rounds for 256 bit keys.
exchange, information security is becoming more Counter mode is a symmetric-key
important in data storage and transmission. Because encryption scheme based on any block cipher, e.g.,
of widely using images in industrial process, it is AES. CTR mode is encrypted and XORed with
important to protect the confidential image data from plaintext to produce cipher text. In CTR mode, there
unauthorized access. In this paper, we intend to is no feedback and preprocessing can be used, in
develop software based image encryption system by some environments, to increase speed. With CTR
applying AES in Counter Mode (AES-CTR) with an mode, both encryption and decryption depend only
explicit initialization vector (IV). IV generation on encryption.
includes incrementing a counter for each packet and AES-CTR has many properties that make it
linear feedback shift registers (LFSRs). AES-CTR attractive encryption algorithm for in high-speed
uses the AES block cipher to create stream cipher. networking. AES-CTR is easy to implement and can
AES-CTR uses the only AES encrypt operation for be pipelined and parallelized. AES-CTR uses the
both encryption and decryption, making AES-CTR only AES encrypt operation.
implementations smaller than implementations of LFSR is used to modify the AES algorithm.
many other AES modes. It is an attractive encryption LFSR can be easily implemented in hardware or
algorithm for high-speed networking and improving software and is used to create a pseudo-random
the security of images from unauthorized access. sequence of numbers for many different applications.
This paper is organized as follows: Section
Keywords: Advanced Encryption Standard (AES), 2 summarizes the related work in image encryption
Counter (CTR) Mode, Image, Initialization Vector using AES in CTR mode. In Section 3, the
(IV), Linear Feedback Shift Register (LFSR) background theory is explained. Section 4 presents
the implementation of image encryption system. The
last section; Section 5 is the conclusion.
1. Introduction

Today, The World of Information 2. Related Work


Technology is needed to be secure data and
information. Cryptography is a method of storing and Housley [5] described the use of AES-CTR
transmitting data in a form that only those it is with an explicit initialization vector, as an IPSec
intended for can read and process. It is a science of Encapsulating Security Payload (ESP) confidentiality
protecting information by encoding it into an mechanism.
unreadable format. Cryptography has symmetric and Zeghid et al. [9] analyzed the AES, and
asymmetric techniques. Symmetric key algorithms added a key steam generator (A5/W7) to AES to
can be divided into stream cipher and block cipher. ensure improving the encryption performance;
Stream ciphers encrypt the bits of the message one at mainly for images characterized by reduced entropy.
a time, and block ciphers take a number of bits and The implementation of both techniques has been
encrypt them as a single unit. realized for experimental purposes.
Security is an important issue in Mcgrew [8] described Counter Mode and its
communication and storage of images, and security properties, reviewing relevant cryptographic
encryption is one of the ways to ensure security. attacks and system security aspects. This mode is
Image encryption techniques try to convert an image well understood and can be implemented securely.
to another one that is hard to understand. Image However, Mcgrew shows that attacks using
encryption has applications in internet precomputation can be used to lower the security
communication, multimedia systems, medical level of AES-128 CTR below the recommended
imaging, telemedicine, military communication, etc. strength for ciphers if the initial counter value is
AES is very fast symmetric block algorithm predictable.
especially by hardware implementation [4]. AES is
one of the most popular algorithms used in 3. Background Theory
symmetric key cryptography. AES allows for three
different key lengths: 128, 192 or 256 bits.
In this section, brief discussions about  ShiftRows – a transposition step where each
cryptography, AES and Counter Mode operation are row of the state is shifted cyclically a certain
presented. number of steps.
 MixColumns – a mixing operation which
3.1 Advanced Encryption Standard operates on the columns of the state, combining
the four bytes in each column using a linear
AES is an encryption standard adopted by transformation.
the U.S.government. Encryption is the process of The last round for encryption does not involve
transforming the information to insure its security. the “MixColumns” step. The encryption flow starts
AES is a symmetric key block cipher algorithm with the addition of the initial key to the plaintext.
standardized by the U.S. National Institute of Then the iteration continues for (Nr - 1) rounds (Nr
Standard and Technologies (NIST) [1]. AES has a being the total number of rounds). In last round, the
fixed block size of 128 bits and a key size of 128, MixColumn step is bypassed as shown in Figure 1.
192 or 256 bits. With AES both the encryption and
the decryption are performed using the same key. 3.2 Counter Mode (CTR)
This is called a symmetric encryption algorithm.
Encryption consists of 10 rounds for 128 bit keys, 12 CTR mode is a symmetric-key encryption
rounds for 192 bit keys, and 14 rounds for 256 bit scheme based on any block cipher, e.g. AES [6]. It is
keys. Each round consists of several processing useful for sending secret data without preserved data
steps, including one that depends on the encryption integrity. CTR mode has a proven-tight security and
key. AES operates on a 4×4 array of bytes. Each it enables the simultaneous processing of multiple
round consists of four basic operations Subbytes, blocks without losing the feedback mode advantages.
Shiftrows, Mixcolumns and Addroundkey. It also gives the advantage of allowing the use of
similar hardware for both encryption and decryption
[3]. In the CTR mode, the block cipher is used to
encrypt a counter value which is incremented for
successive encryptions. The encrypted counter values
makeup a keystream which is XORed with the
plaintext bits to produce the cipher text bits [7]. In
CTR mode, there is no feedback. Counter mode
encryption and decryption are shown in Figure 2.

(a) CTR encryption

(b) CTR decryption


Figure1: Block Diagram of AES Encryption
Figure 2: Counter Mode Encryption and
Process
Decryption
 AddRoundKey - each byte of the state is CTR mode has significant implementation
combined with the round key; each round key is advantages as follows:
derived from the cipher key using a key
 Software efficiency: By eliminating the
schedule.
computational dependency between Ci and Cj,
 SubBytes – a non-linear substitution step where CTR mode encryption enables effective
each byte is replaced with another according to a utilization of aggressive pipelining, multiple
lookup table. instruction dispatch per clock cycle, a large
number of registers, and SIMD instructions.
 Hardware efficiency: CTR model is fully bm  cm1bm1  c2b2  c1b1  c0b0 c0  0 (2)
parallelizable. One can be computing blocks C1;
C2… all at the same time, limited only by the
amount of hardware that one throws at the Figure 3 shows illustration of an LFSR. An
problem. LFSR has a maximum period of 2m-1 if it has an
 Preprocessing: Preprocessing can be used in even number of cells and the characteristic
some environments, to increase speed. That is, polynomial is a primitive polynomial.
one can compute the pad in “spare cycles,” even
before one knows the plaintext M. When M is 4. Implementation of Image Encryption
known, it is XORed with the already-computed System
pad.
 Random-access: The ith cipher text block, Ci , can In this section, the main process of image
be encrypted in a random-access fashion. In encryption system is described. This process has two
hard-disk encryption, this is important because phases: the encryption and the decryption.
bulk data needs to be encrypted quickly. When
using CBC mode, properly encrypting the ith 4.1 Encryption Process of Sender Side
block requires one to first encrypt the i - 1 prior
block. In Figure 4, the user has to select input
original image to encrypt. And then the color pixels
3.3 Linear Feedback Shift Register of image are transformed into the binary data to
obtain binary formats. Then, this binary format is
Today LFSR’s are present in nearly every encrypted with encryption keys to obtain cipher
coding scheme as they produce sequences with good image.
statistical properties, and they can be easily analyzed.
LFSR is a shift register. A LFSR with a well-chosen
feedback function can produce a sequence of bits
which appears random in nature and which has a
very long cycle [2].

Figure 3: Illustration of LFSR


Figure 4: Encryption Process of Sender
Side
This system uses 128 bit AES encryption
algorithm so it is needed to generate 128 bit LFSR Csharp language provides random function
key. To overcome the Key Distribution Problem in for the generation of the IV. AES key is randomly
AES, LFSR random key stream generator is applied generated from LFSR are applied in the encryption
to secure the key. We will use LFSR key to encrypt process.
the image file. A linear feedback shift register After the encryption process is completed,
(LFSR) sequence is a pseudo-random sequence of the cipher, IV and AES key are saved into the user
numbers that is often created in a hardware specified place. Then, the user can send cipher, IV
implementation of a linear feedback shift register. and AES key to the receiver.
Equation (1) is the linear function of LFSR where bm
is a linear function of b0, b1 …b m-1.

bm  cm1bm1  ...  c2b2  c1b1  c0b0 c0  0 (1)

However, we are dealing with binary digits


because the multiplication and addition are in the GF
(2) field, so the value of ci is either 1 or 0, but c0
should be 1 to get a feedback from the output. The Figure 5: Original Image
Equation (2) provides exclusive-or operation in
LFSR. In other words, it can be written as
This system, input image can be JPEG, In the decryption process, the receiver
PNG, and GIF format. The original input image is decrypts his/her receive cipher to obtain original
shown in Figure 5. image. To decrypt the cipher, the receiver must use
his/her receive keys (AES key and IV). And then the
receiver receives the decrypted image with binary
format. Finally, this binary format is transformed into
the color format to have original image.

Figure 6: Extract Color Pixels Value of


Image

Figure 6 depicts the color pixels value


extracted from the received image.

Figure 7: Initializing Key Generator LFSR


Figure 10: Decryption Process of Receiver
and IV
Side
For attaining better key security, key
In receiver side (Figure 10), the receiver
generator LFSR is employed for AES key and IV for decrypts all the cipher image, IV and AES key. Then,
CTR. Figure 7 describes the key generation from the
he/she needs to decrypt all encrypted data and image
LFSR.
using the appropriate procedure. Finally, the receiver
can view the original image (Figure 11) sent by the
sender.

Figure 8: Convert Color Pixels to


Binary Format

The resulting RGB colors are changed into Figure 11: Decrypted image
byte format as shown in Figure 8. As soon as, the
image is encrypted, the cipher image appears on the 5. Conclusion
screen. Then, the cipher image (Figure 9), IV and
AES key are ready to be sent to the receiver through In this paper, images are encrypted by using
insecure channel. AES stream cipher in counter mode. AES is fast in
both hardware and software, and requires little
memory. The AES is extended to support key stream
generator for image encryption. The key stream
generator has an important influence on the
encryption performance. AES-CTR can provide high
performance confidentiality. AES-CTR mode is
applied in this system because it can be parallelized
and pipelined in encryption process for it has the
Figure 9: Encrypted Image advantage of better performance rather than using
other modes.

4.2 Decryption Process of Receiver Side


References
[1] National Institute of Standards and
Technology, “Announcing the Advanced
Encryption Standard (AES)”, FIPS PUB 197,
Nov 2001.
[2] Doshi N. A., Dhobale S. B., and Kakade S.
R, “ LFSR Counter Implementation in CMOS
VLSI”. World Academy of Science,
Engineering and Technology 48 2008
[3] F. Charot1, E. Yahya2, and C.Wagner1,
“Efficient Modular-Pipelined AES
Implementation in Counter Mode on ALTERA
FPGA”, France.
[4] K.Janvinen, M.Tominisko, J.Skytta, "A fully
pipelined memorlyess 17, 8 Gpbs AES-128
encryptor", in International symposium of
Field programmable Gate arrays, 2003,
pp.207-215.
[5] R.Housley, “Using Advanced Encryption
Standard (AES) Counter Mode With IPSec
Encapsulating Security Payload (ESP)”.
Request for Comments 3868, Network
Working Group, Standard Track, January
2004.
[6] W. S. HsienHsin, “High Efficiency Counter
Mode Security Architecture via Prediction and
Precomputation”. School of Electrical and
Collage of Computing, Georgia Institute of
Technology, Atlanta, GA 30332

[7] C. Mathur, “A Mathematical Framework for


Combining Error Correction and Encryption”.
STEVENS INSTITUTE OF TECHNOLOGY,
Castle Point on Hudson, Hoboken, NJ 07030,
2007.
[8] D. A. McGrew, “Counter Mode Security:
Analysis and Recommendations”. Cisco
Systems, Inc. November 15, 2002.
[9] M. Zeghid, M. Machhout, L. Khriji, A.
Baganne, and R. Tourki, “A Modified AES
Based Algorithm for Image Encryption”.
Proceeding of world ACADEMY of science,
engineering and technology volume 21 May
2007 ISSN 1307-6884.

You might also like