Giter Club home page Giter Club logo

cmpt785-bibifi's Introduction

BiBiFi - CMPT785

The encrypted file system will reside on the host file system as a regular file system but with more security. This file system is being used by multiple clients/users since we can't afford to have different storage for each of our users and want to optimally use all of the available storage.

forthebadge

Compile

Docker (preferred):

Build image (dynamic)

docker build -t fileserver -f dockerfile

Build image (static)

docker build -t fileserver -f dockerfile-static

Run container

docker run --rm -it <image> bash

Unix:

Dynamic binary

NOTE - install devel package for openssl first based on your distro - openssl-devel(rpm), libssl-dev(deb)

g++ -std=c++17 main.cpp -o fileserver -lssl -lcrypto

Static binary

g++ -std=c++17 main.cpp -o fileserver -static -lssl -lcrypto -ldl -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -static-libgcc

User Features

  • cd <directory> - The user provides the directory to move to. It accepts . and .. as current and parent directories respectively and support changing multiple directories at once (cd ../../dir1/dir2). cd / takes you to the current user’s root directory. If a directory doesn't exist, the user stays in the current directory.
  • pwd - Print the current directory. Each user has /personal and /shared base directories.
  • ls - Lists the files and directories in the current directory separated by a new line. Shows the directories . and .. as well. To differentiate between a file and a directory, the output look as follows:
    • d -> .
    • d -> ..
    • d -> directory1
    • f -> file1
  • cat <filename> - Reads the actual (decrypted) contents of the file. If the file doesn't exist, it prints " doesn't exist"
  • share <filename> <username> - Shares the file with the target user which appears under the /shared directory of the target user. The files are shared only with read permission. The shared directory is read-only. If the file doesn't exist, it prints "File doesn't exist". If the user doesn't exist, it prints "User doesn't exist".
  • mkdir <directory_name> - Creates a new directory. If a directory with this name exists, it prints "Directory already exists"
  • mkfile <filename> <contents> - Creates a new file with the contents. The contents are printable ascii characters. If a file with exists, it replaces the contents. If the file was previously shared, the target user will see the new contents of the file.
  • exit - Terminates the program.

Admin Features

  • Admin has access to read the entire file system with all user features
  • adduser <username> - This command creates a keyfile called username_keyfile on the host which is used by the user to access the filesystem. If a user with this name already exists, it prints "User already exists"

Contributing

Fork it (https://github.com/Madhvik-P/CMPT785-BiBiFi)
Create your feature branch (git checkout -b feature/fooBar)
Commit your changes (git commit -am 'Add some fooBar')
Push to the branch (git push origin feature/fooBar)
Create a new Pull Request

cmpt785-bibifi's People

Contributors

ankit1202 avatar anant00729 avatar sh-ubh avatar abhi10010 avatar madhvik-p avatar

Watchers

 avatar

Forkers

anant00729

cmpt785-bibifi's Issues

Fix-It Issues

For reference, the reports are available here: https://canvas.sfu.ca/courses/74693/pages/bibifi

Please raise a single Pull request for each issue and add the pull requests under this issue.

  1. Allowing . and .. as filenames and usernames breaks the functionality. (G2 pg6, G6)
  2. Allowing users with username / leads to system information leakage. (G2 pg8)
  3. Using the first _ to detect the username doesn’t always work. If there are users with username 1 and 1_, user with 1_ will not be able to login. (G2 pg9)
  4. Spaces at the end of the commands should be ignored. (G2 pg11)
  5. Shared files are not getting updated. (G2 pg11)
  6. Allows creation of . and .. directories breaks functionality. Going inside directory .. leaves the user unable to leave the directory. (G6 pg5)

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.