Вы находитесь на странице: 1из 36

ADAPTIVE CRYPTOGRAPHY TECHNIQUES FOR DYNAMIC TEXT GENERATION By J.JAWAHAR BANU Roll No.1110MIT0035 Reg. No.

75111200018 A PROJECT REPORT Submitted to the FACULTY OF SCIENCE AND HUMANITIES in partial fulfilment for the award of the degree of MASTER OF SCIENCE IN INFORMATION TECHONOLGY

CENTRE FOR DISTANCE EDUCATION ANNA UNIVERSITY CHENNAI 600 025 AUGUST 2013

BONAFIDE CERTIFICATE

Certified that the Project report titled ADAPTIVE CRYPTOGRAPHY TECHNIQUES FOR DYNAMIC TEXT GENERATION is the bonafide work of Ms.J.JAWAHAR BANU who carried out the work under my supervision. Certified further that to the best of my knowledge the work reported herein does not form part of any other project report or dissertation on the basis of which a degree or award was conferred on an earlier occasion on this or any other candidate.

Signature of student Name :J.JAWAHAR BANU Roll No. :1110MIT0035 Reg. No. :75111200018

Signature of Guide Name :Ms.K.KALAI SELVI Designation :Teaching Assistant Department of Mathematics Anna University,Chennai-25.

Signature of Project-in-charge Name: Dr.D.ARIVUDAI NAMBI Designation :Associate Professor Department of Mathematics Anna University,Chennai-25.

II

Adaptive Cryptography Techniques for Dynamic Text Generation ABSTRACT The information stored in a persons computer or the information that are being transferred through network of computers or internet being read by other people is very high. It causes a major concern for privacy, identity theft, electronic payments, corporate security, military communications and many others. Cryptography is a standard way of securing the electronic documents. Basic idea of cryptography is to mumble-jumble the original message into something that is unreadable or to something that is readable but makes no sense of what the original message is. Cryptography process seeks to distribute an estimation of basic cryptographic primitives across a number of confluences in order to reduce security assumptions on individual nodes, which establish a level of fault-tolerance opposing to the node alteration. The method of disguising plaintext in such a way as to hide its substance is called encryption. Encrypting plaintext results in unreadable gibberish called cipher text. Cryptanalysis is the art of breaking Ciphers that is retrieving the original message without knowing the proper key. Cryptography deals with all aspects of secure messaging, authentication, digital signatures, electronic money, and other applications. Encryption: Encryption is done using the public key component e and the modulus n. Sending the message, Encrypt the message with their public key (e,n).Encryption is done by taking an exponentiation of the message m with the public key e and then taking a modulus of it. The following steps are done in encryption. 1. Obtain the recipients public key (n,e) 2. Represent the plaintext message as a positive integer m<n 3. Compute the ciphertext c=m^e mod n. 4. Send the ciphertext c to the recipient.

Decryption: Decryption is done using the private key. The person who is receiving the encrypted message uses his own private key to decrypt the message. Decryption is similar to the encryption except that the keys used are different. 1. Recipient uses his private key (n,d) to compute m=c^d mod n. 2. Extract the plaintext from the integer representative m.

III

. , , , , . . . , . - . . . . . , , , , . : e n . , (e, n) . e m . :

1.

(n, e) .

2. m <n 3. c=m^e mod n. 4. c .


: .

. . 1. (n, d) m=c^d mod n 2. m- . .

IV

Certificate of Viva-voce-Examination

This is to certify that Thiru/Ms./Tmt. J.JAWAHAR BANU (Roll No. 1110MIT0035; Register No. 75111200018) has been subjected to Viva-voce-Examination on (Date) at ..(Time) at the Study centre College of Engineering, Anna University,Chennai-25.

Internal Examiner

External Examiner

Name : (in capital letters) Designation : Address :

Name : (in capital letters) Designation : Address :

Coordinator Study centre

Name : (in capital letters) Designation : Address : Date :

VI

TABLE OF CONTENTS

CHAPTER NO.

TITLE

PAGE NO.

ABSTRACT LIST OF FIGURES LIST OF ABBREVATIONS

Iii Ix X

1.

INTRODUCTION

1.1 OVERVIEW OF THE PROJECT.......................................................................1 1.2 LITERATURE SURVEY...................................................................................1 1.3 THE PROPOSED SYSTEM ..............................................................................2 1.4 RSA ALGORITHM ...........................................................................................3 1.4.1 Key Generation .........................................................................................3 1.4.2 Encryption .................................................................................................3 1.4.3 Decryption .................................................................................................4 1.5 COMPLEXITY OF THE PROJECT................................................................... 4 1.6 OBJECTIVE AND SCOPE OF THE PROJECT..................................................4 1.7 FEASIBILITY STUDY........................................................................................5 1.7.1 Economical and Financial Feasibility..........................................................5 1.7.2 Technical Feasibility....................................................................................6 1.7.3 Operational Feasibility.................................................................................6 2. REQUIREMENT SPECIFICATION 7

2.1 HARDWARE REQUIREMENTS......................................................................7 2.2 SOFTWARE REQUIREMENTS........................................................................7 2.3 TECHNOLOGY USED.......................................................................................7


7

2.3.1 Overview of Java Swing..............................................................................7 2.3.2 Eclipse Java Development Tools.................................................................9 2.3.3 Data Flow Diagram.....................................................................................10 2.3.4 Block Diagram............................................................................................10 2.3.5 Use Case Diagram.......................................................................................11 3. SYSTEM DESIGN AND PLAN 12

3.1 SYSTEM DESIGN...............................................................................................12

3.2 MODULES IDENTIFIED....................................................................................13 3.2.1 Homophonic Cryptographic IDE................................................................13 3.2.2 Character Split Up and Count......................................................................13 3.2.3 Encrypt Module............................................................................................13 3.2.4 Transfer Module...........................................................................................14 3.2.5 Decrypt Module............................................................................................15

4.

IMPLEMENTATION AND RESULTS

16

4.1 INTRODUCTION.................................................................................................16 4.2 SYSTEM IMPLEMENTATION...........................................................................16 4.3 CODE REVIEW....................................................................................................17 4.4 TESTING...............................................................................................................18 4.4.1 Testing Objectives.........................................................................................18 4.4.2 Unit Testing...................................................................................................18 4.4.3 Integration Testing.........................................................................................18 4.4.4 Functional Testing.........................................................................................19 4.4.5 Acceptance Testing........................................................................................19

5.

CONCLUSION AND FUTURE WORK

20

5.1 CONCLUSION....................................................................................................20 5.1.1 Goals Achieved............................................................................................20 5.2 FUTURE WORK..................................................................................................20 APPENDICES 21 REFERRENCES 25

10

LIST OF FIGURES Figure 1.1 2.1 2.2 2.3 2.4 2.5 3.1 4.1 Title Page

Encryption-Decryption Flow ..................................................................1 Overview architecture of Java Swing......................................................8 Overview architecture of Eclipse Tool.....................................................9 Data Flow Diagram of proposed system.................................................10 Block Diagram of proposed system....11 Use Case Diagram of proposed system...................................................11 System architecture design..12 System implementation design...17

10

11

LIST OF ABBREVIATIONS

API... Application Program Interface APT..Annotation Processing Tool AWT.Abstract Window Toolkit DFD..Data Flow Diagram GUI...Graphical User Interface IDEIntegrated development Environment JDTJava Development Tool JFCJava Foundation Class JPDA.Java Platform Debugger Architecture JVM..Java Virtual Machine RSA..Rivest, Shamir, Adleman UI..User Interface VM Virtual Machine

11

12

CHAPTER 1 INTRODUCTION

1.1 OVERVIEW OF THE PROJECT This project encrypts and decrypts the textual files by using RSA algorithm. Encryption and Decryption is a strong text and file encryption software for personal and professional security. It protects privacy of email messages, documents and sensitive files by encrypting them using RSA algorithm to provide high protection against unauthorized data access. Every day hundreds and thousands of people interact electronically, whether it is through emails, e-commerce, etc. through internet. Sending sensitive messages over the Internet is very dangerous. To send sensitive messages over the Internet, it should be in the encrypted form. Encryption and Decryption helps to easily encrypt and decrypt the messages. To send sensitive information via email, simply paste the encrypted text into the email and all the recipients has to do is to decrypt the text.

-.

Figure l.1: Encryption-Decryption Flow

1.2 LITERATURE SURVEY Literature survey is the most important step in software development process. Before developing the tool it is necessary to determine the time factor, economy company strength. Once these things are satisfied, ten next steps are to determine which operating system and language can be used for developing the tool. Public Key cryptography uses two keys Private key (known only by the recipient) and a Public key
12

13

(known to everybody). The public key is used to encrypt the message and then it is sent to the recipient who can decrypt the message using the private key. The message encrypted with the public key cannot be decrypted with any other key except for its corresponding private key. The public-key algorithm uses a one-way function to translate plaintext to cipher text. Then, without the private key, it is very difficult for anyone (including the sender) to reverse the process (i.e., translate the cipher text back to plaintext). RSA is one of the most popular and successful public key cryptography algorithms. The algorithm has been implemented in many commercial applications. It is named after its inventors Ronald L. Rivest, Adi Shamir, and Leonard Adleman. They invented this algorithm in the year 1977. They utilized the fact that when prime numbers are chosen as a modulus, operations behave conveniently. They found that if we use a prime for the modulus, then raising a number to the power (prime - 1) is 1.

1.3 THE PROPOSED SYSTEM The proposed system is quiet simple to use. It is not complex in its functionalities. It is easy for a nave user to use it. To send sensitive information via email, simply paste the encrypted text into the email or attach the encrypted file, All the recipient has to do is to decrypt the text or file. Encryption and Decryption works with text information and files. Just select the files to encrypt, and Encryption and Decryption software helps to keep documents, private information and files in a confidential way. The proposed system is identified with the features of: Storing a data Character split up and count Encrypt Transfer Decrypt 1.4 RSA ALGORITHM

13

14

The RSA algorithm involves three steps, key generation, encryption and decryption. 1.4.1 Key Generation RSA involves a public key and a private key. The public key can be known to everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. The keys for the RSA algorithm are generated in the following way: Choose two distinct large random prime numbers p and q Compute n=pq n is used as the modulus for both the public and private keys Compute the quotient: (n) = (p-1) (q-1). Choose an integer e such that 1<e< (n) and e and (n) share no factors other than 1 (i.e. e and (n) are co-prime) e is released as the public key exponent Compute d to satisfy the congruence relation de1(mod (n) ; i.e., de=1+k (n) for some integer k. d is kept as the private key exponent The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the modulus n and the private (or decryption) exponent d which must be kept secret. 1.4.2 Encryption Sender A does the following: 1.4.3 Decryption
14

Obtains the recipient B's public key (n, e). Represents the plaintext message as a positive integer M Computes the ciphertext C = Me mod n. Sends the ciphertext C to B.

15

Recipient B does the following: Uses his private key (n, d) to compute M = Cd mod n. Extracts the plaintext from the message representative M.

1.5 COMPLEXITY OF THE PROJECT: Creating a dynamic secret key for given plain text or information based on the total count of each character. User can change the value for same character dynamically in same file. eg: Database it contains 3 same character (A). User can change the value for each A in the word. In private-key cryptography, the sender and recipient agree beforehand on a secret private key. The plaintext is somehow combined with the key to create the ciphertext.

1.6 OBJECTIVE AND SCOPE OF THE PROJECT Data that can be read and understood without any special measures is called plaintext or cleartext. This is the message or data that has to be secured. The method of disguising plaintext in such a way as to hide its substance is called encryption. Encrypting plaintext results in unreadable gibberish called ciphertext. Using encryption ensure that information is hidden from anyone for whom it is not intended, even those who can see the encrypted data. The process of reverting ciphertext to its original plaintext is called decryption. Cryptography is the science of mathematics to encrypt and decrypt data. Cryptography enables user to store sensitive information or transmit it across insecure networks like Internet so that no one else other the intended recipient can read it. Cryptography deals with all aspects of secure messaging, authentication, digital signatures, electronic money, and other applications. Cryptographic algorithms are mathematical
15

16

functions that are used in the encryption and decryption process. A cryptographic algorithms works in combination with a key (a number, word or phrase) to encrypt the plaintext. Same plain text encrypts to different cipher texts for different keys. Strength of a cryptosystems depends on the strength of the algorithm and the secrecy of the key. 1.7 FEASIBILITY STUDY A feasibility study is a preliminary study undertaken to determine and document a project's viability. The results of this study are used to make a decision whether to proceed with the project, or table it. If it indeed leads to a project being approved, it will before the real work of the proposed project starts be used to ascertain the likelihood of the project's success. It is an analysis of possible alternative solutions to a problem and a recommendation on the best alternative. It, for example, can decide whether an order processing be carried out by a new system more efficiently than the previous one. A feasibility study could be used to test a new working system, which could be used because: The current system may no longer suit its purpose. Technological advancement may have rendered the current system obsolete. The business is expanding, allowing it to cope with extra work load. Customers are complaining about the speed and quality of work the business

provides. Within a feasibility study, four areas must be reviewed, including Economical & Financial, Technical, Operational feasibility.

1.7.1 Economical & Financial Feasibility This involves questions such as whether the firm can afford to build the system, whether its benefits should substantially exceed its costs, and whether the project has higher priority and profits than other projects that might use the same resources. This also includes whether the project is in the condition to fulfil all the eligibility criteria and the responsibility of both sides in case there are two parties involved in performing any project.
16

17

1.7.2 Technical Feasibility This involves questions such as whether the technology needed for the system exists, how difficult it will be to build, and whether the firm has enough experience using that technology. The assessment is based on an outline design of system requirements in terms of Input, Output, Fields, Programs, and Procedures. This can be qualified in terms of volumes of data, trends, frequency of updating, etc, In order to give an introduction to the technical system.

1.7.3 Operational Feasibility Operational feasibility is a test of feasibility that will check whether the systems are working when it is developed and installed in place of the existing system. The Proposed system is beneficial only if it can be turned into information system that will meet the organization's operational requirements.

CHAPTER 2 REQUIREMENT SPECIFICATION


17

18

2.1 HARDWARE REQUIREMENTS: System Hard Disk Ram : Pentium IV 2.4 GHz. : 40 GB. : 256 Mb.

2.2 SOFTWARE REQUIREMENTS: Operating system Front End Tool : Windows XP /7/8 : JAVA, Swing(JFC) : Eclipse

2.3 TECHNOLOGY USED 2.3.1 Overview of Java swing: Swing is the primary Java GUI widget toolkit. It is part of Oracle's Java Foundation Classes (JFC) an API for providing a graphical user interface (GUI) for Java programs. Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit (AWT). Swing provides a native look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform. It has more powerful and flexible components than AWT. In addition to familiar components such as buttons, check boxes and labels, Swing provides several advanced components such as tabbed panel, scroll panes, trees, tables, and lists. Unlike AWT components, Swing components are not implemented by platform-specific code. Instead they are written entirely in Java and therefore are platformindependent. The overall goal for the Swing project was:

To build a set of extensible GUI components to enable developers to more rapidly develop powerful Java front ends for commercial applications.

18

19

Be implemented entirely in Java to promote cross-platform consistency and easier maintenance. Provide a single API capable of supporting multiple look-and-feels so that developers and end-users would not be locked into a single look-and-feel. Enable the power of model-driven programming without requiring it in the highestlevel API. Adhere to JavaBeans design principles to ensure that components behave well in IDEs and builder tools. Provide compatibility with AWT APIs where there is overlapping, to leverage the AWT knowledge base and ease porting.

Figure 2.1: Overview architecture of Java Swing 2.3.2 Eclipse Java development tools (JDT) Overview
19

20

The JDT project contributes a set of plug-ins that add the capabilities of a full-featured Java IDE to the Eclipse platform. The JDT plugins provide APIs so that they can themselves be further extended by other tool builders. The JDT plugins are categorized into: JDT APT: adds annotation processing support to Java 5 projects in Eclipse. JDT Core: defines the non-UI infrastructure. JDT Debug: JDT Debug implements Java debugging support and works with any JDPA-compliant target Java VM. JDT Text: provides the Java editor. The JDT UI: provides refactoring support.

Figure 2.2: Overview architecture of Eclipse tool 2.3.3 DATA FLOW DIAGRAM
20

21

Data flow diagrams represent one of the most ingenious tools used for structured analysis. A data flow diagram or DFD as it is shortly is also known as a bubble chart. It has the purpose of clarifying system requirements and identifying major transformation that will become program in system design.

X
SENDER(A)
ENCRYPTIO N ALGORITHM (RSA)

Y
DECRYPTIO N ALGORITHM (RSA)

X
RECEIVER(B)

COMPRESSIO N

DECOMPRESS ION

Figure 2.3 Data Flow Diagram of Proposed System 2.3.4 Block diagram Block Diagram is a diagram, in which the principal parts of functions are represented by blocks connected by lines that show the relationships of the blocks. The block diagram is typically used for a higher level, less detailed description aimed more at understanding the details of implementation.

21

22

Figure 2.4 Block Diagram of Proposed System 2.3.5 Use Case Diagram A use case diagram at its simplest is a representation of a user's interaction with the system and depicting the specifications of a use case. A use case diagram can portray the different types of users of a system and the various ways that they interact with the system. This type of diagram is typically used in conjunction with the textual use case and will often be accompanied by other types of diagrams as well.

Figure 2.5 Use Case Diagram of Proposed System

CHAPTER 3
22

23

SYSTEM DESIGN AND PLAN 3.1 System Design Software design sits at the technical kernel of software engineering process and is applied regardless of the development paradigm and the area of application. Once the system requirements have been analyzed and specified, system design is the first of the three technical activities- design, code and test that are required to build and verify software, emphasis is on translating the software requirements into design specification. It involves preparing input-output specifications, making security and control specification, and preparing a logical and physical design work through.

Figure 3.1 System Architecture Design

3.2 MODULES IDENTIFIED Homophonic Cryptographic IDE


23

24

Character separation in file Encryption Module with Key Generation Transferring Encrypt File Decryption Module

3.2.1 Homophonic Cryptographic IDE (storing are upload file) Module In this module user have to select the process Encryption or Decryption. Encryption In this phase user will attach the file or information to encrypt. The given information is stored in the plain text. Decryption In this phase user will attach the encrypted file and cipher key It provides secure dissemination, loading, saving, and eliminating faults of keys to make encryption implementations effective. 3.2.2 Character split up and count Character was split up and count of all characters which is in stored plain text Based on the count and given value for the character the dynamic message (secret key) will generate.

3.2.3 Encrypt Module Encryption is done using the public key component e and the modulus n. Plain text will converted to cipher text
24

25

This conversion can be done through RSA Public Key Cryptography Algorithm.

Cipher text provides the key when encryption process is clicked. User can change the value for same character dynamically in same file. eg: Database it contains 3 same character (A).

User can change the value for each A in the word.

3.2.4 Transfer Module Client-server computing or networking is a distributed application architecture that partitions tasks between service providers (servers) and service requesters, called clients. A server machine is a high-performance host which shares its resources with clients. A client also shares any of its resources. Clients initiate communication sessions with servers which listen to incoming requests. Source to destination transfer is a distributed application architecture that partitions tasks between service providers (servers) and service requesters, called clients. It transfer both cipher text and key value to the receiver to the destination File can be transfer through email .

3.2.5 Decrypt Module


25

26

Decryption is done using the Private key. The person who is receiving the encrypted message uses his own private key to decrypt the message.

Decryption is similar to the encryption except that the keys used are different.

Recipient uses his private key (n,d) to compute m = c^d mod n. Extract the plaintext from the integer representative m. Finally, its deliver the original information to the receiver

CHAPTER 4
26

27

IMPLEMENTATION AND RESULTS

4.1 INTRODUCTION Once the system has been designed, the next step is to convert the designed one in to actual code, so as to satisfy the user requirements as excepted. If the system is approved to be error free it can be implemented. When the initial design was done for the system, the department was consulted for acceptance of the design so that further proceedings of the system development can be carried on. After the development of the system, a demonstration was given to them about working of the system. The aim of the system illustration was to identify any malfunctioning of the system. Implementation includes proper training to end-users. The implemented software should be maintained for prolonged running of the software. Initially the system was run parallel with manual system. The system has been tested with data and has proved to be error-free and user-friendly. Training was given to end -user about the software and its features. 4.2 System implementation Implementation of software is refers to the final installation of the packages. In the real environment, to the satisfaction of the intended users and the operation of the system. It involves careful planning, investigation of the current system and its constraints on implementation, design of the method to achieve the change over an evaluation, change over methods.

27

28

Figure 4.1 System Implementation Design

4.3.CODE REVIEW After Successful completion of the coding, code review was done with the objective of identifying and correcting deviations from standards, identifying and fixing logical bugs and fall through and recording code walkthrough findings. The programs were checked and the code structure was made readable. The variable names were meaningful. It follows certain naming conventions, which makes the program readable. Variable names are prefixed with their scope and data type. Checking out for the correct scopes for various functions. All possible explanations for the code were given as comments.
28

29

Sufficient labels and comments are included in the code as the description of it for the benefit of the developer and other programmers who might examine it later.

Checking out the connectivity of the database. Code optimization was carried out.

4.4 TESTING 4.4.1 Testing objectives: There are several rules that can serve as testing objectives. They are: Testing is a process of executing a program with the intent of finding an error. A good test case is one that has a high probability of finding an undiscovered error. A successful test is one that uncovers an undiscovered error. All field entries must work properly. Pages must be activated from the identified link. The entry screen, messages and responses must not be delayed If testing is conducted successfully according to the objectives stated above, it will uncover errors in the software.

4.4.2 Unit Testing: Unit testing involves the design of test cases that validate that the internal program logic is functioning properly, and that program inputs produce valid outputs. All decision branches and internal code flow should be validated. 4.4.3 Integration testing: Integration tests are designed to test integrated software components to determine if they actually run as one program. Integration testing is specifically aimed at exposing the problems that arise from the combination of components.
29

30

4.4.4 Functional Testing: Valid Input Functions Output : identified classes of valid input must be accepted. : identified functions must be exercised. : identified classes of application outputs must be exercised. Systems/Procedures: interfacing systems or procedures must be invoked. 4.4.5 Acceptance Testing: User Acceptance Testing is a critical phase of any project and requires significant participation by the end user. It also ensures that the system meets the functional requirements.

Invalid Input : identified classes of invalid input must be rejected.

30

31

CHAPTER 5 CONCULSION AND FUTURE WORK

5.1 CONCLUSION After implementing the system in the market its advantages were incomparable to the present contemporary systems available in the market. The most admirable feature founded was its simplicity in terms of application to the user but its highly beneficial outputs cant be ignored. The users will be highly benefited after using the system. 5.1.1 Goals achieved Following are the goals achieved in designing and implementing the system. The system is user friendly as any nave user can use it and easily understand its functionality. Security is enabled as certain features and functionalities are restricted to the registered users only and also at other levels security is implemented. The system aims to respond to the user as fast as possible.

5.2 FUTURE WORK There is always a room for improvement in any software, however efficient the system may be. The system is flexible enough for future modifications. The system has been factored into different modules to make the system adapt to further changes. Every effort has been made to cover all the user requirements and make it user friendly. Appropriate messages and tool tips have been provided wherever necessary. The system is adaptable to the future changes if any are deployed.

31

32

APPENDICES

Appendix 1: Cryptographic IDE

32

33

Appendix 2: File to Encrypt view

33

34

Appendix 3: Dynamic Text encryption text Setting View

34

35

Appendix 4: Decrypted Text View

35

36

REFERENCES

Cryptography and Network Security by William Stalings. Data Communications and Networking, 4th Edition, by Behrouz A. Forouzan, Tata McGraw Hill. Programming with JAVA by E Balagurusamy, McGraw Hill,2003. Software Engineering A Practitioners Approach by Roger S.Pressman McGraw Hill, 1992, p.p.207-237. www.google.com http://en.wikipedia.org/wiki/RSA_algorithm RSA Patent info : www.rsasecurity.com/rsalabs/no

36

Вам также может понравиться