rc4 cryptography

81
CHAPTER 1 INTRODUCTION 1

Upload: ga18392

Post on 01-Apr-2015

5.718 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: RC4 Cryptography

CHAPTER 1

INTRODUCTION

1

Page 2: RC4 Cryptography

CHAPTER 1

INTRODUCTION

1.1 Relevance:

Cryptography is the practice and study of hiding information. In modern times, cryptography is considered to be a branch of both mathematics and computer science, and is affiliated closely with information theory, computer security, and engineering. Cryptography is used in applications present in technologically advanced societies; examples include the securityof ATM cards, computer passwords, and electronic commerce, which all depend on cryptography.This project is entitled “Designing & development of Embedded Decrypter” involves designing a simple prototype of embedded decrypter. In addition, it was chosen because it involves the use of controller which will act as interface between base station (transmitter) and destination. The design and implementation should prove challenging due to the size requirements of the design.

1.2 Problem statements:

To design an embedded system which will decrypt the data received

and displays the same on display. .

1.3 Solution developed:

The design consists of microcontroller to accept & process the data and

reproduce the same in original form. The microcontroller actually consists of

en/decryption algorithm which will accept the encrypted data and extract the

data from it and displayed on display.

2

Page 3: RC4 Cryptography

1.3 Block diagram:

Figure- 1 Block diagram of overall system

1.4 Block diagram description:

1) Received encrypted data:

The data received from a base station (transmitter) in the encrypted

form is been taken as input and it is applied to the embedded decrypter device.

The encryption done for data may be simple key inclusion or any standard

algorithm is used. Key is included at the time of transmission and it is

extracted at the time of reception.

2) Embedded decrypter device:

The receiver side consists of the microcontroller based receiver. The

controller consists of decryption algorithm embedded into it. The decryption

algorithm is written in assembly language. The controller will accept the input

from ask demodulator and it is then decrypted and output is displayed on

LCD. Received data consist of key embedded into it which will be extracted

from the same and data will be represented in the original form. The advantage

of using microcontroller is to reduce the burden on the complex circuitry and

user friendly nature of device.

3

RECIVED ENCRYPTED DATA

EMBEDDED DECRYPTER DEVICE

LCD DISPLAY

Page 4: RC4 Cryptography

3) LCD Display:

The data decrypted will be represented on the LCD display.

The led display is used to display the necessary information but it is not

preferred due to increased PCB size and improper indication of data.

Here we have tried to produce the design at simple level it can be enhanced at

larger level with more complexity.

4

Page 5: RC4 Cryptography

CHAPTER 2

LITERATURE SURVEY

5

Page 6: RC4 Cryptography

CHAPTER 2

LITERATURE SURVEY

2.1 Introduction to cryptanalysis:

The goal of cryptanalysis is to find some weakness or insecurity in a

cryptographic scheme, thus permitting its subversion or evasion. Cryptanalysis might

be undertaken by a malicious attacker, attempting to subvert a system, or by the

system's designer (or others) attempting to evaluate whether a system has

vulnerabilities, and so it is not inherently a hostile act. In modern practice, however,

cryptographic algorithms and protocols must be carefully examined and tested to offer

any assurance of the system's security (at least, under clear — and hopefully

reasonable — assumptions).

Cryptanalysis of symmetric-key ciphers typically involves looking for

attacks against the block ciphers or stream ciphers that are more efficient than any

attack that could be against a perfect cipher. For example, a simple brute force attack

against DES requires one known plaintext and 255 decryptions, trying approximately

half of the possible keys, to reach a point at which chances are better than even the

key sought will have been found. But this may not be enough assurance; a linear

cryptanalysis attack against DES requires 243 known plaintexts and approximately 243

DES operations.This is a considerable improvement on brute force attacks.

Public-key algorithms are based on the computational difficulty of

various problems. The most famous of these is integer factorization (e.g., the RSA

algorithm is based on a problem related to factoring), but the discrete logarithm

problem is also important. Much public-key cryptanalysis concerns numerical

algorithms for solving these computational problems, or some of them, efficiently.

For instance, the best known algorithms for solving the elliptic curve-based version

of discrete logarithm are much more time-consuming than the best known algorithms

for factoring, at least for problems of more or less equivalent size. Thus, other things

being equal, to achieve an equivalent strength of attack resistance, factoring-based

encryption techniques must use larger keys than elliptic curve techniques. For this

6

Page 7: RC4 Cryptography

reason, public-key cryptosystems based on elliptic curves have become popular since

their invention in the mid-1990s.

While pure cryptanalysis uses weaknesses in the algorithms

themselves, other attacks on cryptosystems are based on actual use of the algorithms

in real devices, and are called side channel attacks. If a cryptanalyst has access to, say,

the amount of time the device took to encrypt a number of plaintexts or report an error

in a password or PIN character, he may be able to use a timing attack to break a

cipher that is otherwise resistant to analysis. An attacker might also study the pattern

and length of messages to derive valuable information; this is known as traffic

analysis and can be quite useful to an alert adversary. And, of course, social

engineering, and other attacks against the personnel who work with cryptosystems or

the messages they handle (e.g., bribery, extortion, blackmail, espionage,) may be the

most productive attacks of all.

2.1 Encryption:

Encryption is the process of transforming information (referred to as

plaintext) to make it unreadable to anyone except those possessing special knowledge,

usually referred to as a key. The result of the process is encrypted information (in

cryptography, referred to as cipher text). In many contexts, the word encryption also

implicitly refers to the reverse process

Encryption has long been used by militaries and governments to

facilitate secret communication. Encryption is now used in protecting information

within many kinds of civilian systems, such as computers, networks (e.g. the Internet

e-commerce), mobile telephones, wireless microphones, wireless intercom systems,

Bluetooth devices and bank automatic teller machines. Encryption is also used in

digital rights management to restrict the use of copyrighted material and in software

copy protection to protect against reverse engineering and software piracy.

7

Page 8: RC4 Cryptography

2.2. Decryption:

Decryption is the reverse, moving from unintelligible cipher text to

the plain text. This is essentially the encryption algorithm run in reverse. It takes the

cipher text and the secret key and produces the original plain text.

2.3. Basic block diagram of encryption and decryption:

Figure- 2 Basic block diagram of En/Decryption

Description:

The original message is called plaintext.

The coded message is called cipher text.

Process of converting from plaintext to cipher text is enciphering or encryption.

Restoring the plaintext from the cipher text is deciphering or decryption.

Key is input to the encryption algorithm. The algorithm will produce a different

output depending on the specific key being used at the time.

2.4. Types of encryption:

8

Page 9: RC4 Cryptography

There are two main types of encryption in use in computer security, referred to as

1. Symmetric key Encryption

2. Asymmetric key Encryption.

2.4.1 Symmetric key Encryption:

Also called private key cryptography or secret key cryptography) is the

type in which the same key is used to encrypt and decrypt the data. Symmetric

encryption was the only type of encryption in use prior to the development of public

key encryption. The two basic building blocks of all encryption techniques are

Substitution and Transportation. A substitution technique is one in which the letters of

plaintext are replaced by other letters or by numbers or symbols.

Substitution ciphers:

Caesar ciphers

Monoalphabetic ciphers

Playfair ciphers

Hill ciphers

Polyalphabetic ciphers

One-time pad

Transportation ciphers:

Rail fence technique

2.4.2 Asymmetric key encryption:

In asymmetric key cryptography, different keys are used for encrypting

and decrypting a message. The asymmetric key algorithms that are most useful are

those in which neither key can be deduced from the other. In that case, one key can be

made public while the other is kept secure. There are some distinct advantages to this

public-key–private-key arrangement, often referred to as public key cryptography: the

9

Page 10: RC4 Cryptography

necessity of distributing secret keys to large numbers of users is eliminated, and the

algorithm can be used for authentication as well as for cryptography.

E.g.:

RSA

ElGamal encryption

elliptic curve encryption

2.5. Overview of different decryption algorithms:

1. Advanced Encryption Standard (AES)

In cryptography, the Advanced Encryption Standard (AES), also

known as Rijndael, is a block cipher adopted as an encryption standard by the U.S.

government. It has been analyzed extensively and is now used widely worldwide.

AES was announced by National Institute of Standards and Technology (NIST) as

U.S. FIPS PUB 197 (FIPS 197) on November 26, 2001 after a 5-year standardization

process (see Advanced Encryption Standard process for more details). AES is one of

the most popular algorithms used in symmetric key cryptography. It is available by

choice in many different encryption packages The Rijndael proposals for AES defined

a cipher in which the block length and the key length can be independently specified

to 128,192, or 256 bits. Strictly speaking, AES is not precisely Rijndael (although in

practice they are used interchangeably) as Rijndael supports a larger range of block

and key sizes; AES has a fixed block size of 128 bits and a key size of 128, 192 or

256 bits, whereas Rijndael can be specified with key and block sizes in any multiple

of 32 bits, with a minimum of 128 bits and a maximum of 256 bits.

2. Data Encryption Standard (DES):

The DES is a cipher (a method for encrypting information) selected as

an official Federal Information Processing Standard (FIPS) for the United States in

1976, and which has subsequently enjoyed widespread use internationally.

DES is the archetypal block cipher — an algorithm that takes a fixed-

length string of plaintext bits and transforms it through a series of complicated

operations into another cipher text bit string of the same length. In the case of DES,

the block size is 64 bits. DES also uses a key to customize the transformation, so that

10

Page 11: RC4 Cryptography

decryption can only be performed by those who know the particular key used to

encrypt. The key ostensibly consists of 64 bits; however, only 56 of these are actually

used by the algorithm. Eight bits are used solely for checking parity, and are thereafter

discarded. Hence the effective key length is 56 bits, and it is usually quoted as such.

3. Triple DES:

In cryptography, Triple DES is a block cipher formed from the Data

Encryption Standard (DES) cipher by using it three times. When it was found that a

56-bit key of DES is not enough to guard against brute force attacks, TDES was

chosen as a simple way to enlarge the key space without a need to switch to a new

algorithm. The use of three steps is essential to prevent meet-in-the-middle attacks

that are effective against double DES encryption. Note that DES is not a group; if it

were one, the TDES construction would be equivalent to a single DES operation and

no more secure.

By design, DES and therefore TDES, suffer from slow performance in

software; on modern processors, AES tends to be around six times faster. TDES is

better suited to hardware implementations, and indeed where it is still used it tends to

be with a hardware implementation (e.g., VPN appliances and the Nextel cellular and

data network), but even there AES outperforms it. Finally, AES offers markedly

higher security margins: a larger block size, potentially longer keys, and as of 2007,

no known public cryptanalytic attacks.

4. RSA Algorithm:

In cryptography, RSA is an algorithm for public-key cryptography. It

was the first algorithm known to be suitable for signing as well as encryption, and one

of the first great advances in public key cryptography. RSA is widely used in

electronic commerce protocols, and is believed to be secure given sufficiently long

keys and the use of up-to date implementations. RSA involves a public key and a

private key. The public key can be known to everyone and is used for encrypting

messages. Messages encrypted with the public key can only be decrypted using the

private key.

11

Page 12: RC4 Cryptography

Key generation:

Finding the large primes p and q is usually done by testing random

numbers of the right size with probabilistic primarily tests which quickly eliminate

virtually all non-primes and q should not be 'too close', lest the Fermat factorization

for n be successful, if p-q, for instance is less than 2n1/4 (which for even small 1024-

bit values of n is 3x1077) solving for p and q is ultra-trivial. Furthermore, if either p-1

or q-1 has only small prime factors, n can be factored quickly by Pollard's p − 1

algorithm and these values of p or q should therefore be discarded as well.RSA is

much slower than DES and other symmetric cryptosystems.

2.6. Encryption need:

Encryption, by itself, can protect the confidentiality of messages, but

other techniques are still needed to verify the integrity and authenticity of a message;

for example, a message authentication code (MAC) or digital signatures. Standards

and cryptographic software and hardware to perform encryption are widely available,

but successfully using encryption to ensure security is a challenging problem.

A single slip-up in system design or execution can allow successful

attacks. Sometimes an adversary can obtain unencrypted information without directly

undoing the encryption.

2.7 Applications:

Encryption has long been used by militaries and governments to facilitate

secret communication.

Encryption is now used in protecting information within many kinds of

civilian systems, such as computers, networks (e.g. the Internet e-commerce),

mobile telephones, wireless microphones, wireless intercom systems,

Bluetooth devices and bank automatic teller machines.

Encryption is also used in digital rights management to restrict the use of

copyrighted material and in software copy protection to protect against reverse

engineering and software piracy.

12

Page 13: RC4 Cryptography

CHAPTER 3

DESIGN AND DRAWING

13

Page 14: RC4 Cryptography

CHAPTER 3

DESIGN AND DRAWING

3.1 Introduction:

The most important and basic aspect of the any system is to design the

circuit (i.e. hardware design) for the specific application. This involves selecting

which component to use, specifications of different components, mathematical

calculations, component selections and other related issues.

The various specifications of designed system which are taken into

consideration in the design part are as follows:

Input voltage-230 V, 50Hz

Processor used-microcontroller P89C51RD2

LCD display-16*2 LCD display

Switches-push button micro switches

3.2 Hardware design:

3.2.1 Power supply:

The initial step in designing of nay system is to design the power

supply required for the system. In our system, most of the component used require +5

volt as operating voltage such as microcontroller, LCD display, RS 232 etc. line

supply of 230 volts ac is given to full wave Rectifier Bridge through step down

transformer. The rectified output is given to IC 7805 regulator which will give

constant +5 volt D.C. supply for operation of circuit. The total current which our

circuits sink is not more than 200 mA. We have used regulator IC 7805 that gives

output voltage of + 5 V. the minimum input voltage required 7805n is near about 7V .

Therefore we have used the transformer with the voltage rating 230Vac and current

rating 500 mA. The output of transformer is 12 Vac. This AC voltage is converted

into 12 V DC by bridge rectifier circuit.

14

Page 15: RC4 Cryptography

The reasons for choosing bridge rectifier are:

a) The TUF is increased to 0.812 as compared to the full wave rectifier.

b) The PIV across each diode is the peak voltage across the load =Vm and 2Vm

as in the two diode rectifier.

Output of the bridge rectifier is not pure DC and contains some AC

some AC ripples in it. To remove these ripples we have used capacitor filter,

which smoothens the rippled output that we apply to 7805 regulators IC that gives

5V DC. We preferred to choose capacitor filter since it is cost effective, readily

available and not too bulky.

The 7805 is a three terminal positive voltage regulator IC which gives

regulated 5V Dc output. The maximum input voltage that can be applied to input

pin is the 35V. The minimum difference between input and output voltage

required is the 2V. The pin no.1 is input pin where the unregulated input voltage is

applied. Pin no.2 is connected to ground, whereas pin no3 is the output pin at

which regulated 5V output can be obtained.

3.2.2 Switches:

Switch is the term used in digital systems to represent the digital status

either 0 or 1 and it is then applied to the next stage. Here we used the micro switches

to input the encrypted data to the system. On pressing the switch will represent the

digital 1 and on release it will gives digital 0.

3.2.3 Selection Criteria of Micro controller:

While designing any embedded system there is one of the important

parameter that is considered for the designing purpose is selection criteria for

processor. Processor for any system can be selected depending on the following

factors:

1) Data width to be processed:

These parameters define data width of the processor i.e. the capability

of the processor to accumulate and process the data. The selection is done as per the

15

Page 16: RC4 Cryptography

maximum number of bits to be processed by the algorithm. In our case the no of bits

to be processed are equal to 8. So any 8-bit processor/controller can be used to satisfy

above requirement.

2) Speed of execution:

Speed of execution of processor is used to relate with the speed of

executing the data and processing speed. Generally the speed of execution for the

cryptosystem is not so higher so the processor with medium speed is preferred.

3) Power consumption:

The power consumption is considered because; most of the embedded

systems are battery operable. So the controller/processor with low power consumption

is selected.

4) Memory:

The memory is required to store the data. The memory is required to

the temporarily store and retrieve the data. The processor used in the existing design

should satisfy the sufficient memory requirement

5) Maintainability:

This the ability of the user to which the product is dispatched to use the

same with the minimum information about the product.

This is also used to define the design strength under the user

environment that does not design the system.

6) Instruction fetch cycle:

This parameter is used to define the number of instructions that are

fetched per time. Generally the higher instruction fetch cycle time processor is

selected for such design.

7) On chip resources:

On chip resources means the facilities that are provided on the chip

itself. Such as on chip ADC, on chip memory etc. The parameter is considered

because it will be helpful to reduce the size.

8) Size:

The size is also an important parameter that is concerned when any

embedded design is constructed. The size of the chip will decide the area required in

all design and also affect overall size of product.

16

Page 17: RC4 Cryptography

Features of micro controller:

Compatible with MCS -51 products

2k bytes of reprogram able flash memory

Endurance: 1000 write erase cycles

2.7 V to 6V operating range

Fully static operation:0hz to 24Mhz

Two level program memory lock

128 x 8-bit internal RAM

15 programmable I/O pins

Micro controller architecture:

The 89c51RD2/89c51RB2 device contains a non volatile 16k/32k/64kB flash

program memory that is both parallel programmable and serial in application

programmable; in system programming (ISP) allows the user to down load

the code while micro controller is in application.

In application programming means that the micro controller fetches the new

program code and reprograms itself while in the system.

This allows for remote programming over a modem link. A default serial

loader program in ROM allows serial in system programming of the flash

memory via the UART without the need for loader in the flash code

This device executes one machine cycle in 6 clock cycles, hence providing

twice the speed of conventional 80c51.

A OTP configuration bit lets the user select the conventional 12 clock timings

if desired

The device has 8 bit i/o ports, three 16 bit timers/counters multi-source, four

priority level, nested interrupt service structure, an enhanced UART and on

chip oscillator and timing circuit.

17

Page 18: RC4 Cryptography

P89C51RD2 pin out:

Figure-3 8051 pin out

3.2.4 LCD display:

A liquid crystal display (LCD) is a thin, flat display device made up of

any number of color or monochrome pixels arrayed in front of a light source or

reflector. It is often utilized in battery-powered electronic devices because it uses very

small amounts of electric power

Specifications:

Important factors to consider when evaluating an LCD dispaly:

1) Resolution: The horizontal and vertical size expressed in pixels (e.g., 1024x768).

Unlike CRT monitors, LCD monitors have a native-supported resolution for best

display effect.

18

Page 19: RC4 Cryptography

2) Dot pitch: The distance between the centers of two adjacent pixels. The smaller the

dot pitch size, the less granularity is present, resulting in a sharper image. Dot pitch

may be the same both vertically and horizontally, or different (less common).

3) Viewable size: The size of an LCD panel measured on the diagonal (more

specifically known as active display area).

4) Response time: The minimum time necessary to change a pixel's color or

brightness. Response time is also divided into rise and fall time. For LCD Monitors,

this is measured in btb (black to black) or gtg (gray to gray). These different types of

measurements make comparison difficult.

5) Refresh rate: The number of times per second in which the monitor draws the data

it is being given. A refresh rate that is too low can cause flickering and will be more

noticeable on larger monitors. Many high-end LCD televisions now have a 120 Hz

refresh rate (current and former NTSC countries only). This allows for less distortion

when movies filmed at 24 frames per second (fps) are viewed due to the elimination

of telecine (3:2 pulldown). The rate of 120 was chosen as the least common multiple

of 24 fps (cinema) and 30 fps (TV).

6) Matrix type: Active or Passive.

7) Viewing angle: (coll., more specifically known as viewing direction).

8) Color support: How many types of colors are supported (coll., more specifically

known as color gamut).

9) Brightness: The amount of light emitted from the display (coll., more specifically

known as luminance).

10) Contrast ratio: The ratio of the intensity of the brightest bright to the darkest dark.

11) Aspect ratio: The ratio of the width to the height (for example, 4:3, 16:9 or 16:10).

12) Input ports (e.g., DVI, VGA, LVDS, or even S-Video and HDMI).

19

Page 20: RC4 Cryptography

LCD Pin out:

 Pin  Symbol Function

 1  Vss  Ground

 2  Vdd  Supply Voltage

 3  Vo  Contrast Setting

 4  RS  Register Select

 5  R/W  Read/Write Select

 6  En  Chip Enable Signal

 7-14  DB0-DB7  Data Lines

 15  A/Vee  Gnd for the backlight

 16  K  Vcc for backlight

Interfacing to 8051:

Figure- 4 LCD interfacing to 8051

Operation:

20

Page 21: RC4 Cryptography

The most commonly used ALPHANUMERIC displays are 1x16

(Single Line & 16 characters), 2x16 (Double Line & 16 character per line) & 4x20

( four lines & Twenty characters per line). 

The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data

lines. The number on data lines depends on the mode of operation. If operated in 8-bit

mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated

in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we

decide which mode to use? Its simple if you have sufficient data lines you can go for

8 bit mode & if there is a time constrain i.e. display should be faster then we have to

use 8-bit mode because basically 4-bit mode takes twice as more time as compared to

8-bit mode.

When RS is low (0), the data is to be treated as a command. When RS

is high (1), the data being sent is considered as text data which should be displayed on

the screen.

When R/W is low (0), the information on the data bus is being written

to the LCD. When RW is high (1), the program is effectively reading from the LCD.

Most of the times there is no need to read from the LCD so this line can directly be

connected to Gnd thus saving one controller line.

The EN pin is used to latch the data present on the data pins. A HIGH

- LOW signal is required to latch the data. The LCD interprets and executes our

command at the instant the EN line is brought low. If you never bring EN low, your

instruction will never be executed.

For Contrast setting a 10K pot should be used as shown in the figure.

Display Data Ram (DDRAM) stores the display data. So when we have to display a

character on LCD we basically write it into DDRAM. For a 2x16 LCD the DDRAM

address for first line is from 80h to 8fh & for second line is 0c0h to 0cfh. So if we

want to display 'H' on the 7th postion of the first line then we will write it at location

87h.

3.2.5 RS-232 cable:

21

Page 22: RC4 Cryptography

In telecommunications, RS-232 (Recommended Standard 232) is a

standard for serial binary data signals connecting between a DTE (Data terminal

equipment) and a DCE (Data Circuit-terminating Equipment). It is commonly used in

computer serial ports. A similar ITU-T standard is V.24. The Electronic Industries

Alliance (EIA) standard RS-232-Cas of 1969 defines:

Electrical signal characteristics such as voltage levels, signaling rate, timing

and slew-rate of signals, voltage withstand level, short-circuit behavior, and

maximum load capacitance.

Interface mechanical characteristics, pluggable connectors and pin

identification.

Functions of each circuit in the interface connector.

Standard subsets of interface circuits for selected telecom applications.

The standard does not define such elements as

character encoding (for example, ASCII, Baudot or EBCDIC)

the framing of characters in the data stream (bits per character, start/stop bits,

parity)

protocols for error detection or algorithms for data compression

bit rates for transmission, although the standard says it is intended for bit rates

lower than 20,000 bits per second. Many modern devices support speeds of

115,200 bps and above

power supply to external devices.

Details of character format and transmission bit rate are controlled by the serial port

hardware, often a single integrated circuit called a UART that converts data from

parallel to serial form. A typical serial port includes specialized driver and receiver

integrated circuits to convert between internal logic levels and RS-232 compatible

signal

Voltage levels:

22

Page 23: RC4 Cryptography

Figure- 5 Voltage levels in RS-232

The RS-232 standard defines the voltage levels that correspond to

logical one and logical zero levels. Valid signals are plus or minus 3 to 15 volts. The

range near zero volts is not a valid RS-232 level; logic one is defined as a negative

voltage, the signal condition is called marking, and has the functional significance of

OFF. Logic zero is positive, the signal condition is spacing, and has the function ON.

The standard specifies a maximum open-circuit voltage of 25 volts; signal levels of

±5 V,±10 V,±12 V, and ±15 V are all commonly seen depending on the power

supplies available within a device. RS-232 drivers and receivers must be able to

withstand indefinite short circuit to ground or to any voltage level up to +/-25 volts.

The slew rate, or how fast the signal changes between levels, is also

controlled.Because the voltage levels are higher than logic levels typically used by

integrated circuits, special intervening driver circuits are required to translate logic

levels. These also protect the device's internal circuitry from short circuits or

transients that may appear on the RS-232 interface, and provide sufficient current to

comply with the slew rate requirements for data transmission.

Because both ends of the RS-232 circuit depend on the ground pin

being zero volts, problems will occur when connecting machinery and computers

where the voltage between the ground pin on one end, and the ground pin on the other

is not zero. This may also cause a hazardous ground loop.

3.3 Proposed IDE:

The IDE is the environment in which the code for the micro controller

or microprocessor is written. The IDE used for the design is KEIL microvision2

simulator. The IDE consist of the user interface in which the code is entered and

simulated. The error is removed with the help of debug extension facility. The IDE

also have the facility to download the code directly as it contains the interface of the

simulator to the kit.

23

Page 24: RC4 Cryptography

KEIL microvision2 is a complete set of development tools for

controllers, it includes number of components:

·         C Compiler

·         Assembler

·         Linker

·         Function libraries

·         Integrated Development Environment (IDE)

·         Simulator (supports source and binary level

debugging)

·         [Optional] Additional libraries for:

1. Graphics LCD interface (clear screen, set/clear pixel,

draw line and so on…)

2. Accessing I2C compatible devices like EEPROM,

RTC…

With KEIL microvision2, you can:

 Create and edit an 8051 application - the IDE includes

program editor with syntax highlighting. You can create and

edit C and/or Assembler programs.

Use the Visual Code Generator (VCG) to automatically

generate initialization code for on-chip peripherals (such as

serial port, timers).

Create a "project" which may include number of C, Assembler,

and Object files.

"Make" the application - all C programs will be compiled,

Assembler programs will be assembled and finally all Object

files will be linked together with appropriate Libraries; and

Intel HEX file and/or ROM image file (.BIN) will be produced.

Use the simulator to (offline) debugs your application -

simulation of on-chip peripherals (such as serial port) is

fully supported. Simulation of some external peripherals

(such as LCD) is also supported. Much of functional testing is

possible with this simulator.

24

Page 25: RC4 Cryptography

Use the flash ISP programming utility to download the HEX

file into target processor (if it supports ISP). Our Evaluation

Boards (Mini51) and Single Board Computers (SBC51) support

ISP. Currently these processors:

P89C51Rx+, P89C51Rx2, P89C66x, and P89C669 (MX

family, 96K code memory), DS89C420. supported

3.4 Circuit diagram & Working:

The operation described as follows:

1) The switches are used to provide the plaintext /decrypted data as the input these

are micro switches that provide digital 1 when pressed otherwise 0.

2) The data is then applied to the microcontroller which is the heart of the system

and it contains the actual en/decryption algorithm. So it will accept data and will

en/decrypt the same and reproduced to next stage.

3) The en/decrypted data is now displayed on LCD display

4) In case of encryption, the plaintext is encrypted and sends via the RS-232 cable to

the decrypter module.

5) At the decrypter module, the data is received and process through decryption

algorithm and plaintext is obtained.

25

Page 26: RC4 Cryptography

CHAPTER 4

PROPOSED DECRYPTION

26

Page 27: RC4 Cryptography

CHAPTER 4

PROPOSED DECRYPTION

4.1 Introduction to stream ciphers:

In cryptography, a stream cipher is a symmetric key cipher where

plaintext bits are combined with a pseudorandom cipher bit stream (keystream),

typically by an exclusive-or (xor) operation. In a stream cipher the plaintext digits are

encrypted one at a time, and the transformation of successive digits varies during the

encryption. An alternative name is a state cipher, as the encryption of each digit is

dependent on the current state. In practice, the digits are typically single bits or bytes.

Stream ciphers represent a different approach to symmetric encryption

from block ciphers. Block ciphers operate on large blocks of digits with a fixed,

unvarying transformation. This distinction is not always clear-cut: in some modes of

operation, a block cipher primitive is used in such a way that it acts effectively as a

stream cipher. Stream ciphers typically execute at a higher speed than block ciphers

and have lower hardware complexity. However, stream ciphers can be susceptible to

serious security problems if used incorrectly: see stream cipher attacks — in

particular, the same starting state must never be used twice.

Security:

To be secure, the period of the keystream, that is, the number of digits

output before the stream repeats itself, needs to be sufficiently large. If the sequence

repeats, then the overlapping ciphertexts can be aligned against each other "in depth",

and there are techniques which could allow the plaintext to be extracted. This can be a

27

Page 28: RC4 Cryptography

practical concern: for example, the DES block cipher was initially allowed to be used

in a certain mode (OFB) with a varying parameter. However, for most choices of this

parameter, the resulting stream had a period of only 232 — for many applications, this

period is far too low. For example, if encryption is being performed at a rate of 1

megabyte per second, a stream of period 232 will repeat after around 8.5 minutes.

Usage:

Stream ciphers are often used in applications where plaintext comes in

quantities of unknowable length—for example, a secure wireless connection. If a

block cipher were to be used in this type of application, the designer would need to

choose either transmission efficiency or implementation complexity, since block

ciphers cannot directly work on blocks shorter than their block size. For example, if a

128-bit block cipher received separate 32-bit bursts of plaintext, three quarters of the

data transmitted would be padding. Block ciphers must be used in ciphertext stealing

or residual block termination mode to avoid padding, while stream ciphers eliminate

this issue by naturally operating on the smallest unit that can be transmitted (usually

bytes).

Another advantage of stream ciphers in military cryptography is that

the cipher stream can be generated in a separate box that is subject to strict security

measures and fed to other devices, e.g. a radio set, which will perform the xor

operation as part of their function. The latter device can then be designed and used in

less stringent environments.RC4 is the most widely used stream cipher in software;

others include: A5/1, A5/2, Chameleon, FISH, Helix, ISAAC, MUGI, Panama,

Phelix, Pike, SEAL, SOBER, SOBER-128 and WAKE.

Some design considerations are:

1) Long period with no repetitions

2) Statistically random

3) Depends on large enough key

28

Page 29: RC4 Cryptography

4) Large linear complexity

5) Correlation immunity

6) Use of highly non-linear Boolean functions

Comparision of stream ciphers:

StreamCipher

CreationDate

Speed(cycles/byte)

(bits) Attack

EffectiveKey-Length

Initialization vector

InternalState

Best KnownComputationalComplexity

A5/1 1989 Voice (Phone) 54 114 64

Active KPA ORKPA Time-Memory Tradeoff

~2 seconds OR239.91

A5/2 1989 Voice (Phone) 54 114 64? Active 4.6 milliseconds

FISH 1993Quite Fast (Soft)

Huge - -Known-plaintext attack

211

Grain Pre-2004 Fast 80 64 160 Key-Derivation 243

HC-256 Pre-2004 4 (WP4) 256 256 65536 - -

ISAAC 1996

2.375 (W64-

bit) -4.6875 (W32-

bit)

8-8288usually 40-256

N/A 8288

(2006) First-roundWeak-Internal-State-Derivation

4.67×101240

(2001)

MUGI1998-2002

- 128 128 1216 N/A (2002) ~282

29

Page 30: RC4 Cryptography

Trivium Pre-2004

4 (Wx86) - 8 (WLG) 80 80 288

Brute force attack (2006 2135

Phelix Pre-2004up to 8 (Wx86)

256 + a 128-bit Nonce

128 -Differential (2006)

237

Pike 19940.9 x FISH (Wsoft)

Huge - - N/A (2004) N/A (2004)

Py Pre-2004 2.68-2048?usually 40-256?

64 8320Cryptanalytic Theory (2006)

275

Rabbit 2003-Feb3.7(WP3)-9.7(WARM7)

128 64 512 N/A (2006) N/A (2006)

RC4 1987 Impressive8-2048usually 40-256

8 2064

Shamir Initial-Bytes Key-Derivation OR KPA

213 OR 233

Salsa20 Pre-20044.24 (WG4) -11.84 (WP4)

128 + a 64-bit Nonce

512512 + 384 (key+IV+index)

Differential (2005)

N/A (2005)

Scream 2002 4 - 5 (Wsoft)128 + a 128-bit Nonce

32?64-bit round function

- -

4.2 RC4 Algorithm:

In cryptography, RC4 (also known as ARC4 or ARCFOUR) is the

most widely-used software stream cipher and is used in popular protocols such as

Secure Sockets Layer (SSL) (to protect Internet traffic) and WEP (to secure wireless

networks). While remarkable in its simplicity, RC4 falls short of the high standards of

security set by cryptographers, and some ways of using RC4 can lead to very insecure

cryptosystems (an example being WEP). It is not recommended for use in new

systems. However, some systems based on RC4 are secure enough for practical use.

30

Page 31: RC4 Cryptography

RC4 was designed by Ron Rivest of RSA Security in 1987. While it is

officially termed "Rivest Cipher 4", the RC acronym is alternatively understood to

stand for "Ron's Code" (see also RC2, RC5 and RC6).RC4 was initially a trade secret,

but in September 1994 a description of it was anonymously posted to the

Cypherpunks mailing list. It was soon posted on the sci.crypt newsgroup, and from

there to many sites on the Internet. The leaked code was confirmed to be genuine as

its output was found to match that of proprietary software using licensed RC4.

Because the algorithm is known, it is no longer a trade secret. The name "RC4" is

trademarked, however. The current status seems to be that "unofficial"

implementations are legal, but cannot use the RC4 name. RC4 is often referred to as

"ARCFOUR" or "ARC4" (meaning Alleged RC4, because RSA has never officially

released the algorithm), to avoid possible trademark problems. It has become part of

some commonly used encryption protocols and standards, including WEP and WPA

for wireless cards and TLS.

The main factors which helped its deployment over such a wide range

of applications consisted in its impressive speed and simplicity. Implementations in

both software and hardware are very easy to develop.

Description:

RC4 generates a pseudorandom stream of bits (a key stream) which,

for encryption, is combined with the plaintext using XOR; decryption is performed

the same way. (This is similar to the Vernam cipher except that pseudorandom bits,

rather than random bits, are used.) To generate the key stream, the cipher makes use

of a secret internal state which consists of two parts:

1. A permutation of all 256 possible bytes (denoted "S" below).

2. Two 8-bit index-pointers (denoted "i" and "j").

The permutation is initialized with a variable length key, typically

between 40 and 256 bits, using the key-scheduling algorithm (KSA). Once this has

been completed, the stream of bits is generated using the pseudo-random generation

algorithm (PRGA).

31

Page 32: RC4 Cryptography

The key-scheduling algorithm (KSA)

The key-scheduling algorithm is used to initialize the permutation in

the array "S". "Keylength" is defined as the number of bytes in the key and can be in

the range 1 ≤ keylength ≤ 256, typically between 5 and 16, corresponding to a key

length of 40 – 128 bits. First, the array "S" is initialized to the identity permutation. S

is then processed for 256 iterations in a similar way to the main PRGA algorithm, but

also mixes in bytes of the key at the same time.

The pseudo-random generation algorithm (PRGA):

Figure- 6 Pseudo-random stream generation

The output byte is selected by looking up the values of S(i) and S(j),

adding them together modulo 256, and then looking up the sum in S; S(S(i) + S(j)) is

used as a byte of the key stream, K. For as much iteration as are needed, the PRGA

modifies the state and outputs a byte of the key stream. In each iteration, the PRGA

increments i, adds the value of S pointed to by i to j, exchanges the values of S[i] and

S[j], and then outputs the value of S at the location S[i] + S[j] (modulo 256). Each

value of S is swapped at least once every 256 iterations.

Security:

RC4 falls short of the standards set by cryptographers for a secure

cipher in several ways, and thus is not recommended for use in new applications. The

key stream generated by RC4 is slightly biased in favour of certain sequences of

bytes. The best attack based on this bias is due to Fluhrer and McGrew, which will

32

Page 33: RC4 Cryptography

distinguish the key stream from a random stream given a gigabyte of output.RC4,

does not take a separate nonce alongside the key. Such a nonce is, in general, a

necessary requirement for security, so that encrypting the same message twice

produces a different cipher text each time. One approach to addressing this is to

generate a "fresh" RC4 key by hashing a long-term key with a nonce. However, many

applications that use RC4 simply concatenate key and nonce; RC4's weak key

schedule then gives rise to a variety of serious problems.

4.3 Advantages of RC4:

1) Not patent i.e. authority to use for public application development.

2) Security provided.

3) Possibility of implementation on selected device.

4) Variable key length algorithm.

5) Easy for hardware development

4.4 Applications -RC4-based cryptosystems:

1) WEP

2) WPA

3) CipherSaber

4) BitTorrent protocol encryption

5) Microsoft Point-to-Point Encryption

6) Secure Sockets Layer (optionally)

7) Secure shell (optionally)

8) Remote Desktop Client (RDC over RDP)

9) Kerberos (optionally)

10) SASL Mechanism Digest-MD5 (optionally)

Where a cryptosystem is marked with "(optionally)", RC4 is one of several ciphers

the syste m can be configured to use.

WEP (wireless encryption protocol):

33

Page 34: RC4 Cryptography

Wired Equivalent Privacy (WEP) is a deprecated algorithm to secure

IEEE 802.11 wireless networks. Wireless networks broadcast messages using radio,

so are more susceptible to eavesdropping than wired networks. When introduced in

1999, WEP was intended to provide confidentiality comparable to that of a traditional

wired network.

Beginning in 2001, several serious weaknesses were identified by

cryptanalysts with the result that today a WEP connection can be cracked with readily

available software within minutes within a few months the IEEE created a new

802.11i task force to counteract the problems. By 2003, the Wi-Fi Alliance announced

that WEP had been superseded by Wi-Fi Protected Access (WPA), which was a

subset of then upcoming 802.11i amendment. Finally in 2004, with the ratification of

the full 802.11i standard (a.k.a. WPA2), the IEEE declared that both WEP-40 and

WEP-104 "have been deprecated as they fail to meet their security goals". Despite its

weaknesses, WEP is still widely in use. WEP is often the first security choice

presented to users by router configuration tools even though it provides a level of

security that deters only unintentional use, leaving the network vulnerable to

deliberate compromise.

WEP is sometimes inaccurately referred to as Wireless Encryption Protocol

Authentication:

Two methods of authentication can be used with WEP: Open System

authentication and Shared Key authentication.

For the sake of clarity, we discuss WEP authentication in the

Infrastructure mode (ie, between a WLAN client and an Access Point), but the

discussion applies to the Ad-Hoc mode too.

In Open System authentication, the WLAN client need not provide its

credentials to the Access Point during authentication. Thus, any client, regardless of

its WEP keys, can authenticate itself with the Access Point and then attempt to

associate. In effect, no authentication (in the true sense of the term) occurs. After the

authentication and association, WEP can be used for encrypting the data frames. At

this point, the client needs to have the right keys.

34

Page 35: RC4 Cryptography

In Shared Key authentication, WEP is used for authentication. A four-

way challenge-response handshake is used:

I) The client station sends an authentication request to the Access Point.

II) The Access Point sends back a clear-text challenge.

III) The client has to encrypt the challenge text using the configured WEP key, and

send it back in another authentication request.

IV) The Access Point decrypts the material, and compares it with the clear-text it had

sent. Depending on the success of this comparison, the Access Point sends back a

positive or negative response. After the authentication and association, WEP can be

used for encrypting the data frames.

At first glance, it might seem as though Shared Key authentication is

more secure than Open System authentication, since the latter offers no real

authentication. However, it is quite the reverse. It is possible to derive the static WEP

key by capturing the four handshake frames in Shared Key authentication. Hence, it is

advisable to use Open System authentication for WEP authentication, rather than

Shared Key authentication. (Note that both authentication mechanisms are weak).

35

Page 36: RC4 Cryptography

4.5 Flowcharts -RC4 algorithm:

4.5.1. Definitions Used in Code:

36

Page 37: RC4 Cryptography

4.5.2. Main Body of Function:

37

START

DEFINE UNSIGNED INTEGER CAHRACTER OR LONG TYPE

INTIALLIZE TR0 OR LOAD TIMER 0 WITH VALUE (-921) TO SET

BAUD RATE

INTIALLIZE LCD CONTROL LINES PIN INTERFACE TO

CONTROLLER

INTIALLIZE SERIAL TRANSMITT ROUTINE & DELAY ROUTINE

INTIALLIZE STATE TABLE ARRAY OF 256 BYTES

STOP

Page 38: RC4 Cryptography

38

START

INTIALLIZE HARDWRAE STATUS AND SERIAL

TRANSMITT ROUTINE

INTIALLIZE HEADER & C FILES AND TIMER 0 UESD

IN DESIGN

DISPLAY THE SYSTEM INTIAL

MESSAGE

CALL DELAY OF 2 millisecond

CALL INIT_HW ( ) TO SET HARDWARE

STATUS

CALL INIT_LCD() TO INTIALLIZE LCD

DISPLAY

WHILE 1?

A

NO

YESD

Page 39: RC4 Cryptography

39

A

ASK USER TO INPUT DATA(PLAINTEXT)

IS KEYPRES

S?

CHECK FOR DEBOUNCING STATUS?

DISPLAY THE INPUT DATA

ENTERED

CALL DELAY OF 4 millisecond

CLEAR LCD DISPLAY

ASK USER TO INPUT KEY(8 BIT)

IS KEYPRES

S?

B

YESD

NO

YES

NO

YES

NO

Page 40: RC4 Cryptography

40

B

CHECK FOR DEBOUNCING STATUS?

YES

NO

DISPLAY INPUT KEY ENTERED

CALL DELAY OF 3 millisecond

CALL PREPARE_KEY( ) FUNCTION

CALL RC4 () FUNCTION

DISPLAY MESSAGE AS COMPLETED

STOP

Page 41: RC4 Cryptography

4.5.3. Key Preparation Subroutine:

41

START

INTIALLIZE VARIABLES USED

FORMATION OF STATE TABLE OF 256 BYTES

INTIALLIZE INDEX AND POINTERS AND

COUNTER

GET 1ST POSITION (INDEX 1) OF

ARRAY

GET 2ND POSITION (INDEX 2) OF

ARRAY

SWAP THE RESPECTIVE BYTES OF INDEX 1 AND

INDEX 2

INCREMENT INDEX AND COUNTER BY 1

IS CNT<=

255?

RETURN

YES

NO

Page 42: RC4 Cryptography

4.5.4. RC4 En/Decryption Subroutine:

42

START

CALCULATE TH Y POSITION IN

BUFFER_LENGTH

INTIALLIZE COUNTER =0

CALCULATE TH ‘X ‘POSITION IN

BUFFER_LENGTH

INTIALLIZE VARIABLES USED & SET TEMP

VARIABLES X & Y = 0

SWAP THE RESPECTIVE BYTES

CALCULATE ENCRYPTED DATA (X XOR Y)

DISPLAY ENCRYPTED DATA

ON DISPLAY

RETURN

Page 43: RC4 Cryptography

4.5.5. Serial Communication Subroutine:

43

START

LOAD TIMER WITH SPECIFIC VALUE FOR SETTING BAUD RATE

LOAD TIMER MODE REGISTER TO SET BAUD

RATE

SET REGISTER FOR SERIAL CONTROL MODE

START TIMER

LOAD THE SERIAL BUFFER WITH ONE BYTE

IS TI FLAG

=1?

RETURN

TRUE

FALSE

Page 44: RC4 Cryptography

4.5.6 LCD Display Subroutine:

44

START

LCD READY?

SEND DATA TO PORT 0

SELECT DISPLAY REGISTER

ENABLE WRITE

ENABLE DISPLAY

DISABLE DISPLAY

RETURN

ENABLE LCD

CONFIGURE PORT 0 AS INPUT PORT

SELECT COMMAND REGISTER

CHECK BUSY PIN

BUSY PIN=0 ?

YES

NO

NO

YES

Page 45: RC4 Cryptography

CHAPTER 5

MANUFACTURING

45

Page 46: RC4 Cryptography

CHAPTER 5

MANUFACTURING

5.1 PCB Layout:

Layout basically means placing or arranging things in specific order on

the PCB. Layout means placing of components in an order. This placement is made

such that the interconnection lengths are optimal. At the same time, it also aims at

providing accessibility to the components for insertion testing & repair. The PCB

layout is the starting point for the final artwork preparation layout design should

reflect the concept of final equipment.

There are several factors which we keep in mind for placing the layout.

Schematic diagram:

The schematic diagram forms main input document for preparation of

the layout for this purpose the software for PCB design PROTEL was used.

Electrical & thermal equipment:

The PCB designer must be aware of the circuit performance in critical

aspects of the same concerning electrical conditions and the environment to be used in

Mechanical requirement:

The designer should have the information about physical size of the

board, type of installation of board (vertical/horizontal). The method of cooling

adopted, front panel operated components etc.

Component placing requirement:

All components are to be placed first in configuration that demands only the

minimum length for critical conductors.

These key components are placed first and the others are grouped around like satellites.

46

Page 47: RC4 Cryptography

Components mounting requirements:

All components must be placed parallel to one another as far as possible .i.e.

in the same direction and orientation mechanical over stressing of solder should be avoided.

Layout methodology:

For proper layout design minimal, steps to be followed are :

1.Get the final circuit diagram and component list.

2.Choose the board types, single sided/ double sided/multilayered

3.Identify the appropriate scale for layout.

4.Select suitable grid pattern.

5.Choose the correct board size keeping in view the constraints.

6.Select appropriate layout technique, manual/automated.

ARTWORK:

Art work is accurately scaled configuration of the printed circuit from which

the master pattern is made graphically.

ARTWORK RULES:

Rules fowolled while selecting artwork symbol takes

1. Minimum spacing between conductor and pad should be 0/35mm in 1;1 scale

2.Minimum spacing between parallel conductors should be 0.4mm in 1;1 scale.

3.The area of non –PTH solder not be less than 5sq.mm

4.The width of current carrying conductors should be determined for max.. temp. rise

of 20 °c

47

Page 48: RC4 Cryptography

CHAPTER 6EXPERIMENTATION

48

Page 49: RC4 Cryptography

CHAPTER 6

EXPERIMENTATION

6.1 Introduction:

The most important part during development of any project is the

troubleshooting. The troubleshooting can be categorized as:

1. Hardware troubleshooting

2. Software troubleshooting

6.2 Hardware Testing & Troubleshooting:

The hardware testing is necessary to examine the faithful operation and

find out various defects present in the system. So far the following tests are done on

the system:

1. Examining the PCB:

Initially the PCB was examined to find any unwanted shorts and open

tracks. Also the open & shorts if any then removed.

2. Physically check all connections:

One should mount all components that are additional to peripheral IC.

Check whether power supply wires are firmly connected to the boards. Check for any

dry solders. Check if IC’s are physically in place. Check whether all components are

correctly mounted.

3. Check whether Vcc and Ground are shorted:

The PCB has a single main Vcc and ground track on it. It is necessary

to ensure that neither of these tracks is shorted or open at times a short circuit may

occur and IC’s would be in danger of being destroyed. This can be checked by

multimeter at various points of tracks carrying necessary Vcc and 0V across it.

49

Page 50: RC4 Cryptography

4. Check IC’s Vcc and Ground:

Once the above step is performed, check individual IC’s to see that

correct pins are connected to Vcc and Ground. This can be achieved by checking the

voltage levels on multimeter at each Vcc and Ground pins of all IC’s.

5. Crystal test:

The initial test is to ensure both reset circuit and crystal are working.

An ALE pulse in 8051 is checked to verify that the frequency is 1/16 th of crystal

frequency. All ports are checked to see if they are in high input states.

6. ROM test:

The most fundamental test is to verify that 8051 can fetch and execute

program from the ROM. It can be tested and verified that each address line of ROM is

properly wired using jump to address that are in power of two. Only one addres line

will be high and reset will be low.

7. RAM test:

Once sure the ability of 8051 to execute the code, the Ram can be

checked. A common test is to generate alternating pattern of 1’s and 0’s in memory

writing

8. Keyboard test:

First of all we tested for the keyboard. We first interfaced the keyboard

in polling mode wherein the timer was set to count and if any key is pressed before

timer would overflow then it was taken as a valid key with time adjusted for

debounce. The timer was then again reset and the controller would poll the port for

any new key press. Whenever a valid key press was detected by controller we had

made it to display on LCD We than thought of using keyboard in interrupt driven

mode i.e. whenever any key press occur then controller will call a subroutine called

ISR.

50

Page 51: RC4 Cryptography

9. LCD display:

The LCD module was next to follow. We first decided to display the

key pressed on the LCD. So far that we connected the LCD in 8 bit mode. The port 0

was completely connected to data lines of display while 3 pin of port1 were

connected to control signal lines of the display. First we had to initialize the LCD for

various display functions such as clear display, cursor on, cursor off, cursor blinking.

We encountered the problem that cursor was not shifting. Then we found that we have

forgotten to initialize the display in that way. So after doing this we tested program

for key press and displaying it on display.

6.3 Software Testing & Troubleshooting:

The software testing is necessary to examine the various defects and to

remove the unnecessary code used in the design so far the following points must be

considered while designing any embedded software:

1) Remove unnecessary loops:

This consists of removing the invariant loop used in the code. E.g.- the

loop used to find out factorial of number.

2) Remove debug code:

This is necessary to save the space and it will also avoid extra burden

on the programmer.

3) Remove unnecessary variables used:

Sometimes while designing a code, variables are declared in definition

but not used in the code so such mistakes are avoided.

4) Avoid global declaration of variables:

This consists of defining the variables globally to avoid unnecessary

declaration every time but it may take the extra memory space so it must be taken into

account.

5) Avoid recursion:

In this step the recursive loops are find out and are removed out to

avoid the falls results.

51

Page 52: RC4 Cryptography

CHAPTER 7

RESULTS & DISCUSSIONS

52

Page 53: RC4 Cryptography

CHAPTER 7

RESULTS & DISCUSSIONS

7.1 Introduction:

This is an example as to how the system works when the following

steps are taken:

1) Switch on power supply .the start message is displayed on the screen.

2) We have manufactured two boards i.e. one for the encryption & second for

decryption.

3) The encryption side will ask user to input the 8-bit data through the keys. The 8-bit

data is entered through the keys. E.g. suppose data entered is F0

4) Now controller contains the encryption program, it will accept the data process the

data and the encrypted result is out on the display. E.g.-the encrypted result for F0

will be 7B on the display.

5) The data is serially transmitted to decrypter side and reverse procedure is carried

out.

.6) Results at decrypter side can be examined as directly transferring the encrypted

data through the keys and displaying original plaintext on display.

7.2 Results Obtained:

Encrypted data Key entered Decrypted data

( Plaintext obtained)

74 01 00

94 23 00

C2 45 00

E7 67 00

10 89 00

4B AB 00

08 CD 00

79 EF 00

53

Page 54: RC4 Cryptography

7.3 Future Work:

There is wide scope of future expansion the source side can also be

made for the encryption of data and to send it by using wireless communication the

project can be extended in every aspect i.e. in hardware & software. In hardware there

is much scope for increasing range of wireless communication, data rate of wireless

communication, reduction in the components of the system. The individual receivers

can be made more compact in size and can be made battery operable. The scope

of the software is wider. The level of encryption can be increased to 64 bits; the

solution matrix can be made bigger and complex.

One of the future expansions is discussed below:

Internet Based Embedded Control System:

IP network has been evolving significantly in last decade. Many

computers and devices have been attached to the IP network and many applications

were taken place over it. One of interesting applications is building embedded control

system which has connectivity to Internet. This overview explains an implementation

of embedded web server with security support which becomes an example of control

application over IP network. A security algorithm, ARC4 (RC4 encryption

Algorithm), has been implemented in a microprocessor system together with TCP/IP

stack. The microprocessor system is based on 8051 family microcontroller which

serves as web server. The encryption algorithm is processed both on server and client.

Therefore in clients need a plug in, which run encryption mechanism, so that they can

access the embedded web server safely.

Hardware Design:

The hardware architecture we designed here is a microprocessor based system. We

choose a 8051 family microcontroller, AT89C55, which has 20 KB ROM and 256

bytes RAM. AT89C55 is interfaced to NE-2000 Ethernet controller by ISA bus. The

whole hardware architecture is as shown in figure below:

54

Page 55: RC4 Cryptography

Figure-8 Hardware design of internet based embedded control system

This embedded web server is a good media to attach device to Internet. Many applications can be developed by this system primarily in field of remote monitoring and controlling. E.g.- remote monitoring of Weather Station, Oil Storage, Home Automation, etc. We can build this system with low cost and easy to install.

55

Page 56: RC4 Cryptography

CHAPTER 7

CONCLUSION

56

Page 57: RC4 Cryptography

CHAPTER 7

CONCLUSION

As indicated by results, the project is having faithful operation. This

means that the hardware designed and the software code arte working in total

agreement and thus project has been tested, debugged and implemented

In case of any embedded system design, the design trade-offs must be

considered such as size, power consumption, cost, flexibility, maintainability, time to

prototype etc. so. While designing the hardware the above constraint are considered

and taken into account. The software design makes use of various code optimization

techniques.

Here we have tried to develop a prototype which will work as a

decrypter device used in the military applications. The device can be made more

complicated depending on the use of the complex devices and the advanced

cryptography techniques. The prototype can be used for the corporate applications, e-

commerce and also for security applications. The enhanced techniques can be applied

for the encryption-decryption and increased performance will be obtained

The total cost incurred for system is 2000 /- Rs. And system will

working at required performance level. Due to high cost incurred and complexity

involved the wireless transmission is not preferred instead of it the wired transmission

is used.

57

Page 58: RC4 Cryptography

REFERENCES

58

Page 59: RC4 Cryptography

REFERENCES

Reference books:

Cryptography & Network security by William Stallings, 4 th edition, prentice hall of

India

Embedded systems using microcontroller 8051, M.A.mazidi., PHI publications

Embedded ‘C’, Dr.K.V.K.K.Prasad, 4th edition. Dream-tech publications

Embedded & Real time control systems, Dr.K.V.K.K.Prasad, 4th edition. Dream-tech

publications

Papers form journals:

Recent trends in encryption technology published by NTT Information Sharing

Platform Laboratories Yokosuka-shi, 239-0847 Japan in Vol. 4 No. 2 Feb. 2006

Levin -Epstein M., “Dealing With Security”, IT Health Care Strategist, Vol. 4, No.

4:1-6, April 2002.

VeriSign PKI, “Public–Key Infrastructure (PKI)—the VeriSign Difference,” 2002,

Internet:

• www.computerstuuffworks.com

• www.wikipedia.org

• www.electronics-lab.org

• www.rsa.com

59

Page 60: RC4 Cryptography

APPENDIX A- BILL OF MATERIALS (BOM)

APPENDIX B- DATA SHEETS

89c51RD2 microcontroller

LM 7805 regulator

RC4 algorithm

Max 232

60