rapid prototyping of aes encryption for wireless ...eprints.uthm.edu.my › 2003 › 1 ›...

5
RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS COMMUNICATION SYSTEM ON FPGA Anurag Gupta 1 , Afandi Ahmad 2 , Mhd Saeed Sharif 1 , and Abbes Amira 3 1 School of Engineering and Design, Brunel University, West London, United Kingdom [email protected], 2 JEC, Faculty of. Elec. and Electronic Eng., Univ. Tun Hussein Onn Malaysia, Johor, Malaysia 3 Nanotechnology and Integrated, Bio-Engineering Centre, University of Ulster, United Kingdom [email protected] ABSTRACT This paper proposes a wireless communication system for secure transmission of data. Bluetooth is used as the wireless communication medium due to its low-cost and low-power consumption features. Advanced encryption standard (AES) protocol is implemented for the security reason over Bluetooth stack. RC10 prototyping board with Xilinx XC3S1500L-4-FG320 device has been used for the hardware evaluation of the system design. The system is configured to capture frames in real-time from the on-board OminiVision 9650 CMOS camera and transmit these frames securely via Bluetooth’s connectivity. On reception, the images are decrypted and displayed on the external monitor. The design has also been demonstrated for edge detection over the wireless communication channel. The overall design is evaluated in terms of resource utilisation and maximum operating frequency. Index TermsAdvanced encryption standard (AES), field programmable gate array (FPGA). 1. INTRODUCTION Bluetooth was developed in the mid 1990’s as a part of a project within Ericsson that required connecting a keyboard to a computer without any cable [1]. The numerous applications of such a setup and the need for low-power, low- cost, short range cable replacement [2], sparked an interest in developing this technology further, which led to the formation of the Bluetooth Special Interest Group (SIG) in 1998 [3]. To date, Bluetooth’s technology has been widely used in various applications for portable devices like personal digital assistant (PDA), laptops, mobiles as well as blood pressure monitor equipment in medical industries. As diverse as the development may seem, secure data transmission over a wireless network for highly confidential applications such as in banking, security and medical industries is one of the biggest trends. Advanced encryption standard (AES) that has been proposed by National Institute of Standards and Technology (NIST) plays a significant role of a secure algorithm for data exchanged. Two prime processes involved: encryption (cipher) and decryption (decipher). Cipher is a process to convert data into unintelligent form called ciphertext. Similarly decipher is a process for the data to be converted back into its original form called paintext. The AES is based on the Rijndael algorithm [4] and it processes data into blocks of 128-bits or 16-bytes and uses keys of length 128, 192, and 256 to encrypt the data. Thus, AES is defined as three types: AES-128, AES-192, and AES-256 depending on the key size [5]. Field programmable gate arrays (FPGAs) with massive parallelism options, multi- million gate counts and special low-power packages makes FPGAs an attractive candidate to embed this technology for wireless communication applications. This research aims at developing a reconfigurable environment for secure data transmission using Bluetooth’s connectivity. An efficient implementation of the AES algorithm has been carried out on the RC10 prototyping board [6] equipped with Spartan-3 FPGA chip. An evaluation of the proposed system to securely transmit and receive of the digital images acquired using the RC10 embedded camera is discussed. A comparative study with other existing implementation of AES algorithm on FPGA devices is also addressed. The rest of the paper is organised as follows. The proposed system implementation is presented in Section 2. Details of the system implementation including the discussion of Bluetooth configuration, AES cipher, decipher, transmitter and receiver implementation is addressed in Section 3. Results and analysis are presented in Section 4. Finally, concluding remarks and future works are given in Section 5

Upload: others

Post on 03-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS ...eprints.uthm.edu.my › 2003 › 1 › Afandi_Ahmad_FKEE_(ISCE2011).pdf · RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS COMMUNICATION

RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS COMMUNICATIONSYSTEM ON FPGA

Anurag Gupta1, Afandi Ahmad 2, Mhd Saeed Sharif 1, and Abbes Amira 3

1School of Engineering and Design, Brunel University, West London, United [email protected],

2 JEC, Faculty of. Elec. and Electronic Eng., Univ. Tun Hussein Onn Malaysia, Johor, Malaysia3Nanotechnology and Integrated, Bio-Engineering Centre, University of Ulster, United Kingdom

[email protected]

ABSTRACT

This paper proposes a wireless communication system forsecure transmission of data. Bluetooth is used as thewireless communication medium due to its low-cost andlow-power consumption features. Advanced encryptionstandard (AES) protocol is implemented for the securityreason over Bluetooth stack. RC10 prototyping board withXilinx XC3S1500L-4-FG320 device has been used for thehardware evaluation of the system design. The system isconfigured to capture frames in real-time from the on-boardOminiVision 9650 CMOS camera and transmit these framessecurely via Bluetooth’s connectivity. On reception, theimages are decrypted and displayed on the external monitor.The design has also been demonstrated for edge detectionover the wireless communication channel. The overall designis evaluated in terms of resource utilisation and maximumoperating frequency.

Index Terms— Advanced encryption standard (AES),field programmable gate array (FPGA).

1. INTRODUCTION

Bluetooth was developed in the mid 1990’s as a part ofa project within Ericsson that required connecting a keyboardto a computer without any cable [1]. The numerousapplications of such a setup and the need for low-power, low-cost, short range cable replacement [2], sparked an interest indeveloping this technology further, which led to the formationof the Bluetooth Special Interest Group (SIG) in 1998 [3].

To date, Bluetooth’s technology has been widely used invarious applications for portable devices like personal digitalassistant (PDA), laptops, mobiles as well as blood pressuremonitor equipment in medical industries. As diverse asthe development may seem, secure data transmission overa wireless network for highly confidential applications suchas in banking, security and medical industries is one of thebiggest trends.

Advanced encryption standard (AES) that has beenproposed by National Institute of Standards and Technology(NIST) plays a significant role of a secure algorithm fordata exchanged. Two prime processes involved: encryption(cipher) and decryption (decipher). Cipher is a processto convert data into unintelligent form called ciphertext.Similarly decipher is a process for the data to be convertedback into its original form called paintext.

The AES is based on the Rijndael algorithm [4] and itprocesses data into blocks of 128-bits or 16-bytes and useskeys of length 128, 192, and 256 to encrypt the data. Thus,AES is defined as three types: AES-128, AES-192, andAES-256 depending on the key size [5]. Field programmablegate arrays (FPGAs) with massive parallelism options, multi-million gate counts and special low-power packages makesFPGAs an attractive candidate to embed this technology forwireless communication applications.

This research aims at developing a reconfigurableenvironment for secure data transmission using Bluetooth’sconnectivity. An efficient implementation of the AESalgorithm has been carried out on the RC10 prototypingboard [6] equipped with Spartan-3 FPGA chip. An evaluationof the proposed system to securely transmit and receiveof the digital images acquired using the RC10 embeddedcamera is discussed. A comparative study with other existingimplementation of AES algorithm on FPGA devices is alsoaddressed.

The rest of the paper is organised as follows. Theproposed system implementation is presented in Section 2.Details of the system implementation including the discussionof Bluetooth configuration, AES cipher, decipher, transmitterand receiver implementation is addressed in Section 3.Results and analysis are presented in Section 4. Finally,concluding remarks and future works are given in Section 5

Page 2: RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS ...eprints.uthm.edu.my › 2003 › 1 › Afandi_Ahmad_FKEE_(ISCE2011).pdf · RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS COMMUNICATION

Camera

Image capture

& encryption

Bluetooth

Host-PC

Transmitter Receiver

FPGA

Image

received &

decryption

FPGA

Bluetooth

VGA output

Host-PC

Fig. 1. Proposed system block diagram.

2. PROPOSED SYSTEM

The system block diagram as shown in Figure 1 is designedto capture and store frames captured by the camera on theRC10 board in real-time into block random access memory(BRAM). AES algorithm is then manipulated to securelytransmit the image via Bluetooth’s connectivity to thereceiver block. After that, the receiver stores the image intoBRAM, decrypts, and writes the pixels on the video graphicsarray (VGA) port, hence the image can be visualised.

To configure the FPGA with corresponding bit streamfiles for the transmitter, receiver and the AES executionthe host application called file transfer utility (FTU) isused. FPGA processes the acquired image and operatesas the base station of the transferred data. In this system,the RC10 prototyping board equipped with Xilinx SpartanXC3S1500L-4-FG-320 FPGA device is used for testing andsystem workability evaluation. Also, the LM058 serial toBluetooth’s adapter is used at both terminals of the transmitterand receiver to establish wireless communication.

3. SYSTEM IMPLEMENTATION

RC10 board

Transmitter

Receiver

Image

transmitted

FTU -

Transmitter

FTU -

Receiver

Bluetooth adapter

Fig. 2. System implementation setup with RC10 FPGAprototyping boards.

To implement the system, Handel-C [6] programminglanguage has been utilised for hardware compilation as wellas efficiently implementing the AES algorithm. Figure 2exhibits the proposed system implementation environmentwith two RC10 rapid prototyping board and Bluetooth’sconnectivity. To establish Bluetooth’s connectivity, class 1RS232-based LM058 adaptor has been used, and it isconfigured to transmit data at 230,400 bits per second (bps).In the following, details of processes involved including AEScipher, decipher, transmitter and receiver will be explained.

3.1. AES Cipher

The AES-128 implementation as depicted in Figure 3 hasbeen implemented on the FPGA. This required an initialround key addition followed by ten rounds of S-Box(),Shift Rows(), Mix Column() and Add RoundKey() transformations, with Mix Column() not beingimplemented for the final round. Each round of encryptionyields the 128-bits of encrypted data. Data to be encryptedhave been stored in flash random access memory (RAM)and results for after each round of encryption have also beenupdated in flash RAM and this process helps in verifying anddemonstrating the accurate working of the AES cipher.

YES

NO

Round = 9

NO

START

Initialise flash index

Read 16 Bytes (State)

Write State to flash

Get Key

Add Key to the State

Write updated State to flash

S-Box ()

Shift Rows ()

Mix Column ()

Key Expansion ()

Add Round Key ()

Flash index ++; Write updated State to flash

Round = 0

Round

++

END

YES

Key Update

Round = 9

Fig. 3. AES cipher design flow.

One of the key features of the proposed designimplementation is that the Key expansion() routine isrun in parallel with Mix Column() routine, since the keyexpansion routine is independent of any transformation

Page 3: RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS ...eprints.uthm.edu.my › 2003 › 1 › Afandi_Ahmad_FKEE_(ISCE2011).pdf · RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS COMMUNICATION

involved in AES. Consequently, this strategy maximises thethroughput as well as eliminates the requirement to store allthe round keys, hence the design consumes less area.

3.2. AES Decipher

Decipher process as shown in Figure 4 is accomplishedby executing the inverse of all the cipher routines. Unlikethe cipher process, the key expansion routine isimplemented before the decipher process starts and all theround keys are stored in look up table (LUT) basedarrays. This is because the round keys are used in thereverse order by the decipher process and also the keyexpansion routine uses the previous round key to generatethe next round key, thus it is needed to store roundkeys for the decryption process.

START

Initialise flash index

Read 16 Bytes (State)

Write State to flash

Key Expansion ()

Add Key to the State

Write updated State to flash

Inv Shift Rows ()

Inv S-Box ()

Mix Column ()

Add Round Key ()

Flash index ++; Write updated State to flash

Round = 10

Round - -

END

NO

YES

YES NO

Note: The key expansion routine is executed

before decryption starts and all the key

schedules are stored in LUT’s based arrays

Round = 1

Round = 1

Fig. 4. AES decipher design flow.

3.3. Transmitter

Pixel stream library that has been developed for DK DesignSuite developer kit has been used to implement the videoprocessing system. A customised BRAM-based frame bufferhas been developed to read pixels from the camera and storethem into BRAM. Once a complete frame has been read, thena flag is initiated to transmit the entire frame via the RS232-based Bluetooth module. A pixel after transmission is erasedfrom the BRAM. Once a complete frame is transmitted,the flag is reset to read the next frame. This enables the

transmission of multiple frames/video in real-time. Therefresh rate for the video is 65 Hz.

The design is also demonstrated for edge detection in real-time. In such a case of 3×3 sobel edge detection is performedon each frame before transmission. One of the limitations ofusing BRAMs as the frame buffer, is that the image resolutionis limited to 640× 480 pixels and each pixel is in a byte sized(YUV format). However, the use of BRAMs is essential tomaintain reasonable throughput and refresh rate for video.

3.4. Receiver

The receiver’s roles are to receive a single frame and storein the BRAM. After that, a flag is initialised to run thecustomised frame buffer that reads the pixels from BRAMand writes them at the VGA port. Once a pixel is written tothe VGA port, it is erased from BRAM. The flag is then resetto receive the next frame. This enables the receiver to receiveand display of multiple frames in real-time.

4. EXPERIMENTAL RESULTS AND ANALYSIS

Table 1 lists the resources used for the proposed system.To illustrate the internal implementation of the FPGA’smapping for AES cipher and decipher, FPGA layout forboth implementations are shown in Figure 5(a) and 5(b),respectively.

For both cipher and decipher implementation, a largenumber of LUT has been occupied due to the LUT-basedimplementation of s-box and inv s-box. An s-boxtable is a 16×16 array of a byte sized elements, hence require512 LUTs to store the tables. This coupled with conditionalaccesses increases the LUT utilisation to compute s-box to900. Decipher process requires both s-box and inverses-box table, thus the LUT utilisation due to the substitutiontable doubles.

The LUT utilisation is further increased for the decipherprocess because all the keys schedules have to be stored inthe LUTs. Apart from this array based state assignmentsand key expansion routine also contribute to the LUTutilisation. The rest of the LUT utilisation is needed forgeneral programming and storing RC10 library files toexecute the design. Moreover, the transmitter and receivermainly use LUTs to store the RC10 header files and pixelstream libraries. Both implementations use BRAM as abuffer to capture, transmit and display images.

The proposed AES implementation has been comparedwith other existing implementation as shown in Table 2.Results obtained demonstrate very competitive results interms of throughput per unit slices. It is worth mentioningthat this is an important performance matrix, as other existingimplementation uses either more slices or BRAMs whichadds to the cost of the design, whilst the proposed systemgives a reasonable throughput with optimum cost.

Page 4: RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS ...eprints.uthm.edu.my › 2003 › 1 › Afandi_Ahmad_FKEE_(ISCE2011).pdf · RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS COMMUNICATION

Table 1. Resources utilisation for the system implementation.

Parameters System Implementation

Resources Transmitter Receiver AES-128-Cipher AES-128-Decipher Transmitter edge detection

No. of slices 13,312 914 314 3,430 5,536 1,816

No. of four input LUTs 26,624 1,001 385 5,513 8,262 1,750

No. of IOBs 221 60 46 34 33 62

No. of BRAMs 32 10 9 2 1 4

Best achievable delay (n sec) N/A 6.786 8.705 16.270 18.216 6.229

Maximum frequency (MHz) N/A 147.36 114.87 61.46 54.89 160.53

Maximum throughput (Gbps) N/A N/A N/A 7.870 7.025 N/A

State storage

Key expension

Mix column

RC 10 libraries

and header files

Shift rows

S-box

(a)(a) AES-128 cipher

State storage

Key expension

Inv mix column

RC 10 libraries

and header files

S-box & Inv S-box

Inv shift rows

Key storage

(b) Decipher(b)(b) AES-128 decipher

Fig. 5. FPGA chip layouts.

Table 2. Comparative study of the proposed AES model with existing works.

References Parameters

FPGA devices Area (Slices) BRAMs Maximum frequency (MHz) Throughput Throughput/Slices (Mbps)

Proposed XC3S1500L 3,430 N/A 61.46 7.87 Gbps 2.290

[5] XC3S50 163 N/A 71 208 Mbps 1.270

[7] XCV2000E 5,677 80 34.12 4.10 Gbps 0.722

[8] XCV1000E 1,857 N/A 125.38 0.867 Mbps/Slice 0.867

[9] 4VLX60 20,155 200 N/A 23.09 Gbps 1.145

[10] XC2VP20 9,446 N/A 169.10 21.64 Gbps 2.290

[11] XCV1000E 11,719 N/A 124.80 16.54 Gbps 1.411

[12] XC2S30 222 N/A 60 166 Mbps 0.747

[13] EP1S20F780C5 13,368 N/A 43.86 5.61 Gpbs 0.419

[14] XC2VP30 563 N/A 150.50 221.4 Mbps 0.393

Page 5: RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS ...eprints.uthm.edu.my › 2003 › 1 › Afandi_Ahmad_FKEE_(ISCE2011).pdf · RAPID PROTOTYPING OF AES ENCRYPTION FOR WIRELESS COMMUNICATION

5. CONCLUSIONS AND FUTURE WORKS

An efficient implementation of AES encryption for wirelesscommunication system has been presented in this paper. TheAES algorithm has been implemented to capture, store andtransmit frames by the camera in real-time. Results obtainedshow that the proposed design is very competitive to otherexisting implementations in terms of throughput per unitresource utilisation.

The system implemented has also been demonstratedfor edge detection. For future works, this system couldbe implemented for internet banking security services.This image can then be transmitted to a remote server forauthentication and eventually giving the user access to theiraccounts online.

6. REFERENCES

[1] C. Gehrmann, J. Persson, and B. Smeets, Bluetooth Security.Artech House, 2004.

[2] B. A. Miller and C. Bisdikian, Bluetooth Revealed. PrenticHall, 2001.

[3] R. Shorey and B. Miller, “The Bluetooth technology: meritsand limitations,” in Personal Wireless Communications, 2000IEEE International Conference on, 2000, pp. 80–84.

[4] J. Daemen and V. Rijmen, “The Block Cipher Rijndael,”Lecture Notes in Computer Science, vol. 1820/2000, pp. 277–284, 2000.

[5] G. Rouvroy, F. X. Standaert, J. J. Quisquater, and J. D.Legat, “Compact and efficient encryption/decryption modulefor FPGA implementation of the AES Rijndael very wellsuited for small embedded applications,” in InformationTechnology: Coding and Computing, 2004. Proceedings. ITCC2004. International Conference on, vol. 2, April 2004, pp. 583–587.

[6] [Online]. Available: http://www.mentor.com

[7] F. R. Henriquez, N. A. Saqib, and A. D. Perez, “4.2gbit/s single-chip FPGA implementation of AES algorithm,”Electronics Letters, vol. 39, no. 15, pp. 1115–1116, July 2003.

[8] S. S. Wang and W. S. Ni, “An efficient FPGA implementationof advanced encryption standard algorithm,” in Circuitsand Systems, 2004. ISCAS ’04. Proceedings of the 2004International Symposium on, vol. 2, May 2004, pp. 597–600.

[9] M. R. M. Rizk and M. Morsy, “Optimized area and optimizedspeed hardware implementations of AES on FPGA,” inDesign and Test Workshop, 2007. IDT 2007. 2nd International,Dec. 2007, pp. 207–217.

[10] A. Hodjat and I. Verbauwhede, “A 21.54 gbits/s fully pipelinedAES processor on FPGA,” in Field-Programmable CustomComputing Machines, 2004. FCCM 2004. 12th Annual IEEESymposium on, April 2004, pp. 308–309.

[11] P. Chodowiec, P. Khuon, and K. Gaj, “Fast implementations ofsecret-key block ciphers using mixed inner- and outer-roundpipelining,” in Proceedings of the 2001 ACM/SIGDA ninthinternational symposium on Field programmable gate arrays.ACM, 2001, pp. 94–102.

[12] P. Chodowiec and K. Gaj, “Very compact FPGAimplementation of the AES algorithm,” Lecture Notes inComputer Science, vol. 2779/2003, pp. 319–333, 2003.

[13] H. Qin, T. Sasao, and Y. Iguchi, “An FPGA design of AESencryption circuit with 128-bit keys,” in Proceedings of the15th ACM Great Lakes symposium on VLSI. ACM, 2005,pp. 147–151.

[14] C. Parikh and P. Patel, “Performance evaluation of AESalgorithm on various development platforms,” in ConsumerElectronics, 2007. ISCE 2007. IEEE International Symposiumon, June 2007, pp. 1–6.