Skip to content

CMPUT-275/RSA-2-Way-Communication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

--------------------------------------------------------------------------
 CMPUT 274 | Fall 2019
 Names: Justin Javier, Darius Fang

 Major Assigment #2 : Part 2

 Description: Two-way communication with RSA encryption using 2 Arduinos
 			  one acts as server the other acts as client.

--------------------------------------------------------------------------

Included Files:
	-encrypted_communication_part2.cpp
	-README
	-Makefile

Ascessories:
	-2 Aurduino Mega 2560
	-5 wires
	-1 resister 1k ohms

Wiring Instrudctions:
	Ard A GND     <--->  Ard B GND
	Ard A PIN 13  <--->  Resistor   <---> Ard A 5V
	Ard A TX3     <--->  Ard B RX3
	Ard A RX3     <--->  Ard B TX3
	Ard B PIN 13  <--->  Ard B GND


Running Instructions:
	1. Connect both Arduino using an A-B USB cable to either different ports on 1 computer or 2 different computers. Assure that the Arduino is using the proper port (/dev/ttyACM0 or -ACM1). If using only 1 computer make sure to set the serial-ports by using the command:

		arduino-port-select

	Follow the prompts given assigning Ard A to serial port 0 and Ard B to serial port 1.

	2. Traverse to the directory containing the encrypted_communication_part2.ccp and Makefile files. Type the following into the command line:

		make upload && serial-mon

	This will upload the program to the Arduino and open the serial monitor.
	If using only 1 computer, open two command lines and input the following command into one of the command lines:

		make upload-0 && serial-mon-0

	and the following command into the other command lines

		make upload-1 && serial-mon-1



Notes and Assumptions:
	- Arduino A acts as Server
	- Arduino B acts as Client
	- Arduino A PIN 13 is connected to 5V
	- Arduino B PIN 13 is connected to GND
	- Keys are generated before the handshake occurs
	- e,q, and p are randomly generated by reading in 1 bit at a time from A1
	- e is 15 bits
	- n is given by q*p which is in the range [2^29, 2^32)
	- d is found by using the extended euclidean algorithm given in class
	- This can average around 1 to 10 seconds depending on the random analog generator
	- Arduino A listens and reads client key and mod while writes it's own key and mod, then waits for acknowledgement
	- Arduino B reads 'C'(connection request) and it's own key mod, then waits for acknowledgement and writes server key and mod.
	- Do not type in either serial until the text displays "Chat is open:"
	- Do not hold arrow keys or spam keyboard (overflows input)
	- Typing is echoed
	- Pressing the enter key will gives a return carriage and newline character
	- If the arduinos are taking a long time to generate their keys, shaking them might help




About

Two-way communication with RSA encryption Aurdino

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors