“ALPHANUMERIC PATTERN recognition A DISSERTATION REPORT Submitted by ANAMIKA SHARMA Roll No.13PCS001 in partial fulfillment for the award of the degree of MASTER OF TECHNOLOGY in COMPUTER SCIENCE AND ENGINEERING Under guidance of Mr.Suman Kumar Jha Associate Professor LINGAYA'S UNIVERSITY Nachauli, Old Faridabad - Jasana Road, Faridabad -121 002, Haryana, India. (A Deemed University declared under Section 3 of the UGC Act, 1956) 1 LINGAYA'S UNIVERSITY BONAFIED CERTIFICATE Certified that this project report “IDENTIFICATION OF ALPHANUMERIC PATTERN USING ANDROID is the bonafide work of by “ANAMIKA SHARMA Roll No.13PCS001”, who carried out the project work under my supervision, towards partial fulfillments of the requirements of the Degree of Master of Technology in Computer Science & Engineering from Lingaya’s University, Faridabad. Signature of the Head of the Department Dr. Tapas Kumar Signature of the class counselor Asso.Prof. Latha Banda Date: 2 Signature of the Guide Asso.Prof.Suman Kumar Jha LINGAYA'S UNIVERSITY CERTIFICATE OF AUTHENTICATION I solemnly declare that this project report ““Identification of Alphanumeric pattern using Android” is the bonafide work done purely by me, carried out under the supervision of Associate Prof. Suman Kumar Jha, towards partial fulfillment of the requirements of the Degree of Master of Technology in Computer Science & Engineering from Lingaya’s University, Faridabad during the year 2014-2015. It is further certified that this work has not been submitted, either in part of in full, to any other department of the Lingaya’s University, or other University, institution or elsewhere, or for publication in any form. Date: Signature of the Student Anamika Sharma 13PCS001, 3 LINGAYA'S UNIVERSITY ACKNOWLEDGEMENT Firstly, I would like to express my most sincere appreciation to Mr. Suman Kumar Jha, Associate Prof. CSE Dept., Lingaya’s University, Faridabad, who acted as my thesis supervisor throughout the research period. Special thanks dedicated to her for her tremendous assistance in guiding me on how to do my research from the beginning till the day of submission. Her guidance, encouragement, comments, ideas and tolerance that led to a better quality of my research. Secondly, I would like to express my sincere thanks to Dr. Tapas Kumar, HOD, CSE Dept., Lingaya’s University, Faridabad, for their enormous support and encouragement in completion of my thesis work successfuly. Once again I thank him for giving me permission to use the college resources for the project. Thirdly, I would like to express my sincere thanks to Ms. Latha Banda, Asst. Prof. M.Tech (Dissertation & Project Coordinator, Class Councellor CSE Dept., Lingaya’s University, Faridabad, for her continuous efforts in encouraging and guiding me tolal complete my thesis work successfully. Thanks to my friends for providing a creation and challenging atmosphere. (Anamika Sharma) 4 TABLE OF CONTENTS CHAPTER NO TITLE PAGE NO ABSTRACT i LIST OF TABLES ii LIST OF FIGURES iii LIST OF ABBREVIATIONS iv LIST OF PUBLICATION v Chapter 1.INTRODUCTION Chapter 2. LITERATURE SURVEY 7 Chapter 3. METHODOLOGY Chapter 4. IMPLEMENTATION and result Chapter 5 . CONCLUSIONS AND FUTURE SCOPE 6. REFERENCES 5 LIST OF FIGURES FIGURE NO. NAME OF FIGURE 6 PAGE NO. LIST OF TABLE TABLE NO. NAME 7 PAGE NO. LIST OF PUBLICATION 1. “Identification of Alphanumeric pattern using Android “International Journal on Recent and Innovation Trends in Computing and Communication ISSN: 2321-8169 Volume: 3 Issue: 4 2466 – 2470 2 “ Managing the Organizational Network Security” International Journal of Innovations in Computing (ISSN : 2319-8257) Vol. 2 Issue 4 8 ABSTRACT In this paper, we present “Identification of Alphanumeric barcode character recognition using Android” character detection.scannar are widely used in a wide array of applications. In order to facilitate barcodes, users must have a method for scanning a barcode. The barcode scanner scans and identifies the characters present in the barcode. Barcode scanners only work if the barcode image is recognizable. In the event of image distortion, it will fail to recognize the characters. Our method overcomes this problem, by reliably identifying the characters using multiresolution analysis. This analysis, removes any existing noise by convoluting various filters. We also, apply morphological operators to fill the gaps that are caused during the noise filtering process. Once these gaps have been filled, we extract the characters. Each character is then compared with a predefined dictionary of characters by using two measures: correlation, and multiresolution approximate coefficient energy to find a matching character. Finally, we display the best matched character. The result suggests that this method is effectively capable of being applied to a broad range of barcodes. Security is playing a vital role in the field of communication system and Internet. Data encryption standard (DES) and the Rivest-Shamir-Adleman (RSA) algorithms are the two popular encryption algorithms that vouch confidentiality and authenticity over an insecure communication network and Internet. There has been paltry cryptanalytic progress against these two algorithms since their advent. This paper presents the comparison between the DES private key based Algorithm and RSA public key based algorithm. The main feature that specifies and differentiate one algorithm from another are the ability to the speed of encryption and decryption of the input plain text. It also includes several computational issues 9 1. CHAPTER INTRODUCTION 1.1 Introduction of Pattern Recognition Pattern recognition is the assignment of a physical object or event to one of several pre-specified categories [1]. It is an active field of research which has enormous scientific and practical interest. As [2] notes, it includes applications in “feature extraction, radar signal classification and analysis, speech recognition and understanding, fingerprint identification, character (letter or number) recognition, and handwriting analysis (‘notepad’ computers)”. Other applications include point of sale systems, bank checks, tablet computers, personal digital assistants (PDAs), handwritten characters in printed forms, face recognition, cloud formations and satellite imagery. Character is the basic building block of any language that is used to build different structure of a language. Characters are the alphabets and the structures are the words, strings and sentences etc. [3].As in [4] character recognition techniques as a subset of pattern recognition give a specific symbolic identity to an offline printed or written image of a character. Character recognition is better known as optical character recognition because it deals with the recognition of optically processed characters rather than magnetically processed ones. The main objective of character recognition is to interpret input as a sequence of characters from an already existing set of characters. The advantages of the character recognition process are that it can save both time and effort when developing a digital replica of the document. It provides a fast and reliable alternative to typing manually. 10 1.2 Alphanumeric character recognition The digital image goes through the following stages of a computer recognition system: 1. The preprocessing stage that enhances the quality of the input image and locates the data of interest. 2. The feature extraction stage that captures the distinctive characteristics of the digitized characters for recognition. 3. The classification stage that processes the feature vectors to identify the characters and words. 1.3 Design of Alphanumeric character recognition system Various approaches used for the design of OCR systems are discussed below: Matrix Matching Matrix matching converts each character into a pattern within a matrix, and compares the pattern with an index of known characters. Fuzzy Logic Fuzzy logic is a multi-valued logic that allows intermediate values to be defined between conventional evaluations like yes/no, true/false, black/white etc. An attempt is made to attribute a human-like way of logical thinking in the programming of computers. This is used when answers do not have distinct value. Feature Extraction This method defines character by the presence or absence of key features, including height, width density, loops and other character traits. Feature 11 extraction is a perfect approach for OCR of magazines, laser print and high quality images. Structural Analysis Structural Analysis identifies characters by examining their sub featuresshape of the image, sub-vertical and horizontal histograms. Its character repair capability is great for low quality text and newsprints. Artificial Neural Networks (ANN) This strategy simulates the way human neural system works. It samples the pixels in each image and matches them to a known index of character pixel patterns. A benefit of using Neural Network in OCR is extensibility of the system’s ability to recognize more character set that initially defined. Artificial Neural Networks are collections of mathematical model that represent some of the observed properties of biological nervous systems and draw on the analogies of adaptive biological learning. ANN consists of large number of highly interconnected processing elements (nodes) that are tied together with weighted connections (links). 1.4The scanner scans and identifies the characters present in the barcode. Barcode scanners only work if the barcode image is recognizable. In the event of image distortion, it will fail to recognize the characters. Our method overcomes this problem, by reliably identifying the characters using multiresolution analysis. This analysis, removes any existing noise by convoluting various filters. We also, apply morphological operators to fill the gaps that are caused during the noise filtering process. Once these gaps have been filled, we extract the characters. Each character is then compared with a predefined dictionary of characters by using two measures: correlation, and multiresolution approximate coefficient energy to find a matching character. Finally, we display the best matched character. The result 12 suggests that this method is effectively capable of being applied to a broad range of barcodes. Since this method is simple, efficient, and has a real-time response, it can be implemented in embedded systems. 1.5 ADHOC Network: The Ad hoc network is a network formed without any central administration which consists of mobile nodes that use a wireless interface to send packet data. Since the nodes in a network of this kind can serve as routers and hosts, they can forward packets on behalf of other nodes and run user applications. The roots of ad hoc networking can be traced back as far as 1968, when work on the ALOHA network was initiated (the objective of this network was to connect educational facilities in Hawaii).1 Although fixed stations were employed, the ALOHA protocol lent itself to distributed channelaccess management and hence provided a basis for the subsequent development of distributed channel-access schemes that were suitable for ad hoc networking. Adhoc network is A network without any base stations “infrastructure-less” or multi-hop A collection of two or more devices equipped with wireless communications and networking capability Supports anytime and anywhere computing Two topologies: Heterogeneous (left) • Differences in capabilities Homogeneous or fully symmetric (Right) all nodes have identical capabilities and responsibilities Self-organizing and adaptive – Allows spontaneous formation and deformation of mobile networks 13 Each mobile host acts as a router Supports peer-to-peer communications Supports peer-to-remote communications Reduced administrative cost Ease of deployment The ALOHA protocol itself was a single-hop protocol — that is, it did not inherently support routing. Instead every node had to be within reach of all other participating nodes. Inspired by the ALOHA network and the early development of fixed network packet switching, DARPA began work, in 1973, on the PRnet (packet radio network) —a multihop network.2 In this context, multihopping means that nodes cooperated to relay traffic on behalf of one another to reach distant stations that would otherwise have been out of range. PRnet provided mechanisms for managing operation centrally as well as on a distributed basis. As an additional benefit, it was realized that multihopping techniques increased network capacity, since the spatial domain could be reused for concurrent but physically separate multihop sessions. Although many experimental packetradio networks were later developed, these wireless systems did not ever really take off in the consumer segment. When developing IEEE 802.11 —a standard for wireless local area networks (WLAN)—the Institute of Electrical and Electronic Engineering (IEEE) replaced the term packet-radio network with ad hoc network. Packet-radio networks had come to be associated with the multihop networks of large-scale military or rescue operations, and by adopting a new name, the IEEE hoped to indicate an entirely new deployment scenario. Today, our vision of ad hoc networking includes scenarios such as those depicted in Figure 1, where people carry devices that can network on an ad hoc basis. A user’s devices can 14 both interconnect with one another and connect to local information points—for example, to retrieve updates on flight departures, gate changes, and so on. The ad hoc devices can also relay traffic between devices that are out of range. The airport scenario thus contains a mixture of single and multiple radio hops. To put ad hoc networking in its right perspective, let us make some observations about wireless communication, beginning with present-day cellular systems, which rely heavily on infrastructure: coverage is provided by base stations, radio resources are managed from a central location, and services are integrated into the system Today, many people carry numerous portable devices, such as laptops, mobile phones, PDAs and mp3 players, for use in their professional and private lives. For the most part, these devices are used separately—that is, their applications do not interact. Imagine, however, if they could interact directly: participants at a meeting could share documents or presentations; business cards would automatically find their way into the address register on a laptop and the number register on a mobile phone; as commuters exit a train, their laptops could remain online; likewise, incoming email could now be diverted to their PDAs; finally, as they enter the office, all communication could automatically be routed through the wireless corporate campus network. These examples of spontaneous, ad hoc wireless communication between devices might be loosely defined as a scheme, often referred to as ad hoc networking, which allows devices to establish communication, anytime and anywhere without the aid of a central infrastructure. Actually, ad hoc networking as such is not new, but the setting, usage and players are. In the past, the notion of ad hoc networks was often associated with communication on combat fields and at the site of a disaster area; now, as novel technologies such as Bluetooth materialize, the scenario of ad hoc networking is likely to change, as is its importance. 15 1.5.1 Adhoc Applications: Mobile ad hoc networks have been the focus of many recent research and development efforts. So far, ad hoc packet-radio networks have mainly been considered for military applications, where a decentralized network configuration is an operative advantage or even a necessity. In the commercial sector, equipment for wireless, mobile computing has not been available at a price attractive to large markets. However, as the capacity of mobile computers increases steadily, the need for unlimited networking is also expected to rise. Commercial ad hoc networks could be used in situations where no infrastructure (fixed or cellular) is available. Examples include rescue operations in remote areas, or when local coverage must be deployed quickly at a remote construction site. Ad hoc networking could also serve as wireless public access in urban areas, providing quick deployment and extended coverage. The access points in networks of this kind could serve as stationary radio relay stations that perform ad hoc routing among themselves and between user nodes. Some of the access points would also provide gateways via which users might connect to a fixed backbone network.5 At the local level, ad hoc networks that link notebook or palmtop computers could be used to spread and share information among participants at a conference. They might also be appropriate for application in home networks where devices can communicate directly to exchange information, such as audio/video, alarms, and configuration updates. Perhaps the most far-reaching applications in this context are more or less autonomous networks of interconnected home robots that clean, do dishes, mow the lawn, perform security surveillance, and so on. Some people have even proposed ad hoc multihop networks (denoted sensor networks)— 16 for example, for environmental monitoring, where the networks could be used to forecast water pollution or to provide early warning of an approaching tsunami.6 Short-range ad hoc networks can simplify intercommunication between various mobile devices (such as a cellular phone and a PDA) by forming a PAN, and thereby eliminate the tedious need for cables. Also extend the mobility provided by the fixed network (that is, mobile IP) to nodes further out in an ad hoc network domain. The Bluetooth system is perhaps the most promising technology in the context of personal area networking. 1.5.2 Design Principles Terminal Device Selection In this section, we start by selecting a platform that is most suitable for mobile users to run ad-hoc applications. We consider the following criteria: (1) Portability: to make the best use of mobile ad-hoc applications, the terminal device has to be portable so that the user can run ad-hoc applications anytime and anywhere. (2) Availability: to establish ad-hoc networks, there must be enough devices in the vicinity of the user. (3) Security awareness: in the ad-hoc network, unidentified devices can exist that may be malicious to the user. Therefore, each device should be able to identify itself when requested to do so in a secure manner. As for (1), when considering cases where ad-hoc applications are used on the road or on a train, a laptop PC is not portable enough. Handheld devices are required; such as a cellular phone or at the most a PDA. As for (2), to use ad-hoc applications anytime and anywhere, PDAs are not widely used. Cellular phones, or at least regular PCs including laptops are required. As for (3), a secure device authentication mechanism is required. To this end, a common PKI system or a trusted service provider as well as an access method is required. To meet these criteria, a mobile phone terminal can be considered as one of the most suitable candidates and it will therefore become a real driving force for ad17 hoc communications. As ad-hoc networks consist of mobile terminals without any servers, ensuring the functions of security and authentication is not taken for granted, which is also raising concerns among mobile users. As mobile phone terminals originally communicate via cellular networks, co-operation with those cellular networks enables ad-hoc networks to have these functions through the servers of trusted cellular providers. Co-operation with cellular networks also enables the use of existing Web applications. Moreover, in regions where cellular networks are out of service, ad-hoc networks can connect to cellular networks by multi-hop links. On the other hand, the disadvantages of ad-hoc networks on mobile phone terminals are (1) limitation of resources and (2) limitation of implementation platforms. (1) Limitation of resources: Although mobile phone terminals have become smarter, they have limited resources, memory, CPU speed and power, as compared to laptop PCs or PDAs. (2) Limitation of implementation platforms: While many mobile phone terminals provide programming platforms such as JAVA, only a few platforms can access devices such as wireless interfaces. It is necessary to take into account these advantages and disadvantages in order to implement ad-hoc networks on mobile phone terminals 1.5.3 Protocol Efficiency Ad-hoc networks are constructed only by mobile terminals without any infrastructure. Mobile terminals can move freely in ad-hoc networks. Thus, it is necessary to develop quick and efficient procedures to establish routes, find a communication target and transmit data. From this perspective, on-demand ad-hoc routing protocols are suitable for implementation on mobile phone terminals. Many ad-hoc routing protocols use a flooding mechanism in the path discovery process. However, the flooding mechanism consumes wireless resources and is heavily 18 dependent on link-layer technologies. Thus, a more effective and suitable flooding mechanism is required for mobile phone terminals and their communication interfaces. Moreover, in standardized ad-hoc routing protocols, route establishment and data transmission are separately executed. However, as mobile phone terminals have limited resources, co-operation between route establishment and data transmission is desirable. \ 1.6 Cryptography: Cryptography is the science of using mathematics to encrypt and decrypt the data. Cryptography enables you to store sensitive information or transit it across insecure network (like the internet ) so that it convert be read by anyone except the intended recipient.while cryptography is the scince of securing data ,cryptanalysis is the science of analyzing and braking secure communication. The process of encoding the plaintext into cipher text is called Encryption and reverse the process of decoding ciphers text to plaintext is called Decryption. This can be done by two techniques symmetric-key cryptography and asymmetric key cryptography. Symmetric key cryptography involves the usage of the same key for encryption and decryption. But the Asymmetric key cryptography involves the usage of one key for encryption and another, different key for decryption. Secret key cryptography includes DES, AES, 3DES, IDEA, Blowfish algorithms etc. and public key cryptography includes RSA, Digital Signature and Message Digest algorithms [10],[14]. For each algorithm there are two key aspects used: Algorithm type (define size of plain text should be encrypted per step) and algorithm mode (define cryptographic Algorithm mode). Algorithm mode is a combination of a series of the basic algorithm and some block cipher and some 19 feedback from previous steps. We compare and analyzed algorithms DES and RSA [6]. Cryptanalyst are also called attackers .Cryptology embrace both Cryptography and cryptanalysis. Plain Text Cipher Text A B Shared Key Secret Key Encryption Network Decryption er cipher text Figure 1.9: Cryptography. 1.6.1 Encryption Algorithm : The Encryption algorithms are widely available and used in information security [8, 9, 10]. They can be categorized into Symmetric (private) and Asymmetric (public) keys encryption. In Symmetric keys encryption or secret key encryption, only one key is used to encrypt and decrypt data. 20 In Asymmetric keys, two keys are used; private and public keys. Public key is used for encryption and private key is used for decryption (e.g. RSA and ECC). Public key encryption is based on mathematical functions, computationally intensive and is not very efficient for small mobile devices [4, 6, 14]. There are many examples of strong and weak keys of cryptography algorithms like RC2, DES, 3DES, RC6, Blowfish, and AES. RC2 uses one 64-bit key. DES uses one 64-bits key. Triple DES (3DES) uses three 64-bits keys while AES uses various (128,192,256) bits keys. Blowfish uses various (32-448); default 128bits while RC6 is used various (128,192,256) bits keys [2, 3, 5, 6, 8, 13, 14, 15, 17]. The process of encoding the plaintext into cipher text is called Encryption and reverse the process of decoding ciphers text to plaintext is called Decryption. This can be done by two techniques symmetric-key cryptography and asymmetric key cryptography. Symmetric key cryptography involves the usage of the same key for encryption and decryption. But the Asymmetric key cryptography involves the usage of one key for encryption and another, different key for decryption. Secret key cryptography includes DES, AES, 3DES, IDEA, Blowfish algorithms etc. and public key cryptography includes RSA, Digital Signature and Message Digest algorithms [10],[14]. For each algorithm there are two key aspects used: Algorithm type (define size of plain text should be encrypted per step) and algorithm mode (define cryptographic Algorithm mode). Algorithm mode is a combination of a series of the basic algorithm and some block cipher and some feedback from previous steps. We compare and analyzed algorithms DES and RSA [6]. 21 1.6.2 DATA ENCRYPTION STANDARD DES is a block cipher. It encrypts the data in a block of 64 bits. It produces 64 bit cipher text. The key length is 56 bits. Initially the key is consisting of 64 bits. The bit position 8, 16, 24, 32,40,48,56, 64 discarded from the key length [16]. Figure 1.6.2 The conceptual working with DES DES is based on two fundamental attributes of cryptography: Substitution (confusion) and transposition (Diffusion). DES consists of 16 steps, each of which called as a Round. 22 Algorithm:[1] In the first step, the initial 64-bit plain text block is handed over to Initial Permutation (IP) function. [2] The Initial permutation is performed on plain text. [3] The initial permutation produces two halves of permuted block: Left Plain text (LPT) and Right Plain (RPT [4] Now, each of LPT and RPT goes through 16 rounds of the encryption process, each with its own key: a. From the 56-bit key, a different 48-bit Sub-key is generated using Key Transformation. b. Using the Expansion Permutation, the RPT is expended from 32 bits to 48 bits. c. Now, the 48-bit key is XORed with 48-bit RPT and the resulting output is given in the next step. d. Using the S-box substitution produce the 32-bit from 48-bit input. e. These 32 bits are permuted using P-Box Permutation. f. The P-Box output 32 bits are XORed with the LPT 32 bits. g. The result of the XORed 32 bits is become the RPT and old RPT become the LPT.This process is called as swapping. h. Now the RPT again given to the next round and performed the 15 more rounds. 23 [5] After the completion of 16 rounds the Final Permutation is performed [10], [17]. Encryption algorithms consume a significant amount of computing resources such as CPU time, memory, and battery power. Battery power is subjected to the problem of energy consumption due to encryption algorithms. Battery technology is increasing at a slower rate than other technologies. This causes a “battery gap” [1, 12]. We need a way to make decisions about energy consumption and security to reduce the consumption of battery powered devices. This study evaluates six different encryption algorithms namely; AES, DES, 3DES, RC6, Blowfish, and RC2. The performance measure of encryption schemes will be conducted in terms of energy, changing data types - such as text or document, Audio data and video datapower consumption, changing packet size and changing key size for the selected cryptographic algorithms. 1.6.3 THE RSA ALGORITHM This is a public key encryption algorithm developed by Ron Rivest, Adi Shamir and Len Adlemen in 1977.The asymmetric key cryptographic algorithm. The RSA algorithm is based on the mathematical fact that it is easy to find and multiply large prime numbers together, but it is extremely difficult to factor their product. The private and public keys in the RSA are based on very large (made up of 100 or more digits) prime numbers. The algorithm itself is quite simple (unlike the symmetric key . 24 Figure1.6.3: Working of RSA Algorithm: [1] Choose two large prime numbers P and Q. [2] Calculate N= P X Q. [3] Select the public key (i.e. the encryption key) E such that it is not a factor of (P1) and (Q-1). [4] Select the private key (i.e. the decryption key) D such that the following equation is true: (D X E) mod (P-1) X (Q-1) =1 [5] For encryption, calculate the cipher text CT from text PT as follows: CT = PTE mod N [4], [10].cryptographic algorithms). 25 However, the real challenge in Encryption is the process of translating plain text data (plaintext) into something that appears to be random and meaningless (ciphertext). Decryption is the process of converting ciphertext back to plaintext.To encrypt more than a small amount of data, symmetric encryption is used. A symmetric key is used during both the encryption and decryption processes. To decrypt a particular piece of ciphertext, the key that was used to encrypt the data must be used. Encryption refers to any process used to make sensitive data more secure and less likely to be intercepted by those unauthorized to view it.There are several modern types of encryption used to protect sensitive electronic data, such as emails, files, folders and entire drives. It's very important to understand what kinds of encryption are most important for a particular need, and to not be lulled into a false sense of security by fancy-sounding process names. There are many encryption programs that provide excellent security for very little money sometimes even for free. For example, consider the folder-encryption options available to users of the Microsoft Windows operating system. Microsoft's encryption is generally strong, meaning that most users won't have to seek out additional methods of protecting their sensitive financial data, medical records and other sensitive files.Or, if you're worried about Microsoft's alleged relationship with the U.S. National Security Agency, try TrueCrypt, an open-source, free-to-use software solution. The most dangerous pitfall of folder encryption is that there may be temporary versions of the sensitive files that are not encrypted.Consider this: Most computer users regularly save their work to avoid catastrophic data loss due to a power outage, electrical storm or other unexpected event. Each time the user saves a file 26 in progress, a temporary version of that file is created and stored in the aptly named "temp" folder, where it remains unencrypted.Simply deleting temp files isn't enough protection, either. Someone who wants to access your data badly enough will likely be able to access those files. Base cryptographic functions are in the following broad groups: Service Provider Functions Key Generation and Exchange Functions Object Encoding and Decoding Functions Data Encryption and Decryption Functions Hash and Digital Signature Functions Encryption time is used to calculate the throughput of an encryption scheme. The throughput of the encryption scheme is calculated by dividing the total plaintext in Megabytes encrypted on the total encryption time for each algorithm in. As the throughput value is increased, the power consumption of this encryption technique is decreased 1.7 Android framework Android application on for Identification of Alphanumeric pattern. This application fully implement in Android operating system. The application we developed enables the users to get text translate as ease as a button click. The camera captures the text and returns the translated result in real time. Early techniques were based mostly on template matching, simple line and geometric features, stroke detection, and the extraction of their derivatives. Such techniques were not sophisticated enough for practical recognition of data handwritten on forms or documents. 27 The Android is a Linux-based operating system whose code was released by Google under the Apache license, is used primarily in touch screen devices. Android structure consist the Linux kernel layer which provides memory management, security settings, power management, hardware abstraction, etc. 1.7.1 Android architecture Android operating system is a stack of software components which is roughly divided into five sections and four main layers as shown below in the architecture diagram. 28 Android makes it easier for consumers to get and use new content and applications on their Smart phones , presents an extremely on-demand, fast and user friendly Android Application. the application has built in OCR suite as well as Image Processing suite both installed in the Android device. It provides fast, robust and extremely high Quality performance because of having improved Auto focus behavior, continuous dynamic preview and improved noise tolerance feature 1.7.2 Android application development: Microsoft Windows XP or later version. Mac OS X 10.5.8 or later version with Intel chip. Linux including GNU C Library 2.7 or later. Second point is that all the required tools to develop Android applications are freely available and can be downloaded from the Web. Following is the list of software's you will need before you start your Android application programming. Java JDK5 or JDK6. Android SDK Eclipse IDE for Java Developers (optional) Android Development Tools (ADT) Eclipse Plugin (optional) You will find all the Android application at the top layer. You will write your application to be installed on this layer only. Examples of such applications are Contacts Books, Browser, Games etc. •runs on its own Process •runs on its own Instance of Dalvik VM •is assigned its own Linux user ID . 29 1.7.3 Android libraries On top of Linux kernel there is a set of libraries including open-source Web browser engine WebKit, well known library libc, SQLite database which is a useful repository for storage and sharing of application data, libraries to play and record audio and video, SSL libraries responsible for Internet security etc. 3.9.1 Android’s native libraries. Libc: c standard lib. SSL: Secure Socket Layer SGL: 2D image engine OpenGL|ES: 3D image engine Media Framework: media codecs SQLite: Database engine WebKit: Kernel of web browser FreeType: Bitmap and Vector SufraceManager: Compose window manager with off-screen buffering. Core Libraries Provides the functionality of the JAVA Programming Language Dalvik VM -A type of Java Virtual Machine Register based (not stack machine like JVM) Optimization for low memory requirements 30 2. CHAPTER LITERATURE SURVEY 2.1 Literature survey 2.2 A history of Alphanumeric pattern recognition To understand the phenomena described in the above section, we have to look at the history Alphanumeric pattern recognition , its development, recognition methods, computer technologies, and the differences between humans and machines . It is always fascinating to be able to find ways of enabling a computer to mimic human functions, like the ability to read, to write, to see things, and so on. Alphanumeric pattern recognition research and development can be traced back to the early 1950s, when scientists tried to capture the images of characters and texts, first by mechanical and optical means of rotating disks and photomultiplier, flying spot scanner with a cathode ray tube lens, followed by photocells and arrays of them.[3] At first, the scanning operation was slow and one line of characters could be digitized at a time by moving the scanner or the paper medium. Subsequently, the inventions of drum and flatbed scanners arrived, which extended scanning to the full page. Then, advances in digital-integrated circuits brought photoarrays with higher density, faster transports for documents, and higher speed in scanning and digital conversions. These important improvements greatly accelerated the speed of character recognition and reduced the cost, and opened up the possibilities of processing a great variety of forms and documents.[5] 31 In parallel with these advances in hardware development, intensive research on character recognition was taking place in the research laboratories of both academic and industrial sectors . Although both recognition techniques and computers were not that powerful in the early days (1960s), Alphanumeric pattern recognition machines tended to make lots of errors when the print quality was poor, caused either by wide variations in typefonts and roughness of the surface of the paper or by the cotton ribbons of the typewriters . To make Alphanumeric pattern recognition work efficiently and economically, there was a big push from Alphanumeric pattern recognition manufacturers and suppliers toward the standardization of print fonts, paper, and ink qualities for Alphanumeric pattern recognition applications. These special fonts were quickly adopted by the International Standards Organization (ISO) to facilitate the recognition process . As a result, very high recognition rates became achievable at high speed and at reasonable costs. Such accomplishments also brought better printing qualities of data and paper for practical applications. Actually, they completely revolutionalized the data input industry [6] 2.3 Development of new techniques As Alphanumeric pattern recognition research and development advanced, demands on handwriting recognition also increased because a lot of data (such as addresses written on envelopes; amounts written on checks; names, addresses, identity numbers, and dollar values written on invoices and forms) were written by hand and they had to be entered into the computer for processing. But early Alphanumeric pattern recognition techniques were based mostly on template matching, simple line and geometric features, stroke detection, and the extraction of their derivatives. Such techniques were not sophisticated enough for practical 32 recognition of data handwritten on forms or documents. To cope with this, the Standards Committees in the United States, Canada, Japan, and some countries in Europe designed some handprint models in the 1970s and 1980s for people to write them in boxes . Hence, characters written in such specified shapes did not vary too much in styles, and they could be recognized more easily by Alphanumeric pattern recognition machines, especially when the data were entered by controlled groups of people, for example, employees of the same company were asked to write their data like the advocated models. Sometimes writers were asked to follow certain additional instructions to enhance the quality of their samples, for example, write big, close the loops, use simple shapes, do not link characters, and so on. With such constraints, Alphanumeric pattern recognition recognition of handprints was able to flourish for a number of years.[9] 2.4 Recent trends and movements As the years of intensive research and development went by, and with the birth of several new conferences and workshops such as IWFHR (International Workshop on Frontiers in Handwriting Recognition) ,1 ICDAR (International Conference on Document Analysis and Recognition) ,2 and others , recognition techniques advanced rapidly. Moreover, computers became much more powerful than before. People could write theway they normally did, and characters need not have to be written like specified models, and the subject of unconstrained handwriting recognition gained considerable momentum and grew quickly. As of now, many new algorithms and techniques in preprocessing feature extraction, and powerful classification methods have been developed. [12] 33 2.5 Generic form-processing system This section will introduce the general concept of an intelligent form- processing system that can serve as the kernel of all form-processing applications. The input of a typical form-processing system consists of color or gray level images in which every several hundred pixels corresponds to a linear inch in the paper medium. The output, on the contrary, consists of ASCII strings that usually can be represented by just a few hundred bytes. To achieve such a high level of data abstraction, a form-processing system depends on the following main components for information extraction and processing: (a)Image acquisition: acquire the image of a form in color, gray level, or binary format. (b) Binarization: convert the acquired form images to binary format, in which the foreground contains logo, the form frame lines, the preprinted entities, and the filled in data. (c) Form identification: for an input form image, identify the most suitable form model from a database. (d) Layout analysis: understand the structure of forms and the semantic meaning of the information in tables or forms. (e) Data extraction: extract pertinent data from respective fields and preprocess the data to remove noise and enhance the data. (f )Character recognition: convert the gray or binary images that contain textual information to electronic representation of characters that facilitate postprocessing including data validation and syntax analysis. Each of the above steps reduces the amount of the information to be processed by a later step. Conventional approaches pass information through these components in a cascade manner and seek the best solution for each step. The rigid system architecture and constant information flowing direction limit the 34 performance of each component to local maximum. The observation from data in real-life applications and the way humans read distorted data lead us to construct a knowledge-based, intelligent form processing system. Instead of simply concatenating general-purpose modules with little consideration of the characteristics of the input document, the performance of each module is improved by utilizing as much knowledge as possible, and the global performance is optimized by interacting with the knowledge database at run-time. To give more prospective about the performance of the compared algorithms, this section discusses the results obtained from other resources. It was shown in [14] that energy consumption of different common symmetric key encryptions on hand held devices. It is found that after only 600 encryptions of a 5 MB file using Triple-DES the remaining battery power is 45% and subsequent encryptions are not possible as the battery dies rapidly. It was concluded in [7] that AES is faster and more effi- cient than other encryption algorithms. When the transmission of data is considered there is insignificant difference in performance of different symmetric key schemes (most of the resources are consumed for data transmission rather than computation). Even under the scenario of data transfer it would be advisable to use AES scheme in case the encrypted data is stored at the other end and decrypted multiple times. A study in [19] is conducted for different popular secret key algorithms such as DES, 3DES, AES, and Blowfish. They were implemented, and their performance was compared by encrypting input files of varying contents and sizes. The algorithms were tested on two different hardware platforms, to compare their performance. They had conducted it on two different machines: P-II 266 MHz and P-4 2.4 GHz. The results showed that Blowfish had a very good performance compared to other algorithms. Also it showed that AES had a better performance than 3DES and DES. It also shows that 3DES has almost 1/3 throughput of DES, or in other words it needs 3 times than DES to process the 35 ame amount of data [20]. In [11] a study of security measure level has been proposed for a web programming language to analyze four Web browsers. This study consider of measuring the performances of encryption process at the programming language’s script with the Web browsers. This is followed by conducting tests Experimental in order to obtain the best encryption algorithm versus Web browser. In information security,they can be categorized into Symmetric (private) and Asymmetric (public) keys encryption. In Symmetric key sencryption or secret key encryption, only one key is used to encrypt and decrypt data. In Asymmetric keys, two keys are used; private and public keys [1]. Publickey is used for encryption and private key is used for decryption (e.g. RSA). Public key encryption is based on mathematical functions, computationally intensive. There are many examples of strong and weak keys of cryptography algorithms like DES, AES. DES uses one 64-bits key while AES uses various 128,192,256 bits keys [2]. Asymmetric key encryption or public keyencryption is used to solve the problem of key distribution. In Asymmetric keys, two keys are used; private and public keys. Public key is used for encryption and private key is used for decryption (E.g. RSA and Digital Signatures). Because users tend to use two keys: public key, which is known to the public and private key which is known only to the user[2]. There is no need for distributing them prior to transmission. However, public key encryption is based on mathematical functions, computationally intensive and is not very efficient for small mobile devices [3]. Asymmetric encryption techniques are almost 1000 Recent advancements in wireless communication technologies have attracted ad-hoc networking, which enables mobile users to communicate 36 with each other without any infrastructure. While many ad-hoc routing protocols have been proposed, ad-hoc communication and its applications are not widespread. To expedite the widespread use of ad-hoc communications, we turn our attention to the handiest wireless device, namely, a mobile phone terminal. More mobile phones have been equipped with short distance wireless interfaces such as wireless LAN and Bluetooth. When ad-hoc communication is realized on such mobile phones with these wireless interfaces, ad-hoc communications will be available almost anytime and anywhere, which we believe will become a driving force for ad-hoc networking technology. On the other hand, while the performance of mobile phones has improved greatly over the past several years, their resources are still limited compared to laptop PCs. Therefore, to realize ad-hoc communication in mobile phones, this limitation should be considered. In this paper, we first set the design principles for mobile ad-hoc communications based on the assumed use cases and implement ad-hoc networking protocols as well as their applications on mobile phone terminals to verify their effectiveness. Through the performance evaluations, we discuss performance characteristics and potential application area Implementation of ad-hoc routing protocols is reported from some research groups. AODV, one of the on-demand ad-hoc routing protocols, is implemented on actual machines [6][7]. Both implementations support the Linuxbased platform and [6] implements AODV on PDAs that have ARM-based architecture. OLSR is a proactive type ad-hoc routing protocol and is also implemented on Linux, Windows and the ARM architecture [8][9]. The implementations of AODV and OLSR use IEEE 802.11 Wireless LAN as the short-range wireless interface. In the IEEE 802.11 standard, ad-hoc mode is used for peer-to-peer communication without infrastructure. Bluetooth is another short37 range wireless interface. Bluetooth uses the Industrial Scientific and Medical (ISM) band, which can be freely used in most countries. Bluetooth specification defines a Piconet as a network where up to eight terminals connect with each other. In the Piconet, a master terminal controls multiple simultaneous connections to slave terminals [10]. Scatternet is defined as a group of independent and nonsynchronized Piconets. Communication of two Piconets is via gateway terminals that belong to the two Piconets. Paper [10] reports that Piconets and Scatternets increase the efficiency of channel use by the Frequency Hop spread spectrum as compared to Wireless LAN that shares frequency in the same radio propagation area. The Piconet and the Scatternet are special types of ad-hoc networks. The cluster-based ad-hoc routing protocol is proposed as the routing protocol in Piconets and Scatternets [11]. In cluster-based ad-hoc routing protocols, the terminal called the cluster head controls route establishment and traffic in the cluster. As Scatternet consists of multiple Piconets and data transmission in Piconets is controlled by master terminals, cluster-based ad-hoc routing protocols are suitable for Piconets and Scatternets. However, in clusterbased ad-hoc routing protocols, data transmission is limited to only some of the terminals, such as the cluster head or the master terminal in a Piconet. When terminals have limited wireless resources and power, it is necessary to examine routing protocols in which all terminals consume available resources equally. In Bluetooth networks, the Inquery process is defined for each terminal to find adjacent terminals. As the Inquery process requires several seconds to find adjacent terminals, there is a problem with applying the Inquery process to adhoc networks. Paper [12] proposes a simple adjacent terminal discovery process. The proposed method improves the discovery time by simplifying the Inquery process. Thus, it differs from ad-hoc networks over Wireless LAN and contains many of the features of Bluetooth ad38 hoc networks. We need this difference and the features to implement Bluetooth adhoc networks. Bluetooth ad-hoc networks are evaluated by computer simulation in many studies. However, some implementations on actual machines are reported from some research groups. Paper [13] reports the design and implementation of indoor positioning over Bluetooth ad-hoc networks. The proposed system measures the positioning of devices by Bluetooth and transmits positioning results via Bluetooth ad-hoc networks. The proposed system is implemented on laptop PCs. While many studies report implementation on PCs or PDAs, the implementation of ad-hoc networks on mobile phone terminals has not been reported. As mobile phone terminals have limited memory resources and power compared to note PCs or PDAs, it is necessary to take into account of limitation for implementation 39 3.CHAPTER METHODOLOGY 3.1 Introduction The whole recognition process consists of four basic steps: (a) preprocessing, (b) normalized character matrix creation, (c) network establishment (d) recognition. . The operations of the network implementation in this project can be summarized by the following steps: Training phase o Analyze image for characters o Convert symbols to pixel matrices o Retrieve corresponding desired output character and convert to Unicode o Lineraize matrix and feed to network o Compute output o Compare output with desired output Unicode value and compute error o Adjust weights accordingly and repeat process until preset number of iterations Testing phase o Analyze image for characters o Convert symbols to pixel matrices o Compute output o Display character representation of the Unicode output (A)Proposed character recognition scheme The flowchart of our proposed character recognition scheme 40 (B)Proposed System Architecture Alpha numeric character reconization Dataset using mlibrary 41 Capture Image ADHOC Encryption Network Algorithm Server The whole recognition process consists of four basic steps: (e) preprocessing, (f) normalized character matrix creation, (g) network establishment (h) recognition 3.1.1Preprocessing Preprocessing consists of digitization, noise removal and boundary detection of the digitized character matrix. 3.1.1.1 Binarization or digitization In order to able to recognize characters by computer the character image is first digitized into a matrix i.e. transformed into a binary form for the ease of handling by the system .The image is first converted to the gray scale image as follows Y= (int) (0.33 * R + 0.56 *G +0.11 *B) Where, R is the red component of a color pixel, G is the green component of a color pixel, B is the blue component of a color pixel and Y is the value of a pixel in a gray scale level. The image is then converted to binary. Just replace all the gray levels of the image into binary value 0(for gray level value 129 to 255) treated as absence of writing or 1 (for gray level value 0 to 128) treated as presence of writing 42 Fig :- Digitized binary matrix of the sample character 2 and Z respectively 3.1.1.2 Boundary Detection After creating the digitized binary matrix from the input character image, the detection of boundary is very much important to recognize character correctly. The boundary detection procedure is therefore given by [12] (i). For top boundary detection, scan the character matrix starts at the top-left corner and remove all rows from top having only 0’s. To detect top boundary there must be at least two consecutive 1’s in two consecutive rows. Then the first row of the two consecutiverows from top will be selected as top boundary. (ii) For bottom boundary detection, scan the character matrix starts at the bottomleft corner and remove all rows from bottom having only 0’s. To detect bottom boundary there must be at least two consecutive 1’s in two consecutive rows. Then the first row of the two consecutive rows from bottom will be selected as bottom boundary. 43 (iii.) For left boundary detection, scan the character matrix starts at the top-left corner and remove all columns from left having only 0’s. To detect left boundary there must be at least two consecutive 1’s in two consecutive columns. Then the first column of the two consecutive columns from left will be selected as left boundary. iv. For right boundary detection, scan the character matrix starts at the top-right corner and remove all columns from right having only 0’s. To detect right boundary there must be at least two consecutive 1’s in two consecutive columns. Then the first column of the two consecutive columns from right will be selected as right boundary. In figure , we show the binary matrix of the sample character 2 and Z shown in figure after detecting boundary Figure . Boundary detection of the digitized sample character 2 and Z respectively shown in figure 3.1.1.3 Normalization Normalization is the process of equating the size of all extracted character bitmaps (binary array).For size invariant character recognition, we have converted the boundary detected input character matrix into 12×8 normalized matrix. The normalization procedure is as follows: 44 i. Take top row and left column assuming they contain salient features. ii. Then take alternate row and column until desired 12×8 character matrix i Found. For example, the size of input character (after boundary detection) is 15×11.Then during normalization, a. take first row b. delete row 2,4,6 c. Take the entire remaining row d. Converted the matrix to 12×11 iii. Similar process for column as in ii (a-d). Finally the matrix is converted to 12×8. In figure, we show the two different representation of normalized 12×8 matrix of the each sample character 2 and Z. The position of 1’s in two normalized character matrix may be different because of different sizes of the same character are normalized into 12×8 matrix Figure . Different representation of normalized matrix (a) 12×8 matrix of numeric digit 2 (b) 12×8 matrix of character Z. Ad hoc Network Implementation 45 According to the design principles denoted in Section 3, this section shows our implementation of ad-hoc communication and ad-hoc applications to mobile phone terminals As for the link-layer protocol for ad-hoc communications, several access control methods can be considered such as Wireless LAN, Bluetooth or ZigBee. Among these technologies, we selected Bluetooth for our implementation. Bluetooth is relatively widely implemented on mobile phone terminals and stable in an infrastructureless network. The specifications of the mobile phone terminals that were used are shown in Table 1. Bluetooth defines profiles that provide the available functions. In our implementation, applicable profiles of Bluetooth are SPP, HSP, DUN, BIP, OPPP and OBEX. The implementation platform use was the Binary Runtime Environment for Wireless (BREW). BREW is a programming platform for mobile phone terminals, for which C and C++ are available as programming languages. One of the characteristics of the BREW platform is the function of accessing devices such as address books and Bluetooth interfaces on mobile phone terminals. The version of BREW used in our implementation was 2.1. Implementation Stack On the BREW platform, we developed a new implementation stack as shown in Figure 1. The implementation stack consists of three control units; a radio control unit that handles Bluetooth communication, a network control unit that establishes routes and forwards data packets and a user application control unit that includes the user interface and user applications 46 Figure : Implementation stack. As shown in Figure 2, the control sequence has three phases, the initial phase, the route establishment phase and the user application execution phase. In the initial phase, the radio control unit carries out device discovery that finds adjacent terminals. In the route establishment phase, when acommunication request occurs in the user application control unit, the network control unit begins the path discovery process. In the path discovery process, a control message is broadcast or unicast by the radio control unit. After establishing routes, in the user application execution phase, user data is forwarded via routes obtained in the route establishment phase. In the user application execution phase, the radio control unit transmits user data by unicasting. The details of each of the control units are shown in the following sections Fig:Radio Control Unit 47 The radio control unit supports data transmission with adjacent terminals via the Bluetooth interface. The radio control unit carries out device discovery and broadcast/unicast of data transmissions. (1) Device discovery: The Bluetooth device has a 48-bit address that uniquely specifies each device. The Bluetooth Inquery process finds device addresses of adjacent terminals. These device addresses are registered in the device address table, which is managed in each mobile phone terminal. In the device address table, only the active device addresses are registered. If link failure or transmission failure occurs, thecorresponding device address is deleted from the device address table. (2) Unicast and Broadcast: Bluetooth can realize ad-hoc networks through Piconets or Scatternets. However, only the six Bluetooth profiles shown in Table 1 are available in our implementation. So, our platform does not support Piconets and Scatternets. Then, we use the Serial Port Profile (SPP) to transmit data to adjacent terminals. The SPP allows Bluetooth devices to perform serial cable emulation. The SPP has two transmission modes, a client mode and a server mode. In the SPP connection, data istransmitted from the client mode terminal to the server mode terminal. In unicast transmission, mobile phone terminals set the destination device address to the next hop terminalreferenced from the device address table. On the other hand, SPP does not support broadcast transmission. Then, the broadcast transmission is realized in a pseudo manner by unicast SPP transmission. When the broadcast transmission is required, for example, at the beginning of the path discovery process, the mobile phone terminal connects to an adjacent terminal selected from the entries in the device address table. After this unicast transmission, the sending 48 terminal connects to another terminal by SPP until it finishes transmission to all the terminals listed in the device address table. Thus, SPP connections are repeated for each of addresses registered in the device address table. Network Control Unit The network control unit realizes packet forwarding and route establishment. (1) Packet forwarding: To transmit control messages and data messages, we use IP and transport layer protocol stacks. While IP and transport layer protocol stacks are already prepared as part of the Application Programming Interface (API) in the BREW platform, this API is not available for Bluetooth communication. So, we implemented new stacks customized for Bluetooth communication. Each terminal has a routing table to determine the next hop terminal. The routing table is constructed by the route establishment method. (2) Route establishment: To establish routes, we implemented the on-demand adhoc routing protocol, AODV, according to the considerations in Section 3.3. AODV carries out the following path discovery process.A source terminal begins flooding a Route Request(RREQ) when a communication request from a userapplication occurs and the terminal does not have the route to the destination. The RREQ includes the IP address of the destination terminal and the source terminal. Terminals that receive the RREQ register a reverse route to the source terminal in their routing table. When the destination terminal receives the RREQ, it unicasts a Route Reply 49 (RREP) to the source terminal. The RREP provides the information on the destination terminal. If the terminal that receives the RREQ is not the destination, the RREQ is rebroadcast. When terminals receive the RREP, they make the forward route to the destination. After the source terminal receives the RREP, it begins data transmission of the user application. (2) Extension of path discovery: According to the considerations in Section 3.2 andSection 3.3, we extended the path discovery process fromthe view of discovery of unspecified communication targetsand protocol efficiency. This extension uses an index of content or service, not the IP addresses, as the identifiers of communication targets. The index identifies content or services uniquely. Content and services that a terminal can provide are listed in the terminal’s content information table. For simplicity and efficiency of protocol implementation, each terminal maintains the information on content that the terminal holds in our implementation. The path discovery process with the above extension is as follows. A source terminal broadcasts an extended RREQ when a communication request occurs from a userapplication. The user application specifies the desired content index. The extended RREQ has the content index and the IP address of the source terminal. Note that the extended RREQ does not include the IP address of the destination terminal. The extended RREQ has an option format field shown in Figure 3. The option data format is in the TypeLength-Value (TLV) format and loads the desired content index. When the extended RREQ is received by adjacent terminals, the reverse route to the source terminal is made in their routing table. Then, if the content index in 50 the RREQ is registered in the content information table of the receiver terminal, it unicasts an extended RREP to the source terminal. The extended RREP has the same option format as the extended RREQ. The extended RREP loads the information of the desired content and the IP address of the terminal that has the information. If the terminals do not have the entry in the content index in the RREQ, they rebroadcast the RREQ. When the extended RREP is received, the terminal makes the forward route to the terminal that sent the RREP. When the source terminal receives the extended RREP, the routes to the terminal that has the information on the desired content and the actual information on the content are obtained. Sample sequences of the extended path discovery process are shown in Figure 3 (request phase) and Figure 5 (reply phase) Cryptography Public-key RSA& Others Private-key Block Protocols Stream 51 AES BlowFish &Others RC6 RC4& Others Figure 1. classification of encryption techniques . Encryption Algorithms Encryption is a well known technology for protecting sensitive data. Use of the combination of Public and Private Key encryption to hide the sensitive data of users, and cipher text retrieval [6]. ( a) Data Encryption Standard (DES) DES (Data Encryption Standard) algorithm purpose is to provide a standard method for protecting sensitive commercial and unclassified data. In this same key used for encryption and decryption process [7]. DES algorithm consists of the following steps i. Encryption 1. DES accepts an input of 64-bit long plaintext and 56-bitkey (8 bits of parity) and produce output of 64 bit block. 2. The plaintext block has to shift the bits around. 3. The 8 parity bits are removed from the key by subjecting the key to its Key Permutation. 4. The plaintext and key will processed by following i. The key is split into two 28 halves ii. Each half of the key is shifted (rotated) by one or two bits, depending on the round 52 . iii. The halves are recombined and subject to a compression permutation to reduce the key from 56 bits to 48 bits. This compressed keys used to encrypt this round’s plaintext block. iv. The rotated key halves from step 2 are used in next round. v. The data block is split into two 32-bit halves . vi. One half is subject to an expansion permutation to increase its size to 48 bits. vii. Output of step 6 is exclusive-OR’ed with the 48- itcompressed key from step 3. viii. Output of step 7 is fed into an S-box, which substitutes key bits and reduces the 48-bit block back down to 32-bits . ix. Output of step 8 is subject to a P-box to permute the bits . x. The output from the P-box is exclusive-OR’ed with other half of the data block. k. The two data halves are swapped and become the next round’s input In order to address the security vulnerabilities, algorithm based on stream cipher theory has been proposed. A pseudorandom keystream is used to generate cipher text by utilising the Substitution box values. This encryption algorithm is based on XOR operation and the steps for the algorithm are described below: DES is a block cipher. It encrypts the data in a block of 64 bits. It produces 64 bit cipher text. The key length is 56 bits. Initially the key is consisting of 64 bits. The bit position 8, 16, 24, 32,40,48,56, 64 discarded from the key length [16]. 53 DES is based on two fundamental attributes of cryptography: Substitution (confusion) and transposition (Diffusion). DES consists of 16 steps, each of which called as a Round. Algorithm:[1] In the first step, the initial 64-bit plain text block is handed over to Initial Permutation (IP) function. [2] The Initial permutation is performed on plain text. [3] The initial permutation produces two halves of permuted block: Left Plain text (LPT) and Right Plain (RPT). [4] Now, each of LPT and RPT goes through 16 rounds of the encryption process, each with its own key: a. From the 56-bit key, a different 48-bit Sub-key is generated using Key Transformation. b. Using the Expansion Permutation, the RPT is expended from 32 bits to 48 bits. c. Now, the 48-bit key is XORed with 48-bit RPT and the resulting output is given in the next step. d. Using the S-box substitution produce the 32-bit from 48-bit input. e. These 32 bits are permuted using P-Box Permutation. f. The P-Box output 32 bits are XORed with the LPT 32 bits. 54 g. The result of the XORed 32 bits is become the RPT and old RPT become the LPT.This process is called as swapping. h. Now the RPT again given to the next round and performed the 15 more rounds. [5] After the completion of 16 rounds the Final Permutation is performed [10], [17]. THE RSA ALGORITHM This is a public key encryption algorithm developed by Ron Rivest, Adi Shamir and Len Adlemen in 1977.The RSA algorithm is the most popular and proven asymmetric key cryptographic algorithm. The RSA algorithm is based on the mathematical fact that it is easy to find and multiply large prime numbers together, but it is extremely difficult to factor their product. The privateand public keys in the RSA are based on very large (madeup of 100 or more digits) prime numbers. The algorithmitself is quite simple (unlike the symmetric keycryptographic algorithms). However, the real challenge inthe case of RSA is the selection and generation of thepublic and private keys. The idea of asymmetriccryptographic is shown in figure 6. In which the A is the sender and B Receiver [4]. 55 Algorithm: [1] Choose two large prime numbers P and Q. [2] Calculate N= P X Q. [3] Select the public key (i.e. the encryption key) E such that it is not a factor of (P-1) and (Q-1). [4] Select the private key (i.e. the decryption key) D such that the following equation is true: (D X E) mod (P-1) X (Q-1) =1 [5] For encryption, calculate the cipher text CT from text PT as follows: CT = PTE mod N [4], [10]. 56 AES Encryption and Decryption 57 CHAPTER 4 IMPLEMENTATION AND RESULT Encryption Process: Using Hash Algorithm: Hash algorithms are used as components by other cryptographic algorithms and processes to provide information security services. Hash functions are often utilized with digital signature algorithms, keyed-hash message authentication codes, key derivation functions, and random number generators. A hash algorithm converts a variable length message into a condensed representation of the electronic data in the message. This representation, or message digest, can then be used for digital signatures, message authentication, and other secure applications. When employed in a digital signature application, the hash value of the message is signed instead of the message itself; the receiver can use the signature to verify the signer of the message and to authenticate the integrity of the signed message. Recently, the Information Technology Laboratory of the National Institute of Standards and Technology (NIST) completed a revision of the federal government’s standard for secure hash functions. Issued as Federal Information Processing Standard (FIPS) 180-3, Secure Hash Standard, and approved by the Secretary of Commerce in October 2008, the revised standard replaces FIPS 180-2 and specifies five secure hash algorithms. Because recent advances in the cryptanalysis of hash functions could threaten the security of cryptographic processes, NIST is conducting an open, public competition to develop a new, robust cryptographic hash algorithm. When the new algorithm is developed, 58 evaluated, and approved, it will augment the hash algorithms currently specified in FIPS 180-3. Federal Information Processing Standard (FIPS) 180-3, Secure H Security Strengths of Hash Functions A secure hash function is a collision-resistant, one-way function. Collision resistance means that it is extremely difficult to find two different messages that will produce the same hash value. One way means that it is easy to compute the hash value from the input, but it is extremely difficult to reproduce the input from the hash value, or to find another input that will produce the same hash value. Hash functions are often used to determine whether or not data has changed. Many algorithms and processes that provide a security service use a hash function as a component of the algorithm or process, including: • Keyed-hash message authentication code (HMAC) • Digital signatures • Key derivation functions (KDFs) 59 Random number generators (RNGs) Because cryptanalysts have found ways to attack commonly used hash functions, NIST has advised federal agencies to stop as soon as practical the use of the SHA-1 algorithm for digital signatures, digital timestamping, and other applications that require collision resistance, and to use the SHA-2 family of hash functions for these applications after 2010. SHA-1 may be used only for hash-based message authentication codes, key derivation functions, and random number generators after 2010. NIST encourages application and protocol designers to use the SHA-2 family of hash functions for all new applications and protocols. To keep users and developers up to date on the potential threats to the security of hash algorithms, NIST has issued recommendations about the security strengths of the five approved hash algorithms in a publication that can be modified and updated in a timely manner to provide current information. Recommendations for Use of Hash function. 60 i. Calculate Passkey Numeral for Encryption: Random number is generated between 1024 and 999999. Length of number is calculated. Sum of ASCII value of digits of number are calculated. Thus, Passkey Numeral= Numeral Length + Sum of ASCII value of digits. ii. Calculate a0, a1, a2 and a3 parameters: a0= Sum of digits at even positions of passkey numeral 61 iii. a1= Sum of digits at odd positions of passkey numeral a2= Product of digits of passkey numeral a3= (Passkey numeral) mod (256) Calculate b0, b1,b2 and b3 parameters: In order to compute b0, b1, b2 and b3 values, encryption parameters EP1, EP2, EP3 and EP4 are required which are computed using Table below: Encryption Parameters iv. v. EP1 EP2 EP3 parameter parameter parameter b0 = EP1[0]+EP2[0]+EP3[0]+EP4[0] EP4 parameter (1) 0 a0 XOR a1 EP1 + 15 a2 XOR a3 b1 = EP1[1]+EP2[1]+EP3[1]+EP4[1] EP3 + 55 (2) 1 a0 XOR a2 EP1 + 25 a1 XOR a3 b2 = EP1[2]+EP2[2]+EP3[2]+EP4[2] EP3 + 65 (3) 2 b3 = EP1[3]+EP2[3]+EP3[3]+EP4[3] a0 XOR a3 EP1 + 35 a1 XOR a2 EP3 + 75 (4) 3 a2 XOR a3 EP3 + 85 EP1 + 45 a1 XOR a3 Calculate c0,c1,c2 and c3 parameters: c0 = ((EP1[b2] XOR EP2[b2]) * a0) + b2 (5) c1 = ((EP1[b1] XOR EP3[b1]) * a1) + b1 (6) c2 = ((EP1[b0] XOR EP4[b0]) * a2) + b0 (7) c3 = ((EP2[b3] XOR EP3[b3]) * a3) +b3 (8) Calculate Substitution box (S-box) values using Table 5.2 Table S-Box values 0 0 1 2 3 (EP1[b0] XOR c0) * (EP1[b1] XOR (EP1[b2] XOR (EP1[b3] XOR 62 c0 c1) * c0 c2) * c0 c3) * c0 1 (EP2[b0] XOR c0) * c1 (EP2[b1] XOR c1) * c1 (EP2[b2] XOR c2) * c1 (EP2[b3] XOR c3) * c1 2 (EP3[b0] XOR c0) * c2 (EP3[b1] XOR c1) * c2 (EP3[b2] XOR c2) * c2 (EP3[b3] XOR c3) * c2 3 (EP4[b0] XOR c0) * c3 (EP4[b1] XOR c1) * c3 (EP4[b2] XOR c2) * c3 (EP4[b3] XOR c3) * c3 Calculate Message parameter: Message Parameter = Passkey Numeral (obtained in step i.) + Randomly generated key between 1024 and 9999 + Average of a0, a1, a2 and a3 parameters (obtained in step ii.) + Average of b0, b1, b2 and b3 parameters (obtained in step iii.) + Average of c0, c1, c2 and c3 parameters (obtained in step iv.) vi. Message Encryption Reverse the plaintext to be encrypted to obtain Partial Message Encryption 1 (PME1). Perform PME1 XOR S-box [index] (obtained in step E) operation to obtain Partial Message Encryption 2 (PME2). Perform PME2 XOR Message parameter (obtained in step F) operation to compute Partial Message Encryption 3 (PME3). Reverse hex encoded value of PME3 to compute Partial Message Encryption 4 (PME4) which is the resultant encrypted text. Encryption Process: 63 Using RSA Algorithm: RSA is an algorithm used by modern computers to encrypt and decrypt messages. It is an asymmetric cryptographic algorithm. Asymmetric means that there are two different keys. This is also called public key cryptography, because one of them can be given to everyone. The other key must be kept private. It is based on the fact that finding the factors of a integer is hard (thefactoring problem). RSA stands for Ron Rivest, Adi Shamir and Leonard Adleman, who first publicly described it in 1978. A user of RSA creates and then publishes the product of two large prime numbers, along with an auxiliary value, as their public key. The prime factors must be kept secret. Anyone can use the public key to encrypt a message, but with currently published methods, if the public key is large enough, only someone with knowledge of the prime factors can feasibly decode the message. RSA involves a public key and private key. The public key can be known to everyone, it is used to encrypt messages. Messages encrypted using the public key can only be decrypted with the private key. The keys for the RSA algorithm are generated the following way: Algorithm: [1] Choose two large prime numbers P and Q. [2] Calculate N= P X Q. [3] Select the public key (i.e. the encryption key) E such that it is not a factor of (P1) and (Q-1). [4] Select the private key (i.e. the decryption key) D such that the following equation is true: (D X E) mod (P-1) X (Q-1) =1 64 [5] For encryption, calculate the cipher text CT from text PT as follows: CT = PTE mod N [4], [10].cryptographic algorithms . EVALUATION PARAMETERS Performance measurement criteria are time taken by the algorithms to perform the encryption and decryption of the input text files. The following are the parameters which calculate the performance of algorithms. A. Encryption Computation Time B. Decryption Computation Time 65 The encryption computation time is the time which taken by the algorithms to produce the cipher text from the plain text. The encryption time can be used to calculate the Encryption Throughput of the algorithms. The decryption computation time is the time taken by the algorithms to produce the plain text from the cipher text. The decryption time can be used to calculate the Decryption Throughput of the algorithms RESULTS DISCUSSIONS Input Alpha Samples Algorithm numeric Character (Datasets) 66 Performance Graph 67 68 69 70 71 72 5.CHAPTER CONCLUSION 73 REFFERENCES [1].Argha Roy, Diptam Dutta, Kaustav Choudhury,” Training Artificial Neural Network using Particle Swarm Optimization Algorithm” IJARCS SE Volume 3, Issue 3, March 2013 pp 43—434 [2] Idrizi, Florim, Dalipi, Fisnik & Rustemi, Ejup. “Analyzing the speed of combined cryptographic algorithms with secret and public key”. International Journal of Engineering Research and Development, e-ISSN: 2278-067X, p-ISSN: 2278-800X, www.ijerd.com Volume 8, Issue 2 (August 2013), pp. 45 [3] Abdul.Mina, D.S, Kader, H.M. Abdual & Hadhoud, M.M. “Performance Analysis of Symmetric Cryptography”. pp. 1. [4] Chehal Ritika, Singh Kuldeep. “Efficiency and Security of Data with Symmetric Encryption Algorithms”. International Journal of Advanced Research in Computer Science and Software Engineering, ISSN: 2277 128X , Volume 2, Issue 8, August 2012, pp. 1 [5] Hardjono, ''Security In Wireless LANS And MANS,'' Artech House Publishers 2005. 74 [6] Elminaam, Diaa Salama Abd, Abdual Kader, Hatem Mohamed & Hadhoud, Mohiy Mohamed. “Evaluating The Performance of Symmetric Encryption Algorithms”. International Journal of Network Security, Vol.10, No.3, May 2010, pp. 216. [7] Padmapriya, Dr.A, Subhasri, P. “Cloud Computing: Security Challenges & Encryption Practices”. International Journal of Advanced Research in Computer Science and Software Engineering, ISSN: 2277 128X, Volume 3, Issue 3, March 2013, pp. 257. [8]Prashanti.G, Deepthi.S & Sandhya Rani.K. ”A Novel Approach for Data Encryption Standard Algorithm”. International Journal of Engineering and Advanced Technology (IJEAT) ISSN: 2249 – 8958, Volume-2, Issue-5, June 2013, pp. 264. [9] Das Debasis, Misra Rajiv. “Programmable Cellular Automata Based Efficient Parallel AES Encryption Algorithm”. International Journal of Network Security & Its Applications (IJNSA), Vol.3, No.6, November 2011, pp. 204 [10] Kalpana Parsi, Singaraju Sudha. ”Data Security in Cloud Computing using RSA Algorithm”. International Journal of Research in Computer and Communication technology, IJRCCT, ISSN 2278- 5841, Vol 1, Issue 4, September 2012. pp. 145. [11] Sunitha K, Prashanth K.S. “Enhancing Privacy in Cloud Service Provider Using Cryptographic Algorithm”. IOSR Journal of Computer Engineering (IOSRJCE) e-ISSN: 2278-0661, p- ISSN: 2278- 8727Volume 12, Issue 5 (Jul. - Aug. 2013). pp. 64. [12] Singh Narjeet, Raj Gaurav. “Security On Bccp Through Aes Encryption Technique”. International Journal Of Engineering Science & Advanced Technology Volume-2, Issue-4, 813 – 819. pp. 817. 75 [13] K. Wang, J. A. kangas, Character location in scene images from digital camera, Pattern Recognition., 36(10), 2003, 2287-2299. [14] C. C. Chang, S. M. Hwang, D. J. Buehrer, A shape recognition scheme based on relative distances of feature points from the centroid. Pattern Recognition, 24(11), 1991. 1053-1063. [15] T. Bernier, J.-A. Landry, A new method for representing and matching shapes of natural objects. Pattern Recognition, 36(8), 2003. 1711-1723 [16] R. Chandramouli, “Battery power-aware encryption,” ACM Transactions on Information and System Security (TISSEC), vol. 9, no. 2, pp. 162-180, May 2006. [17] D. Coppersmith, “The data encryption standard (DES) and its strength against attacks,” IBM Journal of Research and Development, pp. 243 -250, May 1994. [18] J. Daemen, and V. Rijmen, “Rijndael: The advanced encryption standard,” Dr. Dobb’s Journal, pp. 137- 139, Mar. 2001. [19] P. Ding, “Central manager: A solution to avoid denial of service attacks for wreless LANs,” International Journal of Network Security, vol. 4, no. 1, pp. 35-44, 2007. [20] N. E. Fishawy, “Quality of encryption measurement of bitmap images with RC6, MRC6, and rijndael block cipher algorithms,” International Journal of Network Security, pp. 241-251, Nov. 2007. [21] Hardjono, Security In Wireless LANS And MANS, Artech House Publishers, 2005. International Journal of Network Security, Vol.10, No.3, PP.213–219, May 2010 219 76 [22] S. Hirani, Energy Consumption of Encryption Schemes in Wireless Devices Thesis, University of Pittsburgh, Apr. 9,2003, Retrieved Oct. 1, 2008. (http://portal.acm.org/citation.cfm?id=383768) [23] M. S. Hwang and C. Y. Liu, “Authenticated encryption schemes: current status and key issues,” International Journal of Network Security, vol. 1, no. 2, pp. 61-73, 2005. [24] M. H. Ibrahim, “A method for obtaining deniable public-key encryption,” International Journal of Network Security, vol. 8, no. 1, pp. 1-9, 2009. [25] M. H. Ibrahim, “Receiver-deniable public-key encryption,” International Journal of Network Security, vol. 8, no. 2, pp. 159-165, 2009. [11] S. Z. S. Idrus, and S. A. Aljunid, “Performance analysis of encryption algorithms text length size on web browsers,” IJCSNS International Journal of Computer Science and Network Security, vol. 8, no.1, pp. 20-25, Jan. 2008. [26] K. McKay, Trade-offs between Energy and Security in Wireless Networks Thesis, Worcester Polytechnic Institute, Apr. 2005. [27] K. Naik, “Software implementation strategies for power-conscious systems,” Mobile Networks and Applications, vol. 6, pp. 291-305, 2001. [28] P. Ruangchaijatupon, and P. Krishnamurthy, “Encryption and power consumption in wireless LANsN,” The Third IEEE Workshop on Wireless LANs, pp. 148-152, Newton, Massachusetts, Sep. 27-28, 2001. [29] B. Schneier, The Blowfish Encryption Algorithm, Retrieved Oct. 25, 2008. (http://www. schneier.com/blowfish.html) 77 [30] A. Sinha, A. P. Chandrakasan, and JouleTrack, “A web based tool for software energy profiling,” Proceedings of the 38th Design Utomation Conference, pp. 220-225, DAC Las Vega, US, 2001. [31] W. Stallings, Cryptography and Network Security, Prentice Hall, pp. 58-309, 4th Ed, 2005. [132] A. A. Tamimi, Performance Analysis of Data Encryption Algorithms, Retrieved Oct. 1, 2008. (http://www.cs.wustl.edu/∼jain/cse567-06/ftp/ encryption perf/index.html) 78