Giter Site home page Giter Site logo

xtrendence / filedrop Goto Github PK

View Code? Open in Web Editor NEW
139.0 4.0 8.0 13.07 MB

Grade: 89%. COMP3006 coursework. An encrypted file sharing application that leverages web sockets to allow users to send and receive files.

Home Page: https://www.xtrendence.dev/pages/filedrop/

License: GNU Affero General Public License v3.0

JavaScript 66.42% EJS 7.15% CSS 22.20% Dockerfile 0.09% HTML 4.14%
file-sharing file-upload encrypted-files encrypt encryption aes-encryption rsa-encryption socket-io airdrop websocket

filedrop's Introduction

FileDrop

Banner

Downloads

Based on GitHub Release downloads and DockerHub pulls.

Disclaimer

This was made as the coursework for my COMP3006 university module. The requirements were to develop a responsive and interactive web application that uses web sockets, Node.js, and PouchDB or MongoDB as its server-side database. This project got 89/100.

What is FileDrop?

FileDrop is an application that allows for encrypted file sharing between two users through the use of web sockets.

How does it work?

You download the application for the operating system you use from the Releases section, and run the app. Once you can see the IP and port of the server, it means it's working. You can then use any device on the same network to navigate to that IP and port. From there, you can choose a username and log in. Devices that are logged in would be able to see each other. At this point, you can ask for another client's permission to send them a file, or manually whitelist a client so they can send you a file whenever they wish.

How can I host the server without using the Electron app?

Electron apps are big, no arguments there. You can simply download the source code (or ManualServer.zip from the Releases section), open a terminal in the same directory as the package.json file, run npm install followed by npm start. Alternatively, you can use the Docker image (further instructions can be found in the README on DockerHub).

How does the encryption work?

First and foremost, all encryption is done on the client-side so that the server doesn't need to be trusted. This also increases performance as encryption is a resource-intensive task, and by distributing the workload between clients, the server can transfer files as fast as possible. When the page first loads, an RSA public/private key pair is generated and stored in the browser's local storage. The public key is then broadcasted to other clients. When the user chooses a file and clicks on the upload button, the file is split into chunks of 256KB. A 256-bit AES key is then generated, and the public RSA key of the client the user is sending the file to is used to encrypt the AES key. The AES key is then used to symmetrically encrypt each chunk before sending it to the server. The encrypted AES key is sent with the encrypted chunk data as well. The other client then uses their private key to decrypt the AES key, which they can use to decrypt the chunk data. Once all the chunks have been received, they're put together to form the original file, which is then downloaded to the client's device.

What does the app look like?

Login Page

Login

Application Page

Application

Attributions

Resource URL
Mockup Devices Device Shots
Login Background BG Jar
Main Background SVG Backgrounds
Font Awesome Font Awesome
Jest NPM
CORS NPM
EJS NPM
Express NPM
Jest NPM
Nodemon NPM
PouchDB NPM
Socket.IO NPM
Socket.IO Client NPM
SuperTest NPM
CryptoJS NPM
Forge NPM
Puppeteer NPM
Electron NPM
Electron Builder NPM
Electron Local Shortcut NPM

filedrop's People

Contributors

xtrendence avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

filedrop's Issues

macos installation error

running big sur. Getting following error :
A JavaScript error occurred in the main process
Uncaught Exception:
Error: dlopen(/Applications/FileDrop.app/Contents/Resources/app/node_modules/leveldown/build/Release/leveldown.node, 1): no suitable image found. Did find:
/Applications/FileDrop.app/Contents/Resources/app/node_modules/leveldown/build/Release/leveldown.node: mach-o, but wrong architecture
/Applications/FileDrop.app/Contents/Resources/app/node_modules/leveldown/build/Release/leveldown.node: mach-o, but wrong architecture
at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800)
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:829:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:94:18)
at load (/Applications/FileDrop.app/Contents/Resources/app/node_modules/node-gyp-build/index.js:20:10)
at Object. (/Applications/FileDrop.app/Contents/Resources/app/node_modules/leveldown/binding.js:1:43)

FileDrop Fails to Load when Reverse Proxied

I set up FileDrop with Docker and used Traefik to act as a Reverse Proxy to https (443). Unfortunately, FileDrop fails to fully load due to a check looking to get the port number:

image

utils.js:20

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace')
    at getPort (utils.js:20)
    at getIP (utils.js:13)
    at HTMLDocument.<anonymous> (main.js:40)
getPort @ utils.js:20
getIP @ utils.js:13
(anonymous) @ main.js:40 

If I access FileDrop directly with the unproxied port number, FileDrop loads.

Windows install error

Hello, please see the error snipped. Any suggestions? Installing on a Windows 10 Pro 64bit machine.

image

unusable on MacOS

Hi tried several times between two Macs running Big Sur.
First time using encryption, getting an undefined file with zero octets.
Using without encryption, nothing happens in destination's download folder.
No OS firewall running on machines, lulu in one and little snitch on destination, but not getting any alert and server says file transfer successful...

Dockerfile and Docker image

It would help a lot if you could at least add a Dockerfile, and at best also a Docker image :)

If you can produce and maintain a Dockerfile, I can make a PR to have GitHub automatically compile it and send it to DockerHub (you'll need to provide a password as a GitHub secret, but it's not complicated).
You can then select platforms for which you want to make your software available (amd64, arm, etc).

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.