Professional Documents
Culture Documents
Wireless Data Encryption and Decryption Using Radio Frequence (FINAL YEAR PROJECT OF ELECTRICAL ENGINEERING)
Wireless Data Encryption and Decryption Using Radio Frequence (FINAL YEAR PROJECT OF ELECTRICAL ENGINEERING)
Project Supervisors:
Professor Azhar Hussain Shah Assistant Professor Zulqarnain
Project Members:
Syed Fahad Raza Reg. No. L2F07BSEE0627
Approved on ________________
Internal Examiner:
Sign: ________________________________
(Project supervisor):
External Examiner:
Acknowledgement:
Engineering is not only hard work and perseverance; it is imagination, motivation, dedication; it is keenness to learn and desire to excel; it is planning and managing; and above all it is activity with insight.
Planning is vital for any project. During our project we have suffered from different problems in our project but by the grace of ALLAH ALMIGHTY, they were overcome and we have completed our project in time due to guidance and suggestions of our Project Supervisor Professor Azhar Hussain Shah who advised us in this project at each stage.
We would like to express our appreciation to Asst Prof. Zulqarnain, who guided us throughout the project.
Finally, we are also thankful to our Parents for their love, support and prayers without which we could not have put our best in the project.
Abstract:
We have discussed in project the secures wireless communication in detail. This process is very useful in modern applications of wireless communication. First of all, we entered the message from keyboard. This message is encrypted and then it is transmitted using radio frequency transmitter. The characters which are entered at the transmitter will also be displayed on the LCD for our convenience and so that we can enter our data in easier way. At the receiver when the encrypted message is received then this message is decrypted by the microcontroller and is displayed on the LCD. The mode of communication that we have used in our project is simplex data transmission over radio frequency.
THESIS LAYOUT
This thesis consists of seven chapters. The detailed explanation about the chapters in this thesis is as follows:
Chapter 1: Introduction of the project and an overview on Data Encryption and Decryption. Besides that, the BLOCK DIAGRAM of the project with explanation of each of its block, the scope of work, the utility and the objective of the project are also included in this chapter. Chapter 2: Literature review: This describes the different types of Data Encryption and Decryption Techniques. Chapter 3: Is about the details of all the experiments we did for our project: Chapter 4: Contains the design of our project. All the parts of the device are presented in detail. Illustrations are added to improve readers understanding. That includes; Design Parameters, Requirements and Implementation. Chapter 5: Presents the full project description and data in detail. Chapter 6: Presents the detail conclusion on our project, the shot comings, improvements, problem faced, problem resolved and further extensions of it. Chapter 7: Future advancement in the projects.
Table of contents
1. Introduction: 1.0
8 10 13 13 13
14 15 16 21
Introduction to and Encryption and Decryption Algorithms/techniques of Encryption and Decryption Introduction to wireless Radio Modules
3. Experimentations:
25 26 31 35
Part 1: Exp#1 (selection of Encryption and Decryption algorithm) Part 2: Exp#2 (selection of radio modules) Part 3: Exp#3 (input output devices)
4. Electrical Design 4.0 Function of each component. RF modules Keyboard LCD Microcontrollers
37
49 51 53
REFERENCES
55
CHAPTER # 1 INTRODUCTION
1. Introduction:
This project is about the secure wireless communication over RF. The main advantage of this project is that the data cannot be received until and unless you dont have receiver code that is compatible to transmitter. At the transmitter, keyboard will be attached to microcontroller which is used to input the message. This message is encrypted and then it is transmitted using radio frequency transmitter. The data which will be entered at the transmitter will also be displayed on LCD for convenient entry. At the receiving end when the encrypted message is received then this message is decrypted by the microcontroller and is displayed on the LCD. The mode of communication that we have used in our project is radio frequency channel. In our project we have used two schemes of data encryption and decryption. One is the Monoalphabetic scheme and the other is Polyalphabetic scheme. The RF modules that we have used for data transmission and reception works at 433MHz.
Battery 3.6v
Voltage 9 Regulati on
Filtratio n
11
Transmitter section
Keyboard:The keyboard is used for giving the input. Here we have used a common computer keyboard through which data can be entered. Microcontroller:The data which is input through the keyboard is sent to the microcontroller. In this microcontroller the encryption program is implemented which encrypts the input data. RF encoder:When the microcontroller encrypts the data then it is sent to the RF encoder. It will create a secure single line data so that it can be transmitted easily through RF transmitter. LCD display:The data which entered from the keyboard will be shown on the LCD. RF transmitter:This RF transmitter is used to transmit the message which is encrypted.
Receiver section
RF receiver:The RF receiver receives the encrypted signal/message and sends this to the RF decoder. RF decoder:It decodes the received signal and then sends it to the microcontroller for decryption. LCD:The message is then displayed on the LCD.
12
1.1
Scope of Work:
The wireless transmission of messages was not a big deal. In todays era due to advancement in communication technology security is a big issue. If anyone transmits a secret message over wireless, anyone can intercept that signal and can read it. Thus to overcome this problem we designed a communication device which not only can be used as a wireless paging system but it also ensures the security of the users information. The major area in our project is to encrypt the message according to a specific algorithm on the transmitter side and then send this message using RF transmitter. On the receiver side the message is decrypted and is displayed on the LCD.
1.2
Utility:
This advanced and secured communication system can be used in different aspects. Following are the main areas where this system can be used: 1) It can be used by the security agencies for communication. 2) It can also be used by the police.
3) This system is of great importance for the politicians. They can send secret
messages.
1.3
Objective:
The main objective of this project is to ensure security along with better communication.
13
14
Literature Review
By surfing on internet and consulting different book about how encryption and decryption works and how the communication is done using RF modules. Following is the literature that we reviewed and consulted during the implementation and designing our project.
2.0
Cryptography is a process in which we convert a plain text or clear text message to cipher text message which is based on an algorithm that both sender and receiver know, and in this way the cipher text message can be obtained to its original form. In this way, a message cannot be read by anyone but the authorized receiver. The process of converting a plain message to its cipher text form is called enciphering. Reversing this process is known as deciphering. Enciphering and deciphering are other names of encryption and decryption. There are a number of methods used to perform encryption and decryption. The most usable method uses a key. A key is a parameter of algorithm by which encryption and decryption takes place. Key-based cryptographic techniques are divided into two methods: symmetric and asymmetric. In symmetric cryptography, same key is used for encryption and decryption. In asymmetric cryptography, one key is used for encryption and another for decryption.
Fig. 2-1
15
2.1
Secret Key Cryptography (SKC): It uses a a single key for both encryption and decryption. Public Key Cryptography (PKC): This one uses one key for encryption and another for decryption Hash Functions: In this type, a mathematical transformation is employed to irreversibly "encrypt" information
Fig 2-2(Three types of cryptography: secret-key, public key, and hash function)
16
Fig 2-3
17
c) Hash functions
Hash functions,are characterized and then solved depending on their ability to withstand an attack by an adversary. For example, suppose we have a message x, if this message is computationally not suitable to find a message y not equal to x such that H(x) = H(y) then we can say that H is weakly collision free hash function. A proper collision free hash function H is that for which it is computationally not suitable to find out the two messages i.e. x and y such that H(x) = H(y).
Fig 2-4
18
Substitution Techniques
In cryptography, there is a method known as substitution cipher by which the data that entered is replaced with cipher text according to a system of the units. These units may be single letters or pairs of letters. They can also be of the type of the triplets of letters or the mixtures of the above. On the receiver side, all the action will be reversed. Broadly speaking all substitutions can be categorized in two groups, namely; a) Monoalphabetic substitution b) Polyalphabetic substitution
a) Monoalphabetic substitution:In monoalphabetic substitution, each plain text alphabet is replaced with same cipher text alphabet during encryption. Hence number of alphabets in plain text must be equal to number of alphabets in cipher text. . For a monoalphabetic cipher which is a simple rearrangement of the 26 English alphabet, we can generate as large as 26! = 403,291,461,126,605,635,584,000,000 cipher alphabets. Each cipher alphabet is called the key. Apparently such rearrangements can generate very large number of combinations or keys. If the adversary wants to decrypt our message, knowing the type of substitution (monoalphabetic substitution cipher) employed, then still he faces the problem of checking all the possible keys. If the adversary can successfully check one of these possible keys every second, then the time consumed in order to check all keys will be one billion times the lifetime of the universe which is very long time. However statistically monoalphabetic cipher can be solved in few minutes.
b) Polyalphabetic substitution:In this type of substitution, there will be the use of multiple substitution alphabets i.e. every plain text letter will be replaced with new substitute for nnumber of times before the process starts to repeat itself. In other words we can say that the polyalphabetic substitution is more secure than monoalphabetic substitution. This is because in polyalphabetic substitution every alphabet is replaced with different alphabet. If the same alphabet is repeated in the world then both alphabets will be replaced with different alphabets and so it is more secure than monoalphabetic substitution.
19
20
2.2
Introduction to RF Modules
RF modules are normally divided into three groups, RF transmitter and RF receiver module. There is another module known as RF transceiver module. Transmitter module is a electronic component using a variety of radio signals to remote control the target device which has a receiver module built-in. The remote distance can be very long and one does not need a line-of-sight remote controlling compared to remote controls using infrared technology. RF modules are widely used in garage door openers, wireless alarm systems, industrial remote controls and wireless home automation systems.
21
RF signal modulation:Three types of signal modulation are commonly used in RF transmitter & receiver modules, which are as follows,
Fig 2-8
22
The transmitter power: the higher power will result in a further remote distance, but also prone to cause interference with other RF devices. The receiver sensitivity: the higher receiver sensitivity will result in a further remote distance, but also prone to cause malfunction due to interference with other RF devices. The antenna using: for example, a stretched antenna will increase the remote distance. obstacles: the labeled remote distance is normally measured in open-air, line of sight distance without any interferences, but often we will have obstacles such as walls, floors to greatly absorb the radio wave signals, so the remote distance will be much nearer
vehicle monitoring remote control telemetry small-range wireless network wireless meter reading access control systems wireless home security systems area paging industrial data acquisition system radio tags reading RF contactless smart cards
23
wireless data terminals wireless fire protection systems biological signal acquisition hydrological and meteorological monitoring robot remote control wireless data transmissions digital video/audio transmission digital home automation, such as remote light/switch Remote control and telemetry. Alarm and wireless transmission systems for various types digital signal. Remote control of appliances and electronics devices. many other applications field related to RF wireless controlling.
24
CHAPTER # 3 EXPERIMENTATIONS
25
To implement and design our project we performed different experiments. These experiments were performed for the selection of different Encryption and Decryption algorithms, RF modules and different electronic components for our project.
Selection of Encryption and Decryption algorithm:After a detailed review of many encryption and decryption schemes and performing series of experiments on these techniques we finalize the following two techniques for our project: a) Monoalphabetic substitution b) Polyalphabetic substitution
a) Monoalphabetic substitution:In this technique we used a look up table for allocation of substitutes according to the following scheme. SMALL_ALPHABETS: Plain a b c d e f Hex 21H, 40H, 23H, 24H, 25H, 5EH, Cipher ! @ # $ % ^
26
g h i j k l m n o p q r s t u v w x y z
26H, 2AH, 28H, 29H, 2DH, 5FH, 2BH, 3DH, 7EH, 27H, 7BH, 7DH, 5BH, 5DH, 3AH, 3BH, 22H, 27H, 3EH, 3CH,
CAPITAL_ALPHABETS:
A B C D E F G H I J K L M N O P
3FH, 36H, 2EH, 2FH, 7CH, 5CH, 20H, 30H, 61H, 62H, 63H, 64H, 65H, 66H, 67H, 68H,
? 6 . / | \ (SPACE) 0 a b c d e f g h
27
Q R S T U V W X Y Z
69H, 6AH, 6BH, 6cH, 6DH, 6EH, 6FH, 70H, 71H, 72H,
i j k l m n o p q r
NUMERIC_ALPHABETS:
0 1 2 3 4 5 6 7 8 9
73H, 74H, 75H, 76H, 77H, 78H, 79H, 7AH, 41H, 42H,
s t u v w x y z A B
28
b) Polyalphabetic substitution:We used the following formula for determining polyalphabetic substitution. A1 B2 C3 D4 E5 F6 G7 H8 I9 J 10 K 20 L 30 M 40 N 50 O 60 P 70 Q 80 R 90 S 100 T 200 U 300 V 400 W 500 X 600 Y 700 Z 800 a 1000 b 2000 c 3000 d 4000 e 5000 f 6000 g 7000 h 8000 I 9000 j 10000 s 100000 0 1000000 9 10000000 k 20000 t 200000 1 2000000 10 20000000 l 30000 u 300000 2 3000000 m 40000 v 400000 3 400000 n 50000 w 500000 4 500000 o 60000 x 600000 5 6000000 p 70000 y 700000 6 7000000 q 80000 z 800000 7 8000000 r 90000 8 9000000
Then, the rule for encryption is this: a) If the plaintext and key letters are in the same column, they are added e.g.:
B (2) + F (6) = H (8) L (30) + J (10) = M (40)
29
b) If the plaintext and key letters are in two different columns, their nonzero digits are added, and the letter located in the next column which contains neither key nor plaintext at the position corresponding to sum obtained is taken as substitute e.g.:
D (4) + L (30) = Y (700) W (500) + K (20) = G (7000)
If we had a 27-letter alphabet, we would only have to add that when the sum is greater than 9, subtract 9 (in the appropriate digit place):
M (40) + Q (80) = L (30)
For the 26-letter alphabet, it's easy to modify rule (a): if the two letters are in the third column, subtract 800 instead of 900.
U (300) + Y (700) = T (200)
Rule (b) is modified in this way: always subtract 9; if the cipher letter and the key letter produce 900 as the result, use instead the letter that would be produced by enciphering a letter with the value 900 with the key letter. Note that same rules can be applied for the small alphabets and the numeric values by adding more 0s accordingly.
30
Selection of RF Modules:We performed several experiments for the selection of RF modules. After reviewing several modules we finalize the following RF Modules. The main advantage of these modules is the operating frequency. These modules are operating at a frequency of 433MHz which publically available ISI frequency band.
a) FS1000A 433 MHz Wireless Radio Transmitting Module b) PCR1A 433 MHz Wireless Radio Super regeneration Receiver Module
Fig 3-1
31
Technical specifications:
Input supply (2.5 V to 12V) Easy to integrate (V+, GND and Data) Device will be in deep sleep mode when Data pin grounded Very small dimension
Quiescent Current
10uA
32
b)
This RF receiver can receive RF signal from any RF transmitter. Its latest design has the capability to receive very weak signals.
Fig 3-2
Technical specifications
Low power consumption (4mA) Easy to integrate (V+, GND and Data) Super regeneration design Very small dimension
Operating Voltage Operating Current Operating Temperature Sensitivity Max. Data Rate Data Output
33
Fig 3-3
34
For the output device we decided to attach a 16x2 LCD with our system.
Fig 3-4 Handshaking problem:There is a big problem that should be kept in our mind that all the RF components transmits or receives data at 433 MHz. So, there should be a correct handshaking for correct communication. Our device should receive the data which is being sent through our RF transmitter not from the other transmitter. This is the most important factor that should be taken into account. There should be the proper synchronization between our transmitter and receiver. Otherwise our communication will not be efficient.
35
Electrical design
36
a) RF modules:The RF modules that we have used in our project are FS100A RF transmitter and PCR1A RF receiver. The technical specifications of these modules are as follows b) FS1000A 433 MHz Wireless Radio Transmitting Module c) PCR1A 433 MHz Wireless Radio Super regeneration Receiver Module
37
Technical specifications:
Wide input supply (2.5 V to 12V) Easy to integrate (V+, GND and Data) Device in deep sleep mode when Data pin is grounded Very small dimension
Quiescent Current
10uA
38
PCR1A 433 MHz Wireless Radio Super regeneration Receiver Module Technical specifications
Low power consumption (4mA) Easy to integrate (V+, GND and Data) Super regeneration design Very small dimension
Operating Voltage Operating Current Operating Temperature Sensitivity Max. Data Rate Data Output
B) Microcontrollers
The microcontrollers that we have used for our project are:
1) AT89S52 2) AT89C2051
39
Fig 4-1
Features Compatible with MCS-51 Products 8K Bytes of In-System Reprogrammable Flash Memory Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Programmable Serial Channel Low-power Idle and Power-down Modes 4.0V to 5.5V Operating Range Full Duplex UART Serial Channel Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off Flag Fast Programming Time Flexible ISP Programming (Byte and Page Mode)
Pin Description
40
Pin Number
Description
1-8 9 10 - 17 18 19 20 21 - 28 29 30 31 32 - 39 40
P1.0 - P1.7 - Port 1 RST - Reset P3.0 - P3.7 - Port 3 XTAL2 - Crystal XTAL1 - Crystal GND - Ground P2.0 - P2.7 - Port 2 PSEN - Program Store Enable ALE - Address Latch Enable EA - External Access Enable P0.7 - P0.1 - Port 0 Vcc - Positive Power Supply
2) AT80c2051
The Atmel AT89C2051 is an 8051-based Fully Static 24MHz CMOS controller with 15 I/O Lines, 6 Interrupts/2 Priority Levels, Analog Comparator, UART, Two-level Program Memory Lock, 2K Bytes Flash Memory, 128 Bytes On-chip RAM, , 2 Timers/Counters, , LED Drive Outputs.
41
Fig 4-2
Features
Fig 4-3
42
C) Keyboard
The keyboard that we have used in our design is ordinary computer keyboard.
The keyboard has a code for specific key. No matter you have pressed the shift key or not. It will still send the same code. The keyboard BIOS will decide that which action should takes place. Keyboard does not process whether NUM, SCROOL or CAPS key is pressed. If you pressed NUM, CAPS or SCROLL key then it is up to the BIOS of your keyboard to turn ON the LED of CAPS, NUM or SCROLL key to tell whether the key is pressed or not.
43
Keyboards connector
Our personal computer connected with external device using four wires. The description of these wires is as under 1.KBD Clock 2.KBD Data 3.N/C 4.GND 5.+5V (VCC) Fig 4-5 In some cases there is also present a fifth wire. This wire is used to RESET the keyboard but this wire is not required in modern keyboards. The KBD Clock and DATA pins are bidirectional. 1.KBD 2.GND 3.KBD 4.NC 5.+5V 6.NC Clock Data (VCC)
44
Fig 4-6 Serial Communication Keyboard to Host Above waveform is showing transmission of data which is of 8 bits. The keyboard may not generally change its data line on the rising edge of the clock as shown in the diagram. On the falling edge of the clock the data line only has to be valid. The clock will be generated through keyboard. The frequency of the clock pulse ranges from 20khz to 30 KHz. The LSB will always be sent first.
Fig 4-7
For the display purpose we have used two 16x2 LCD. One for the transmitter side and the other for receiver section.
1.
LCD. A command is an instruction given to LCD to do a predefined task like initializing, clearing the screen, setting the cursor position, controlling display etc.
2.
Data Register- stores the data to be displayed on the LCD. The data is the
46
1.
Data pin8 (DB7) of the LCD is busy flag and is read when R/W = 1 & RS = 0. When busy flag=1, it means that LCD is not ready to accept data since it is busy with the internal operations. Therefore before passing any data to LCD, its command register should be read and busy flag should be checked.
2.
To send data on the LCD, data is first written to the data pins with R/W = 0 (to specify the write operation) and RS = 1 (to select the data register). A high to low pulse is given at EN pin when data is sent. Each write operation is performed on the positive edge of the Enable signal.
3.
To send a command on the LCD, a particular command is first specified to the data pins with R/W = 0 (to specify the write operation) and RS = 0 (to select the command register). A high to low pulse is given at EN pin when data is sent.
Power supply
We required power supplies to convert high voltage alternating current to low voltage supply for appliances and other electronic devices. A power supply can split up into number of section so that each performs its particular job.
Electronic components
The electronic components used in power supply are Resistors Capacitors Switches Variable resistance LCD connector Keyboard connector
47
48
Project Description:
There is a detailed description in this project about secured wireless communication. This means that our data which is to be sent through wireless medium should be safe. At the transmitter there is attached a keyboard which is used to input our message. This message will be encrypted and then transmitted through RF transmitter. These characters which are to be transmitted will also be displayed on the LCD which is attached to microcontroller. At the receiver end when the encrypted message is received then this message is decrypted by the microcontroller and is displayed on the LCD. The mode of communication that we have used in our project is radio frequency.
Transmitter section
The input is given to the system using computer keyboard. The input that is entered is also displayed on the LCD. This input is fed into the 80S52 microcontroller. In this microcontroller the message which being entered is encrypted according to a specific algorithm. After this it is encoded using RF encoder and finally this encoded signal is sent to the RF transmitter which transmits that message.
Receiver section
In the receiver section RF receiver receives the encrypted message and then sends this message to the RF decoder. After decoding that signals the RF decoder then send this signal to the microcontroller which decrypts that message and finally that message is displayed on the LCD.
49
CHAPTER # 6 CONCLUSION
50
Conclusion
After so much work out on this project, we finally got our devices work in the way that we specified. It is able to send or receive messages and handle all handshaking problems and errors generated. The data is sent from the transmitter after encryption and at the receiving device the data is decrypted according to the specific algorithm. If we were given this project again, we will definitely search the transmitting and receiving modules which operates at different frequencies. This would simplify our the logic and the state transition of the project because we will get rid of handshaking problems and errors. We will also make a change so that our device can communicate with multiple devices. This should not be too difficult but we have to program the targets identification number. In this way only our desired target will only pick up the transmission.
51
Future Advancement:
This project can be modified in many ways. Some of the additional features that can be added to this project are:
The project that we have designed is based on simplex communication. It can be enhanced to a duplex mode of communication.
52
A proper key management scheme for the encryption and decryption processes can also be implemented on this project to ensure more data security.
This project can also be implemented using long range RF modules. This device is only a secure text terminal capable of transmitting alphabets and characters. It can be upgraded as data encryption unit capable of transmitting any data such as images and audio contents etc securely, over wireless channel..
Instead of present one to one communication protocol the device can be enhanced for working with other devices in a local area network..
53
REFERENCES
Websites:
Last accessed
http://www.mcustudy.com/mcu/Interfacing_AT_keyb http://en.wikipedia.org/wiki/Rf_module http://www.garykessler.net/library/crypto.html http://www.robotshop.com/content/PDF/details-de... http://www.answers.com/topic/cryptography-1 http://www.scribd.com/doc/29695569/Chapter-1 http://www.ananiahelectronics.com/FS100A.htm http://www.vectorsite.net/ttcodep.html http://jap.hu/electronic/codec-v4.0.html http://www.gnupg.org/gph/en/manual.html http://www.ecoustics.com/electronics/forum/home... http://www.scribd.com/doc/60434385/4/ACKNOWLEDG... http://en.wikipedia.org/wiki/Substitution_cipher http://www.scribd.com/doc/48050484/Code-Book http://en.wikipedia.org/wiki/Frequency-shift_ke... http://www.security.iitk.ac.in/contents/publica...
20-11-2010 17-10-2010 09-11-2010 27-11-2010 02-12-2010 16-12-2010 07-01-2011 29-01-2011 20-02-2011 29-02-2011 21-03-2011 06-04-2011 15-02-2011 04-06-2011 11-05-2011 16-04-2011
54