CRYPTOGRAPHY BASED 
Chat System 
Submitted By: 
Himanshu shakhar 
Jagsir singh
INDEX 
 Introduction 
 Purpose 
 Technologies to be used 
 Cryptography 
 Overview 
 Objective & Scope 
 Limitation 
 CONCLUSIONS & FUTURE SCOPE 
 References
Introduction 
This particular project is a solution developed to communicate between the users across worldwide 
through Internet. The concept of sending letters and telegraphs has been reduced due to the new 
era of Internet Mailing. One such facility is being provided by the Chat Server. 
Due to a lot of hacking tricks used by hackers to access private information. It is must to secure our 
information before sending. So cryptography is used in the chat system. 
Cryptography is the science of coding and decoding messages so as to keep these messages secure.
Purpose 
PURPOSE OF THE PROJECT: This Project is used basically for chatting purpose with the remote 
clients or users on Internet or local networks. Here in this project a java client / server 
combination is used to chat with remote users. 
It maintains two levels of users:- 
 Server 
 Clients 
The Software includes:- 
 One Friend Send Message 
 Other Friend give the Response of given message. 
 Show all Chats message before yet b/w friends.
Public key cryptography 
 Public key cryptography is based on cryptographic algorithms that use two 
related keys, a public key and a private key; the two keys have the property 
that, given the public key, it is computationally infeasible to derive the 
private key. A user publishes his/her public key in a public directory and keeps 
his/her private key to himself/herself. 
 According to the purpose of the algorithm, there are public-key 
encryption/decryption algorithm. An encryption algorithm could be used to 
encrypt a data (for example, a key) using the public key so that only the 
recipient who has the corresponding private key could decrypt the data. 
Typical public key encryption algorithm is RSA .
What is RSA ? 
 RSA stands for Ron Rivest, Adi Shamir and Leonard Adleman, who first publicly 
described the algorithm in 1977. 
 RSA is one of the first practicable public-key cryptosystems and is widely used 
for secure data transmission. 
 In such a cryptosystem, the encryption key is public and differs from the 
decryption key which is kept secret. 
 These keys are created using RSA algorithm, processing on large prime 
numbers. 
 In RSA, this security is based on the practical difficulty of factoring the 
product of two large prime numbers.
Encryption and decryption 
Sender transmits her public key (n, e) to receiver and keeps the private key d secret. sender then 
wishes to send message M to receiver. 
He first turns M into an bytes m[],. He then computes the ciphertext c corresponding to 
Receiver can recover m from c by using his private key exponent d via computing
Key generation 
 Choose two distinct prime numbers p and q. 
 Compute n = pq. 
 Compute φ(n) = φ(p)φ(q) = (p − 1)(q − 1) = n - (p + q -1), where φ is Euler's 
totient function. 
 Choose an integer e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1; i.e., e and 
φ(n) are coprime. 
 e and n are released as the public key. 
 Determine d from the equation e X d mod φ(n) =1. 
 d and n are private keys and kept secret.
Key generation example 
 Choose two distinct prime numbers, such as 
 p = 61 and q = 53 
 Compute n = pq, giving n = 61 x 53 = 3233 
 Compute the totient of the product as φ(n) = (p − 1)(q − 1), giving (61 - 1)(53 - 1) = 3120 
 Choose any number 1 < e < 3120 that is coprime to 3120. 
 Let e = 17 
 Compute d from ( e x d ) mod φ(n) =1; 
 Yielding d = 2753
Example of encryption and decryption 
in order to encrypt m = 65, we calculate 
To decrypt c = 2790, we calculate
Overview 
Project is related to Private Chat Server 
The project maintains two levels of users:- 
• Server Level 
• Client or Friends 
In this project collection of message is hold in DataInputStream.
Merits 
 Accuracy 
 Reliability 
 No Redundancy 
 Immediate retrieval of information 
 Immediate storage of information 
 Easy to Operate
Limitation 
 It is limited to only two clients. The existing Chat Server System is only meant 
for transfer of messages from one client to the other 
 the messages cannot be formatted and made attractive to look as well as 
graphical emotional pictures cannot be added to send messages. 
 This system does not provide the facility of adding friends and exclusively 
chatting with the particular added friend.
References 
 Wikipedia.com 
 Tutorialspoint.com 
 Stackoverflow.com
Thank You

Cryptography based chat system

  • 1.
    CRYPTOGRAPHY BASED ChatSystem Submitted By: Himanshu shakhar Jagsir singh
  • 2.
    INDEX  Introduction  Purpose  Technologies to be used  Cryptography  Overview  Objective & Scope  Limitation  CONCLUSIONS & FUTURE SCOPE  References
  • 3.
    Introduction This particularproject is a solution developed to communicate between the users across worldwide through Internet. The concept of sending letters and telegraphs has been reduced due to the new era of Internet Mailing. One such facility is being provided by the Chat Server. Due to a lot of hacking tricks used by hackers to access private information. It is must to secure our information before sending. So cryptography is used in the chat system. Cryptography is the science of coding and decoding messages so as to keep these messages secure.
  • 4.
    Purpose PURPOSE OFTHE PROJECT: This Project is used basically for chatting purpose with the remote clients or users on Internet or local networks. Here in this project a java client / server combination is used to chat with remote users. It maintains two levels of users:-  Server  Clients The Software includes:-  One Friend Send Message  Other Friend give the Response of given message.  Show all Chats message before yet b/w friends.
  • 5.
    Public key cryptography  Public key cryptography is based on cryptographic algorithms that use two related keys, a public key and a private key; the two keys have the property that, given the public key, it is computationally infeasible to derive the private key. A user publishes his/her public key in a public directory and keeps his/her private key to himself/herself.  According to the purpose of the algorithm, there are public-key encryption/decryption algorithm. An encryption algorithm could be used to encrypt a data (for example, a key) using the public key so that only the recipient who has the corresponding private key could decrypt the data. Typical public key encryption algorithm is RSA .
  • 6.
    What is RSA?  RSA stands for Ron Rivest, Adi Shamir and Leonard Adleman, who first publicly described the algorithm in 1977.  RSA is one of the first practicable public-key cryptosystems and is widely used for secure data transmission.  In such a cryptosystem, the encryption key is public and differs from the decryption key which is kept secret.  These keys are created using RSA algorithm, processing on large prime numbers.  In RSA, this security is based on the practical difficulty of factoring the product of two large prime numbers.
  • 7.
    Encryption and decryption Sender transmits her public key (n, e) to receiver and keeps the private key d secret. sender then wishes to send message M to receiver. He first turns M into an bytes m[],. He then computes the ciphertext c corresponding to Receiver can recover m from c by using his private key exponent d via computing
  • 8.
    Key generation Choose two distinct prime numbers p and q.  Compute n = pq.  Compute φ(n) = φ(p)φ(q) = (p − 1)(q − 1) = n - (p + q -1), where φ is Euler's totient function.  Choose an integer e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1; i.e., e and φ(n) are coprime.  e and n are released as the public key.  Determine d from the equation e X d mod φ(n) =1.  d and n are private keys and kept secret.
  • 9.
    Key generation example  Choose two distinct prime numbers, such as  p = 61 and q = 53  Compute n = pq, giving n = 61 x 53 = 3233  Compute the totient of the product as φ(n) = (p − 1)(q − 1), giving (61 - 1)(53 - 1) = 3120  Choose any number 1 < e < 3120 that is coprime to 3120.  Let e = 17  Compute d from ( e x d ) mod φ(n) =1;  Yielding d = 2753
  • 10.
    Example of encryptionand decryption in order to encrypt m = 65, we calculate To decrypt c = 2790, we calculate
  • 11.
    Overview Project isrelated to Private Chat Server The project maintains two levels of users:- • Server Level • Client or Friends In this project collection of message is hold in DataInputStream.
  • 12.
    Merits  Accuracy  Reliability  No Redundancy  Immediate retrieval of information  Immediate storage of information  Easy to Operate
  • 13.
    Limitation  Itis limited to only two clients. The existing Chat Server System is only meant for transfer of messages from one client to the other  the messages cannot be formatted and made attractive to look as well as graphical emotional pictures cannot be added to send messages.  This system does not provide the facility of adding friends and exclusively chatting with the particular added friend.
  • 14.
    References  Wikipedia.com  Tutorialspoint.com  Stackoverflow.com
  • 15.