Code Monkey home page Code Monkey logo

cmpt361-spycomm's Introduction

#SPYCOMM AND SPYCOMMD ###CMPT 361 - Introduction to Networks ###Instructor: Dr. Nicholas M. Boers ###Assignment 3 ###MacEwan University ###Group 4: Nick, John, Alex, Kevin


###Purpose

Spycomm and spycommd are a pair of programs meant for secure file transmission. It securely transfers files by encrypting and decrypting files using an OTP (one time pad) that both the client (spycomm) and server (spycommd) have. The OTP shall never be re-used, and the server manages what was used.

###Usage

The server (spycommd) can be initialized simply by executing the program:

./spycommd [-p PORT_NUMBER] 

If a port number is not specified, spycommd will use the default port: 36115.

The user can send files using the client (spycomm):

./spycomm -c HOST -p PORT -o OTP_PATH FILE_PATH.... 

The server and client must have access to the same OTP. An OTP can be generated using the included script "otp.sh", although any method can be used to generate the OTP. The filename should be the MD5 digest with an extension of ".dat" and be placed in the otp folder for the server. The "otp.sh" script automates this process. For maximum security, OTPs should be given using a physical medium rather than over a network. The OTP should always be bigger than the file(s) needing to be transferred.

Usage for otp.sh:

./otp.sh SIZE...

Where SIZE is the size of the OTP to generate in KiB. Multiple OTPs can be generated by passing more sizes as arguments.

The server will save the files in a folder called "serverfiles" in the same directory as spycommd. The received files from a session will be saved in a folder consisting of the date time stamp and a unique number. A file will always be added in each folder called "info.txt" which contains information about the data transmission session. If a file was sent with the name "info.txt" it will append the name with another ".txt".

Spycomm and spycommd will always write to a log named "spycomm.txt" and "spycommd.txt" respectively.

###Notes

  • Be advised that filenames are sent in the clear. This isn't a design decision, there wasn't enough time to have it encrypted as well as that would require changing the protocol.
  • spycomm does not grab files recursively, it will ignore any folder it comes across. If you wish to include everything, glob the folder contents with the '*' character.
  • An OTP with same size as file needing to be transferred cannot be used, as a bit of OTP is used for authentication.

cmpt361-spycomm's People

Contributors

edwardsnick avatar afmartin avatar reboss avatar shibbywan avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar  avatar  avatar

Forkers

edwardsnick

cmpt361-spycomm's Issues

Buffer Overflow Attack Susceptibility

Went for an interview and they pointed out a security exploit in our system.

In struct _fileInfo on line 63, it contains the following member:

long long int fileLen;

The file length should never be negative so it shouldn't be signed. If the user passes a negative number, it will be interpreted as a REALLY big integer. On line 624 we receive all and just accept whatever we get. Which can leave to overwriting our packet buffer and bad things happen.

Changing the long long int to a unsigned would cause line 273 to create a compile warning:

info->fileLen = atoll(temp);

So we'd need a substitute for atoll.

Just wanted to point this out incase any of you guys put Spycomm on your resume.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.