Git Product home page Git Product logo

userless's Introduction

#userless This is an attempt at a user authentication service that knows nothing about the user; it revolves around an email and password, but the server knows neither, and cannot verify if a given email is a user, without the password as well. The service is very resistant to brute force, as it requires a valid signature of the current time in nanoseconds for login, so there must be one request for every password attempt. This code should be treated as a reference implementation of the crypto scheme described in the spec, and can't just be plugged in to your application without any work, but it also forms part of the Duo Market authentication system, with some minor additions.

In this implementation, the secret that the server provides on successful login is an encrypted 16 bytes of entropy, which is the counterpart to a bip39 mnemonic; this could be the key to a bitcoin wallet, although in the Duo Market case it is the key to your OpenBazaar identity, and unlocks your user database. This system is quite general; any data could be encrypted and stored as a secret, simply change the expected size validation on the server. Furthermore, you can adapt login to be the gateway to anything, instead of returning an encrypted secret it could give an authentication token, for example. This implementation uses couchDB for all of its storage, but this is easily replaced.

The whole system is designed such that an attacker with full database read access is essentially no better off; with read access, the attack strategy would be to try to brute force email:password combinations against all user identifiers, deriving public keys from them and checking against ones stored in the server. Even if an attacker knows a given email has an account with the server, they would not be able to know which identifier it is in the database.

One of the exciting elements of userless is that it still allows for two-factor authentication via email. The email is still not stored on the server, however, but instead should be provided on login. The way the crypto system is set up, the server can verify that the given email is a member of the requested account when it is provided the email and the hash of the email:password combination. Once this is verified, an email is sent. When the link in the email is clicked, the original login endpoint will return as usual. If you attempt to login without 2FA, the server will return a boolean, originally signed by the user's password-derived key, which proves that 2FA is enabled, at which point the client code automatically retries providing the email. This is to prevent a man in the middle pretending 2FA is enabled to force users to provide their emails.

This was designed and built by Jack Kleeman and Justin Drake of Duo Market, as part of a wider attempt at a totally zero knowledge product that lets you purchase on OpenBazaar from your browser.

userless's People

Contributors

jackkleeman 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.