Giter Club home page Giter Club logo

mylar's Introduction

Mylar - ported to Meteor v1.1

![Gitter](https://badges.gitter.im/Join Chat.svg)

About

Web applications rely on servers to store and process confidential information. However, anyone who gains access to the server (e.g., an attacker, a curious administrator, or a government) can obtain all of the data stored there.

Mylar protects data confidentiality even when an attacker gets full access to servers. Mylar stores only encrypted data on the server, and decrypts data only in users' browsers.

Simply encrypting each user's data with a user key does not suffice, and Mylar addresses three challenges in making this approach work.

  • First, Mylar allows users to share keys and data securely in the presence of an active adversary (man in the middle attack or a malicious administrator actively tampering with the data sent to the client)
  • Second, Mylar allows the server to perform keyword search over encrypted documents
  • Finally, Mylar ensures that client-side application code is authentic, even if the server is malicious.

Check it out

Just start and examine the example chat

    cd example_EncChat/
    meteor

    // => App running at: http://localhost:3000/

Create a new User, then create a new room. Hack in a message. Send.

If you now take a look at the local Meteor-MongoDb (with a gui like Robomongo or the meteor mongo-shell, you will see a field named "message_enc" that contains the encryption of the message. There should be no field "message", which before contained the unencrypted data and will only appear on the client when the message is successfully decrypted.

Use it

First, read the MIT Mylar paper in /docs/MIT_Mylar.pdf and make sure you understand the section "Building a Mylar application".

Mylar is directly hooking into core packages like DDP, Mongo and the Accounts system to intercept the data stream for truly transparent encryption. So we can not simply provide Mylar as an Meteor package (right now) - we have to override core packages!

Luckily this is easy with the new package system.

    // copy or symlink everything in /packages to
    // your meteor project's packages folder

    // copy
    cp -R packages/* /your/project/packages/

    // symlink - go into your projects package dir, then do this:
    // of course replace "../../packages" with a path to the mylar package dir
     find ../../packages -type d -mindepth 0 -maxdepth 1 -exec ln -s '{}' . \;

Look at the /example_EncChat for how to get started with collection declarations.

example_EncChat/model.js (client & server)

    //
    Messages._encrypted_fields({
        'message': {
            princ: 'roomprinc',
            princtype: 'room',
            auth: ['_id']
        }
    });
    Messages._immutable({roomprinc: ['rID', 'roomTitle', '_id']});


important for the IDP, we need to publish explicitly the _wrapped_pk fields of the user doc (for now)

    Meteor.startup(function () {
        // pub
        if (Meteor.isServer) {
            Meteor.publish("users", function () {
                return Meteor.users.find(this.userId, {fields: {}});
            });
        }
        // sub
        if (Meteor.isClient) {
            Tracker.autorun(function () {
                Meteor.subscribe("users");
            })
        }
    })

Then go to /docs and also check out /enc_modules for (partially outdated) implementation details.

Contribution Info

I marked all mylar-related modifications to the core packages ddp and mongo with MYLAR START/END comments for easier merging. Can we wrap this into a single package overriding the core packages by any chance?

Enable search & building the enc_server

You'll need the following libraries to build Mylar:

  • libreadline
  • libgmp
  • libpbc
  • libcrypto++9

Open a browser and visit localhost:3000 or from a different machine than the server, visit http://:3000. Have fun with the application!

The app is secured against passive adversaries (adversaries who read all data at the server, but do not actively change information).

To enable search, you need two things:

  1. Install the search plugin In order to use the search plugin, you'll need to build it for your system using the FireBreath framework for Firefox. You should navigate to enc_modules/crypto_fire and follow the README there in order to set it up. In addition, there is a binary that works on some systems in the enc_modules/crypto_fire/Binaries/ folder, which you should copy to: $(HOME)/.mozilla/plugins/, creating the plugins folder if necessary.

  2. add the search package to the application meteor add search

mylar's People

Contributors

arbesfeld avatar avital avatar awwx avatar benjamn avatar clarete avatar cmather avatar dandv avatar debergalis avatar dgreensp avatar ed-von-schleck avatar estark37 avatar glasser avatar gschmidt avatar html5cat avatar jonathankingston avatar justinsb avatar marcandre avatar mariapacana avatar meonkeys avatar mitar avatar mizzao avatar mquandalle avatar n1mmy avatar possibilities avatar slava avatar strikeout avatar timhaines avatar tmeasday avatar zealoushacker avatar zol avatar

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.