Tiny Encryption Algorithm Tea Computer Science Essay Example
Tiny Encryption Algorithm Tea Computer Science Essay Example

Tiny Encryption Algorithm Tea Computer Science Essay Example

Available Only on StudyHippo
  • Pages: 9 (2380 words)
  • Published: August 2, 2018
  • Type: Case Study
View Entire Sample
Text preview

Today, security is an issue concern by everyone. Many ways of implementing encryption algorithms have been investigated in order to achieve better performance in terms of security level, speed, power consumption and cost. This project will discuss about implementing Tiny Encryption Algorithm (TEA) using Field Programmable Gate Array (FPGA). FPGA are reconfigurable chips that the integrated circuit is designed meant for reconfigurable architecture. A FPGA chips is programmed using Hardware Description Language (HDL). TEA is an encryption algorithm or block cipher that consider fast, easy and used for many application. In this project, TEA will be implemented on Altera Cyclone II FPGA using Altera DE1 Board. Keyboard using PS2 or the SWITCH on the DE1 will be used as input. The output of the encryption and decryption data will be show on VGA monitor. The encrypted data will be store in memory.

In order

...

to complete this project, there are few objectives have to be archieve. Program the Tiny Encryption Algorithm (TEA) using verilog HDL (Hardware Description Language). Verifying the functionality of the implementation of the encryption in FPGA. Perform simulation for timing analysis and the encryption process on the implementation of Tiny Encryption Algorithm (TEA) in FPGA.

Before the modern era, security communication is the primary concern in Government and Military. Security communication become more important today as a result of the increasing use of the electronic communication for many daily activities such as internet banking, online shopping. Cryptography is a practical way of conveying information securely . The main aim of cryptography is to allow authorized person to receive the message correctly while preventing eavesdroppers understanding the content of the message . The original messag

View entire sample
Join StudyHippo to see entire essay

is called plaintext t. Plaintext will be encrypted using certain algorithms in the secure system in order to hide the meaning. The output of this reversible mathematical process is called ciphertext and the algorithm used in this process is called cipher . Ciphertext can be transmitted securely because ideally eavesdroppers that access to the ciphertext won’t understand what the meaning is behind . The reverse of this mathematical process is to decrypt the ciphertext back to plaintext and this only can be done by the original recipients.

There are two types of encryption or cipher depends on the key used: Asymmetric key and Symmetric key.

  1. Symmetric key: The encryption and decryption process use the same key . The major problems and drawback of this key both sender and receiver must know the key prior to the transmissions . If the key is transmitted then it will compromise the system’s security. The advantages of symmetric key is the process of encryption and decryption will be faster compare to asymmetric key, in another words it can encrypt or decrypt more data in shorter period of time.
  2. Asymmetric key: The encryption and decryption process use different key but both of the key are related mathematically. It is very hard to obtain one from the other although they are mathematically related . The public key is used for the encryption process and the private key is used for the decryption process . The security of the system won’t be compromised even though the public key is made available but the corresponding private key cannot be revealed to anyone.

Symmetric key is further divided into two types: Symmetric Cipher and Block Cipher.

Stream Cipher – Stream cipher that generates a keystream (a sequence of bits used as a key) . The encryption process is usually done by combining the keystream with plaintext using bitwise XOR operation . Keystream that generated is independent of the plaintext and ciphertext is called synchronous stream cipher while keystream that is generated is depent of plaintext is called self-synchronizing stream cipher.

Block Cipher – Stream cipher that generates a keystream encrypt fixed length block of plaintext into block ciphertext that is same length . The fix length is called block size. Block Cipher using same secret key for the encryption and decryption process. Usually, the size of block cipher is 64 bits . By increasing the size of block cipher to 128 bits will make the processors become more sophisticated .

Stream Cipher vs Block Cipher

Stream cipher is a type of symmetric encryption algorithm that can be designed to be exceptionally fast and even much faster compare to block cipher . Stream ciphers normally process on less bits while block ciphers can process large blocks of data. Plaintext that encrypted using block cipher will result in the same ciphertext when the same key is used. With a stream cipher, the transformation of thse smaller plaintext units will vary depending on when they are encountered during the encryption process.

Tiny Encryption Algorithm is implemented in this project because it is one type of cipher encryption algorithm that encrypt 64 bits of plaintext using a 128 bits of key into a 64 bits ciphertext.

Tiny Encryption Algorithm (TEA) is a Feistel type routine designed by David J. Wheeler and Roger M. Needham. It used addition and subtraction as

the reversible operators. XOR and ADD alternately used in the routine provide nonlinearity . The Dual bit shifting in the routine cause all the bits and data mixed repeatedly. The three XOR, ADD and SHIFT operation will provide Shannon’s properties of diffusion and confusion necessary for a secure block cipher without the need for P-boxes and S-boxes . TEA is a feistel cipher that split the plaintext into halves. A sub key will be applied to the one half of plaintext in the round function, F. Then the output of the F will be XOR with other half before the two halves are swapped . All same patterns applied to the entire round except the last round where there is often no swap . Figure 2 below show a Feistel cipher diagram where 64 bits of plaintext is divided into halves which are equally 32 bits each part. 128 bits of key is used for the encryption and decryption process and it is spitted into 32 bits subkey.

TEA is implemented using three different architectures. The first architecture  is a multiple 32 bit adders that simultaneously perform operations needed for one encryption cycle. This parallel form structure should be quite large in terms of hardware area but will perform faster . On the other hands, in order to reduce the area, the second architecture  performs operations sequentially using a single 32 bit adder . The last design is a 8 bit digit-serial adders that use advance architecture offered by application-specific hardware solution. The latter two design are meant for low area solutions but in terms of control and data selection, the effectiveness remain confirmed.

Software vs Hardware

Implementation of Encryption

Implementation of encryption using software is easier to design and upgrade, it also portable and flexible. One of the major problems of software implementation is in most typical personal computer have external memory out from the processor, the external memory is used to store raw data or instruction in unencrypted form so if an attacker gain access to the system, the key can be easier obtained . One of the most common way used by the attacker is bruteforce, a special program can be easily design to bruteforce the algorithm. Besides this, reverse engineering method easier to apply on software implementation. So it can be concluded that software implementation is lack of physical security.

Implementation of encryption using hardware by naturally is physically more secure as they are hard to read and view by attacker . Another advantage of hardware implementation is all the data in the encryption process is correlated according to an algorithm which usually perform operation on same data . This will prevent computer technique such as out of order execution and cause hang to the system . Hardware implementation also tend to be more parallel so more orders of magnitudes can be done at certain period of time.

Hardware implementation is will be better choice for encryption in terms of performance but the cost of implementation is higher compare to software implementation. Higher security level and better performance is the main concern in this project, so the encryption will be implemented on FPGA, one of the hardware implementation method.

Microcontroller, Microprocessor, DSP Processor and FPGA

Microprocessor

The first microprocessors invented in the 1970s. This is the first time where such an amazing devices put

a computer CPU onto a single IC. The significant processing was available at rather low cost, in comparatively small space . At beginning stage, all other functions, like input/output interfacing and memory were outside the microprocessor. Gradually all the other functions in embedded into a single chip . At the same time, microprocessor becoming more powerful in terms on the speed, power consumption and so on . Microprocessor is moving rapidly from 8 bits to 32 bits.

Microcontroller

A microcontroller is an inexpensive single-chip computer. The entire computer system lies within the confines of the integrated circuit chip, so it is called a single chip computer . The microcontroller on the encapsulated sliver of silicon has features similar to those personal computers . Mainly, the microcontroller is able to store and run a program . The microcontroller contains a CPU (central processing unit), ROM (random-access memory), RAM (random-access memory), Input/Output lines, and oscillator, serial and parallel ports. Some more advanced microcontroller also have other built in peripherals such as A/D (analog-to-digital) converter .

DSP (Digital Signal Processing) Processor

DSP processor is a specialized microprocessor optimized to process digital signal. Most of the DSP processors are commonly designed to have basic features such as high performance, repetitive and numerically intensive tasks so DSP processor often have advantage in terms of speed, cost and energy efficiency. DSP processor have the avility to perform one or more multiply accumulate operations (often called “MACs”) in a single instruction cycle .

FPGA (Field Programmable Gate Array)

Xilinx Co-Founders, Ross Freeman and Bernard Vonderschmitt, invented the first commercially viable field programmable gate array in 1985 – the XC2064. FPGA is integrated circuit for reconfigurable purposes by user

after manufacturer. FPGA is generally specified using Hardware Description language (HDL). FPGA can be programmed to perform logic function and due to this ability, FPGA become more popular. Using FPGA for design can lower non recurring Engineering cost and apply on many application.

Comparing the four architectures above, FPGA have the advantage in terms of the efficiency Performance but the unit cost is high. Since costing is not a major concern in this project, so FPGA is better choice for implementing Tiny Encryption Algorithm.

The vga_sync circuit generates timing and synchronization signals . The hsync and vsync signals are connected to the VGA port to control the horizontal and vertical scans of the monitor . Two signals which are pixel_x and pixel_y are decoded from the internal counters . The pixel_x and pixel_y signals indicate the relative positions of the scans and essentially specify the location of the current pixel. Videl_on signal is generated from vga_sync to check whether the display is enable or disable. The pixel generation circuit generate three video signal which is RGB signal . The current coordinates of the pixel (pixel_x and pixel_y), external control and data signals determine the color value.

PS/2 Controller

IBM introduced PS2 port in personal computers. It is a widely used interface for keyboard and mouse to communicate with the host . PS2 port consists of two wires for communication purposes. One wire for transmitting data in serial stream while another wire is for the clock information which determine when the data is valid and can be retrieved. The data is transmitted in 11 bit packet that contains 8 bits of data, an odd parity bit and stop bit.

Quartus II

Web Edition

Quartus II Web Edition design software is a comprehensive environment available for system-on-a-programmable-chip (SOPC) design developed by Altera. This software is used in this project to program and implement the Tiny Encryption Algorithm (TEA) on Altera DE1 Cyclone II FPGA . This program also can be used for the simulation and timing analysis.

Hardware Description Language (HDL)

Hard description language (HDL) is a type of programming languages used to program and describe digital logic or electronic circuits [20]. It can describe circuit operation, its design and organization . Figure 10 below shows different type of Hardware Description Language commonly used.

Verilog Hardware Description Language (HDL) is used to program the FPGA in this project because it is a widely used HDL and it syntax is similar the C programming language.

The Blog Diagram above explains the design of this project. PS/2 keyboard used as input for the plaintext. All the data from the PS/2 keyboard will be sent into PS/2 controller to process. The processed data, 128 Bits or key or 64 Bits of plaintext will sent into the TEA encryption core for encryption. The output of the encryption, ciphertext will store inside the flash memory. All the plaintext and cipher text will send into VGA controller to process and show on the CRT monitor. The encryption/decryption will be connected to the DPDT switch to switch between encryption or decryption mode. Key Update Request also connected to the DPDT switch for the purpose of updating the key when the switch is on. Asynchronous reset is connected to the push button for the reset purpose. There are internal clock inside the DE1 board so no external clock is needed

for this project.

Algorithm and Implementation Verification

The original Tiny Encryption Algorithm C source code by the author will be compiled or get a compiled executable program from other source to analyze the encryption of plaintext to ciphertext and decryption of ciphertext back to plaintext. A set of plaintext, ciphertext and key can generated from the program as a reference and compare with the encryption and decryption output implemented on FPGA.

Research analysis will be start from week 6 till week 8. Verilog coding on the implementation of TEA and module and test bench verification this 2 task must perform parallel because after finish a certain module, it should be test and simulate. If simulation or test is done after finish the whole coding, there will be a big problem in debugging the error. The synthesis of PS/2 keyboard, VGA monitor and FPGA start week 20 just before finish the coding. The functionality verification task also runs parallel with the synthesis optimization task.

Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New