Skip to content

frezario/rsa_chat_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSA CHAT

A simple multi-core chat that involves the usage of RSA encryption.

Based on textbook RSA (prime numbers are close to 2^512)

To run, simply execute the server.py and then client.py-s one by one.

Then, just type some text into one of the user terminals and enjoy the result.

HOW IT WORKS?

Suppose user Alice wants to send a secret message to user Bob. Then, we might want to build a protected connection between both of users.

This protected connection is our server.

The algorithm is the following:

  1. A server and Alice exchange public keys: server receives Alice public kay and Alice receives server public key.
  2. The same goes for Bob.
  3. Alice encrypts the message using server public key and somehow shows that it is for Bob. In our case, we chose message | id format to show that message message should be delivered to the client with id id.
  4. Server receives the message, decrypts it using it's own private key.
  5. Server decrypts the message using Bob's public key and sends it to Bob.
  6. Bob receives encrypted message using his private key and now can read the secret.

Checking of the message integrity is implemented: check whether the hash of the sent message before encoding is equal to the hash of the received message after decoding.

If id wasn't specified, we simply show message to all receivers.

The example of usage:

usage

About

A simple multi-core chat that involves the use of RSA encryption.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages