Introduction Graphic in PC
Introduction Graphic in PC
Introduction Graphic in PC
INTRODUCTION
Introduction to Cryptography:
In the era of information technology, the possibility that 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. This causes a major
concern for privacy, identity theft, electronic payments, corporate security, military
communications and many others. We need an efficient and simple way of securing
the electronic documents from being read or used by people other than who are
authorized to do it. Cryptography is a standard way of securing the electronic
documents.
without knowing the proper key. Cryptography deals with all aspects of secure
messaging,
authentication,
digital
signatures,
electronic
money, and
other
applications.
as private key cryptosystems and asymmetric cryptosystems are also called as public
key cryptosystems.
Message to be
encrypted or
plain text
Encryption
Algorithm
Encrypted
message or
Cipher text
Message to be
decrypted or
cipher text
Decryption
Algorithm
Decrypted
message or
Plain text
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 n company
strength. Once these things r satisfied, ten next steps are to determine which operating
system and language can be used for developing the tool. Once the programmers start
building the tool the programmers need lot of external support. This support can be
obtained from senior programmers, from book or from websites. Before building the
system the above consideration r taken into account for developing the proposed
system.
Message to be
encrypted or
plain text
Encryption
Algorithm
Encrypted
message or
Cipher text
The following diagram illustrates the decryption process in the public key
cryptography:
Message to be
encrypted or
plain text
Encryption
Algorithm
Encrypted
message or
Cipher text
Key Generation:
The first step in RSA encryption is to generate a key pair. Two keys are generated of which
one is used as the public key and the other is used as the private key. The keys are generated
with the help of two large prime numbers. The keys are generated as follows
6. The public key is (n, e) and the private key is (n, d). The values of p, q, and
(n) should also be kept secret.
Encryption:
Encryption is done using the public key component e and the modulus n. To
whomever we need to send the message, we 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.
The RSA algorithm works as follows. It first finds two prime numbers and generates a
key pair using those two prime numbers. Then the encryption and decryption are done
using the key pair.
p and q are distinct primes
N = pq
Preliminaries:
Before entering into the proofs, we must first know about the following terms and
symbols in order to follow it. These are basics of the RSA proof.
1. Zn = {0, 1, 2, n-1}. This set is very familiar. Zn is the set of integers from 0 to n1.
2. Z*n = {x <n-1 | x and n are relatively prime}. Basically Z*n is the set that contains
all the numbers that is less than n and are relatively prime to n.
3. (n) = number of elements of Zn that are relatively prime to n. Hence (n) = | Z*n|
10
(n) = pq 1 (q 1) (p 1) = pq p q +1 = (p 1)(q 1)
If a,b Z*n then ab and n are relatively prime i.e. ab shares no primes with n. By
definition of Z*n a, b do not share primes with n. Their product, ab, gets its primes
from a and b and therefore does not share primes with n.
The product can be written as ab = n + . We just need to show that is in Z*n . But
if it is not, then it shares primes with n and the right hand side is divisible by some
prime that is a factor of n. But then, so is the left side, which is impossible as we
showed that it is relatively prime with n.
11
5.1.2 Sa Z*n:
Lets first define what Sa is. Before that we know that we can represent Z*n as
Z*n = {b1, b2, , b(n)}
Now
for
any
Z*n,
or
x a = y n
x a and y n are the same product of primes. Since a and n do not share any
common primes. All primes that form n has to appear in x.
Hence x>= n. That is a contradiction, as bj <n.
Since all elements of Sa are distinct, and in Z*n, then Sa and Z*n are identical. Note
that since all elements of Z*n are produced when a is multiplied by each element of
Z*n, then the element 1 is also a result of such a multiplication. Hence we get the
following condition:
if a Z*n then bk Z*n, s.t. abk = 1 mod n
= c mod n
12
By the proof in the section 5.1.2, ab1 mod n, ab2 mod n, ab(n) mod n is a
permutation of Z*n
Hence:
A = c (plain arithmetic)
c,
c=z
5.1.4 If a and (n) are relatively prime then b, s.t. ab = 1 mod (n)
If a and (n) are relatively prime, then a Z* (n) and from Corollary of Claim 2 we
know that b exists (and is a member of Z* (n)).
Thus there exists a and b, both relatively prime to (n), such that:
ab = k(n) + 1 (regular arithmetic)
13
Take a message m < n and choose a relatively prime to (n) and find b such that a
b=1 mod (n).
Now compute (ma)b using modulo n arithmetic:
(ma)b = mk(n) + 1 = mk(n) m = m(n) m(n) m(n) m
Take the modulo of the last term and since m(n) = 1 mod n, then result is m.
Hence (ma)b = m mod n
Deficiency of this proof: The proof is for all messages in Z*n
If n=512 bit number, then the chance of a number being in Z n but not in Z*n is about
1025. That is negligible.
So we use it as follows:
We know ab = n + 1
Or
n + ab = 1
14
So b = y
Hence in modulo arithmetic,
b = y, if y is positive and
b = (n) y, if y is negative
Hence the keys, a and b can be computed easily using the Extended Euclidian
algorithm.
But how would we really find the prime numbers? There are many theorems available
that can be used to find if the given number is prime or not. One of the most popularly
used theorems for finding if a given number is prime or not is the Fermats little
theorem. It states that for any a that is less than p, a p-1 = 1 mod p. We can use this
theorem to test the primality of a number, called as primality testing. The proof of the
theorem is given below.
Since p is prime, a Z* p and (p) = p 1
15
Thus
Then choose a number a < p, randomly. We will use a to test the primality of
p. First, we know that if p is prime, ap-1 is 1 (mod p). Secondly, we know that
if for some x (where x is not 1 or p-1), if x2 is 1 or p-1 (mod p) then p is not
prime.
16
the encryption component e and a decryption component d. This is done using the
Extended Euclidian algorithm. That is we need to find a number e, such that gcd(e,
(n)) = 1. All the powering and gcd calculations are clearly in polynomial time in the
number of bits of n. Our task is to find a number e such that gcd(e, (n)) = 1. We
know that the fraction of elements, which are relatively prime to N, is (1/ logN). So
setting N = (n), after o(logN) random trials for e, we should be able to get an e which
is prime to (n). This is still all polynomial in the number of bits of n.
Hence the complexity of the RSA algorithm is polynomial in time with respect to the
length of the key and the modulus, n.
2.3. Primes is in P:
As we saw in the previous sections, Prime numbers are basis for RSA encryption and
decryption. But how do you know that the number we chose is prime or not? There has been
research going on for more than 200 years in finding out a good deterministic polynomial
time algorithm which will take a number as a input and will tell if it is prime or not in
polynomial time. Till recently no one was able to produce a deterministic polynomial time
algorithm for this problem, though there had been lot of random polynomial time algorithm
and probabilistic algorithms available. Recently in the year 2002, a professor and two of his
students from the Indian Institute of Technology, Kanpur came up with a deterministic
polynomial time algorithm for this problem. Thanks to them as the 200 year problem has been
solved. In this section we will look at that algorithm and how it works. In the next section, we
will look at the complexity of the algorithm.
18
Next h(x) will be a factor of xr-1/x-1 unless stated otherwise. The author has used the
symbol ~O(t(n)) for O(t(n)poly(log t(n))), where t(n) is some function of n. Unless
stated otherwise, the author uses log with respect to base 2.
Next look at some of the algebraic results that are useful in understanding this
algorithm. Let p and r be prime numbers, p != r. the following results are observed
and some of the results were proved by the author. In this section I am just producing
the rules that are used and for the proofs, please refer to the original paper by the
authors.
1. The multiplicative group of any field Fpt for t > 0, denoted by F*pt is cyclic.
2. Let f(x) be a polynomial with integral coefficients. Then
f(x)p f(xp) (mod p)
3. Let h(x) be any factor of xr - 1. Let m mr (mod r). Then
xm xmr (mod h(x)):
4. Let or(p) be the order of p modulo r. Then in Fp, xr-1/x-1 factorises into irreducible
polynomials each of degree or(p).
In addition to the above algebraic facts, we will need the following two number
theoretic facts.
Let P(n) denote the greatest prime divisor of n. There exist constants c > 0 and
n0 such that, for all x >= n0
|{P| P is prime, P<=x and P(p-1) > x2/3}| >= C x/log x
2.3.2 Algorithm:
The algorithm that computes and tells if the given number is prime or not is given
below. This algorithm gets an input that is greater than 1 and computes and outputs
either COMPOSITE or PRIME.
19
2.
r = 2;
3.
while(r < n) {
4.
5.
if (r is prime)
6.
7.
8.
break;
9.
r = r + 1;
10.
11.
for a = 1 to 2r log n
12.
if ( (x - a)n !
COMPOSITE;
13.
output PRIME;
The while loop cannot return COMPOSITE since gcd(n, r) = 1 for all r <= c 2(log n)6,
where c2 is defined in one of the lemmas given by the author. We know by the fact 2
that the for loop also cannot return COMPOSITE. Thus, algorithm will identify n as
PRIME. Now let us turn our attention to the case where a composite n is input to our
20
algorithm. The significance of the r found by the while loop arises when n is
composite with say pi; 1 <= i <=
lcmi{or(pi)} and hence there exists a prime factor p of n such that q | o r(p), where q is
the largest prime factor of r-1. For the remainder of the argument, let p be such a
prime factor of n.
The second loop of the algorithm uses the value of r obtained to do polynomial
computations on l = 2r log n binomials: (x-a) for 1 <= a <= l. By fact 4, we have a
polynomial h(x) (factor of xr _ 1) of degree d = or(p) irreducible in Fp. Note that
(x - a)n (xn - a)(mod xr - 1, n)
the above equation implies that
(x - a)n (xn - a)(mod h(x), p)
So the identities on each binomial hold in the field Fp[x]/(h(x)). The set of l binomials
form a large cyclic group in this field.
Suppose that the algorithm returns PRIME instead. Thus, the for loop ensures that for
all
1 <= a <= 2r log n,
(x - a)n (xn - a)(mod xr - 1, p)
Notice that g(x) is just a product of powers of l binomials (x _ a), (1 <= a <= l) all of
which satisfy the above equation. Thus,
g(x)n g(xn) (mod xr _ 1, p)
21
Then author goes on to use two more lemmas that he has showed in his paper to
determine the values of Ig(x). Finally he proves that n = p is a contradictory. Hence the
algorithm returns COMPOSITE if n is composite.
In practice, however, this algorithm is likely to work much faster. The reason is that even
though we only know that there are many" primes r such that P(r - 1) > r2/3, a stronger
property is believed to be true. In fact it is believed that for many primes r,
P(r - 1) = (r 1)/2 .
22
23
authorities. Its hard to find ECC digital certificates. So even if you want to use ECC,
you might not be able to get a certificate.
Currently in the industry, RSA is winning. The key size, transmission size and
signature performance issues concern makers of small devices. But they often find
that RSA is fast and small enough. Sure, its not the fastest signer or the smallest key,
but it still works just fine. And RSA has a well-developed certificate infrastructure.
N
24
3. SYSTEM ANALYSIS
EXISTING SYSTEM:
in
generating
the
suitable
recommendations
for
PROPOSED SYSTEM:
These keys will works dependently for extracting and generating the content
relation to be managed later by the key management that helps to
communicate and share sensitive information.
25
There are inherent possibilities if suitable key management processes are not
accompanied because of the intricacy of dispensing keys to all block in a
certain fashion.
This risk can be meaningfully appeased through sufficient key controls and
proper education on encryption key management.
System Requirements:
Hardware Requirements:
System
Hard Disk
Monitor
Mouse
Ram
: 40 GB.
: 15 VGA Colour.
: Logitech.
: 256 Mb.
Software Requirements:
Front End
Tool
:- JAVA, Swing(JFC)
:Eclipse 3.3
26
4. SYSTEM STUDY
2.1 FEASIBILITY STUDY
The feasibility of the project is analyzed in this phase and business
proposal is put forth with a very general plan for the project and some cost
estimates. During system analysis the feasibility study of the proposed system is
to be carried out. This is to ensure that the proposed system is not a burden to the
company. For feasibility analysis, some understanding of the major requirements
for the system is essential.
Three key considerations involved in the feasibility analysis are
ECONOMICAL FEASIBILITY
TECHNICAL FEASIBILITY
SOCIAL FEASIBILITY
ECONOMICAL FEASIBILITY
This study is carried out to check the economic impact that the system will
have on the organization. The amount of fund that the company can pour into the
research and development of the system is limited. The expenditures must be justified.
Thus the developed system as well within the budget and this was achieved because
most of the technologies used are freely available. Only the customized products had
to be purchased.
TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the
technical requirements of the system. Any system developed must not have a high
demand on the available technical resources. This will lead to high demands on the
available technical resources. This will lead to high demands being placed on the
client. The developed system must have a modest requirement, as only minimal or
null changes are required for implementing this system.
SOCIAL FEASIBILITY
The aspect of study is to check the level of acceptance of the system by the user.
This includes the process of training the user to use the system efficiently. The user
27
must not feel threatened by the system, instead must accept it as a necessity. The level
of acceptance by the users solely depends on the methods that are employed to
educate the user about the system and to make him familiar with it. His level of
confidence must be raised so that he is also able to make some constructive criticism,
which is welcomed, as he is the final user of the system.
28
5. SYSTEM DESIGN
29
sender
Secret data
receiver
secret data
30
6. IMPLEMENTATION
Implementation is the stage of the project when the theoretical design is turned out
into a working system. Thus it can be considered to be the most critical stage in
achieving a successful new system and in giving the user, confidence that the new
system will work and be effective.
The implementation stage involves careful planning, investigation of the
existing system and its constraints on implementation, designing of methods to
achieve changeover and evaluation of changeover methods.
Main Modules:-
MODULES:
Decryption Module
31
7. SYSTEM TESTING
TYPES OF TESTS
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. It is the testing of
individual software units of the application .it is done after the completion of an
individual unit before integration. This is a structural testing, that relies on knowledge
of its construction and is invasive. Unit tests perform basic tests at component level
and test a specific business process, application, and/or system configuration. Unit
tests ensure that each unique path of a business process performs accurately to the
documented specifications and contains clearly defined inputs and expected results.
Integration testing
Integration tests are designed to test integrated software components to
determine if they actually run as one program. Testing is event driven and is more
concerned with the basic outcome of screens or fields. Integration tests demonstrate
that although the components were individually satisfaction, as shown by successfully
unit testing, the combination of components is correct and consistent. Integration
32
combination of components.
Functional test
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system
documentation, and user manuals.
Functional testing is centered on the following items:
Valid Input
Invalid Input
Functions
Output
System Test
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration test.
System testing is based on process descriptions and flows, emphasizing pre-driven
process links and integration points.
33
purpose. It is purpose. It is used to test areas that cannot be reached from a black box
level.
Features to be tested
34
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
35
8. RESULTS
SAMPLE SCREENS
Screen shots
36
37
38
39
CONCLUSION
Cryptography can be a technology that develops, but as long as security is made by
man, cryptography is as good as the practice of people who uses it. This paper focused
on the different security issues for providing a secure and effective cryptography
technique over the block cipher. Most of these issues occurred when users leave keys
unattended, keys that were chosen were easy to remember or maintain the same keys
for years. This can be resolved by the suggested model, using the encrypting key that
existed independently as an external tool by managing keys sequentially.
40
10. BIBLIOGRAPHY
Good Teachers are worth more than thousand books, we have them in Our
Department
42
http://www.roseindia.com/
http://www.java2s.com/
43