Giter VIP home page Giter VIP logo

securelogin's Introduction

Do not use! SecureLogin for existing web is not maintained and soon will be part of a whole new approach based on a blockchain.

Reasons:

  1. Lack of incentive from website admins to implement this protocol and put initial friction on shoulders of the users

  2. The web and Chrome app versions compromise on security too much, and the desktop version is way too heavy. New version is getting rid from electron and uses pure node.js

  3. New protocols are not being adapted if you don't give 10x improvement. SecureLogin by itself wasn't 10x.

Now SecureLogin is merely 'login' a method exposed in Fairlayer blockchain. A website can request it, and after the user confirms the JS gets back a token consisting of pubkey and signature of current origin. Difference from original SecureLogin:

  • No more provider & client. Client different from provider is only useful for OAuth like interactions, which would be a long way after making this popular for traditional login

  • No more secret & hmac given separately - pubkey does the signing job.

  • No more timestamp - if you managed to obtain the signature once, you could do it again.

  • No more scope - scope could be useful in financial apps only, and fairlayer itself has payments inside.

So it's not dead, but re-incorporated as simple API into something that has much more potential, has monetization model and fixes much more important problem than merely authentication on the web.


SecureLogin Protocol

Join the chat at https://gitter.im/secureloginpw/Lobby

Abstract

Before you dig into details, try the demos: Rails demo, Node.js demo

SecureLogin is a decentralized authentication protocol for websites and apps. Classic passwords/2FA are poorly designed, hard to backup and inconvenient to use. SecureLogin is an all-in-one solution that creates a cryptographic private key from your email and master password to sign in everywhere and helps you to forget about passwords.

Blog post on 1.0 release and our Principles.

Here are major problems it solves:

  1. Password reuse: SecureLogin's #1 goal is to fix password reuse and simplify authentication process. It should work for everyone, not only for geeks.

  2. Convenience: existing onboarding process is a disaster for conversion: Email, confirm email, password, confirm password, wait you need one digit and one capital letter, think of a new password, sign up and go to email box to click "Confirm My Email" a 1000th time in your life. With SecureLogin, it's just two clicks.

  3. Centralization: Currently every account depends on an email, which can be used to set a new password. Email is very centralized - majority uses services like Gmail. This is even worse for SMS, which is owned by telecom corporations. This attack is currently exploited in the wild only against political activists, but there's no need to wait for someone to hack a major email/SMS provider – with SecureLogin there's no central authority, no central server and no way to hijack your account.

  4. Man-in-the-Middle: interaction of the user computer and the server is often compromised in between: broken HTTPS, CloudFlare, malicious browser extensions, Man-in-the-Browser and XSS can be prevented when the user explicitly signs every critical transaction.

  5. Malware: SecureLogin 2.0 with Doublesign stops malware trying to act on behalf of your account – usually to steal your money. Doublesign is like a "two man rule" - the server must verify two signatures of "scope" which includes every detail of the transaction e.g. SWIFT, amount, currency, account number or Bitcoin address. The entire transaction is signed on both devices (usually desktop + mobile) so compromise of one of them wouldn't be enough to empty your bank account (unlike how it is now).

  6. Phishing: Many security experts tend to say phishing is the problem of the users not looking at the URL they type their password on. It's totally wrong. We belive phishing is an extremely important problem and we built-in the protocol in a way to make phishing impossible: every message is either sent to a Web/Extension via postMessage, revealing real event.origin or to a native app via ws://127.0.0.1:3101 revealing Origin header.

SecureLogin vs X

SecureLogin is not a OAuth or Single Sign On like Mozilla Persona or Facebook Connect, not a password manager, not a new 2FA option. It's all three in one protocol.

Let's list all popular auth methods and some esoteric ones to see how they deal with these problems for normal users.

Please note, password managers are not in the table because there's no such thing as a "password manager auth method" - a manager is merely not enforceable. However there is tiny 1% of password managers users.

Scheme Decentralization Usability Anti-Malware Anti-Phishing Cost / Scalability
Standard Email provider can set new pw Poor No No Free
Standard + TOTP Decentralized Poor UX and backups Delayed, not prevented No Free
Standard + U2F/Yubikey Decentralized Worst UX, no usable backup Delayed, not prevented No phishing $18+ per dongle
Standard + SMS / Authy / Duo "2nd factor" is a CA. Vendor lock-in Overhead UX Delayed, not prevented Not fixed $3+/mo/user Duo, $0.1/Authy request, $0.05/SMS
Magic Links on Email / Mozilla Persona Email provider is CA Greatly improved UX: (see Slack or Medium) No No phishing Free
OAuth / OpenID / SAML / SSO Identity provider controls your account. Vendor lock-in Best UX: 2 clicks No No phishing Free
SecureLogin Decentralized Best UX: 2 clicks 2.0 has scope-specific signatures No phishing Free and Open Source

How it works?

See Protocol Specification (being finalized now)

Check out real verification Ruby code for our Playground. Please get in touch for any help with implementation.

Add SecureLogin in 5 minutes

Implementations

Ruby (Reference implementation)

gem install securelogin

Libraries

Node.js
Go

Help needed for implementations for top 20 of hot frameworks

FAQ

1. Password managers already exist, what's the point?

First, market penetration rate of password managers is a joke - less than 1%. You may use it, some of your friends may use it, but the rest of the world does not and will not. They are not enforceable on your users.

Second, they are very inconvenient, especially on mobile. They try to look like a human, looking for inputs and prefilling them. SecureLogin makes websites to implement well defined authentication protocol instead.

Most popular managers are not even open source and cost money. Using closed-source software is a giant no-no for this kind of product.

But more importantly, they do not solve the problem that all our accounts belong to centralized email services via "Reset my password" functionality.

2. Master password is single point of failure in this system

Yes, like in all password managers, there's no way to recover your private key without a password or recovery key.

There's a common misunderstanding that email is any different: try to reset your Gmail password now (backup email doesn't count as it's just turtles all the way down).

In the end of any authentication scheme there will be a password that you just cannot forget. In SecureLogin we removed unnecessary levels of "backups" and "recovery codes", our scheme boils down to one master password, not to master password and backup file/paper/SIM card/email account etc.

3. The web version is easier to use. Why install native apps?

Although the web version exists, no one should use it for anything serious. Users should install native clients which don't depend on the securelogin.pw web server and generate private key much faster than JavaScript.

4. Is it open source? Will it be free in the future?

The protocol and the client are completely open source. They are free now and they will remain free in the future. There is no monetization plan except the one where Sakurity gets more clients for saving the Internet from a two-decades long problem.

It is not even technically possible to start charging money for anything: the protocol works client side, no external servers, no API. It's not a promise, it's a fact.

5. Is it only for websites? What if we have a mobile app?

It supports desktop and native apps as well. But due to the fact that custom protocols are not registered in a public repository like domains, provider/client parameters are limited to web origin format. You're free to pass sltoken back to your app:// from your web-based client URL.

6. Can it be trusted? What if there's a backdoor?

Currently it's ~600 LOC in JS and 200 LOC in HTML. Most programmers can audit it in an hour. There are instructions to build it for all platforms, and we're doing our best to implement reproducable builds as soon as possible.

7. How do I change master password?

Just click inside the app and change it. See wiki https://github.com/sakurity/securelogin/wiki/How-password-is-changed

Compatibility & known issues

The core functionality of SecureLogin is based on opening the native app, getting a signed sltoken and returning user focus back to the same page. It's not easy at all.

macOS

Chrome, Firefox: great. In Full Screen mode it's possible to focus back using alert() in Chrome (in Firefox alert does not focus)

Safari: OK. No way to avoid 'Do you want to allow this page to open “SecureLogin.app”?' dialog every time. 3 clicks required. Requires extra HTTP server for proxy page.

TorBrowser: SecurityError: The operation is insecure when trying to open securelogin://

Windows 10

Edge: does not support custom protocol handlers like securelogin://. At all. They don't provide any roadmap. Use the Web version.

Chrome, Firefox: great.

Linux

iOS

All-in-all iOS and Safari are quite hostile to the flow SecureLogin uses on all other platforms.

It takes 5 clicks to get through regular login experience, while just 2 for all other platforms:

  1. SecureLogin button. opens a window that has another button to open SL client

  2. clicking second button opens third window (yes, it's required) where Safari finally asks to open the App

  3. Confirm opening, now HTTP & WS servers are running. 2nd tab is redirected to :3102/proxy.html and sends a message to WS with auth request

  4. Confirm request inside the app

  5. Press tiny "Back to Safari" sign in top left corner of the screen.

Only 1 and 4 are required on other platforms. Due to bad UX and Safari not following the spec we drop iOS app for now. Users should use the web app (security of a native app on iOS is actually imaginary - the platform is way too closed down). We will iterate back to it and try to fix it with Action Extension for Safari (the way 1Password works right now).

Android

Chrome: great.

Chrome Extension

If you want to, side-load the CE directly from this repository. Preserve "key" inside manifest.json - it keeps chrome-extension URL static.

zip -r www.zip www -x *.git*

Don't forget to ignore .git when packing for Chrome Store.

Cordova

Cordova is used for iOS and Android platforms. It's not exactly a smooth platform, and there will be native clients in the future, but it does the job.

cordova create sl SecureLogin
cd sl

cordova platform add android
cordova platform add ios

cordova plugin add https://github.com/Crypho/cordova-plugin-scrypt.git
cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=securelogin
cordova plugin add cordova-plugin-splashscreen
cordova plugin add cordova-plugin-whitelist
cordova plugin add cordova-plugin-device

Plugins are ready, so last step is replacing www with our codebase:

rm -rf www
git clone [email protected]:sakurity/securelogin.git www

Now you can use cordova run ios / cordova run android

Electron

Electron is employed for macOS, Windows and Linux apps.

Use this repository. Here are some useful commands for building packages for distribution.

Outside of Mac App Store

electron-packager . "SecureLogin" --osx-sign --overwrite --arch=x64 --icon=www/electron.icns
electron-installer-dmg SecureLogin-darwin-x64/SecureLogin.app SecureLogin

For Mac App Store

electron-packager . "SecureLogin" --platform=mas --osx-sign --overwrite --arch=x64 --icon=www/electron.icns

electron-osx-flat SecureLogin-mas-x64/SecureLogin.app

For Windows

electron-packager . "SecureLogin" --overwrite --arch=x64 --platform=win32

Roadmap

See Issues and Projects.

securelogin's People

Contributors

andrewda avatar frankgeerlings avatar gitter-badger avatar homakov avatar kaspergrubbe avatar vladimiroff 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  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

securelogin's Issues

Crash reports to investigate

Nexus 6P:

visit cobased.com
click on secure login
click on cancel
redirected to securelogin.pw
click get it on google play
click on install
setup un/pass
click on change application square
System UI has stopped

go to settings
apps and programs
Settings app has stopped

only way to uninstall it is via the play store

Nexus 6P (not rooted)
Android 7.1.2
Kernel 3.10.73

My email is not my identity

For a number of reasons (primarily spam related), my email address is different for every single service that I use. Many people use plus-addressing for this purpose - I happen to own a domain and just use identifiers before the @. This protocol assumes that I want to share a single email with every service that uses it. Facebook login and other systems will give me an option to not provide an email. When that option is not there, I choose not to login with FB / Google.

enable using smartcard based cryptographic keys

The SecureLogin vs X table says that with securelogin the cryptographic key never leaves the device. This is fine as long as the device can't be easily compromised.

Storing the key on a macbook pro or in a phone means it can be lifted and used to impersonate a user.

Hardware tokens such as the yubikey or smartcards in general may cost money (once) but the key can't be extracted (without expending considerable resources at least).

It would be nice to have the option of being able to use a hardware token provided key for the securelogin.

Is Linux supported?

Yo! The blog post mentions Linux support. The README's section on Linux is blank. Maybe I'm missing something. Is Linux actually supported (yet)?

Email verification

Correct me if I'm wrong, but there doesn't appear to be any verification of the email provided to the server.

The demo code seems to imply that we can trust the email address provided by the client:

If the user with given pubkey does not exist, simply create a new account with given email.

But the user can enter anything they want into the email field of the app. I signed up for the demo app with [email protected] for example. It seems confusing to imply that the users's account can be associated with the email they provide without some kind of independent verification, and if you're verifying emails then why did we bother with all the public-key stuff?

I would think it would be better to say that each users's account is tied to a fingerprint of their public key, since that's the only thing you can guarantee ownership of with this system.

It might be worth having fields like "email","requested_displayname", or "sms_number" that the server can use to pre-fill their account with contact information and such, but it should be made clear that the provided values are advisory only and must be verified before being used. Especially because I think it's against the law in a lot of places to send emails or sms messages without the receiver's consent.

Need clear explanation

I'm fascinated by your claim that this is a simple, decentralized, software-only solution to the Authentication Problem that somehow you have solved where lots of other smart and highly-trained people have failed. You must forgive me if I'm a bit skeptical. I've seen your readme here, and your blog post, and you have given us a lot of bold claims, and some code, and a flow diagram. I don't feel like trying to read the code to decide if this is something real or not. The flow diagram is a good, but unclear and insufficient. What you need is a detailed explanation, in clear English, of what is going on in that flow diagram. Something that I, or even better, a crypto/security specialist, can read to determine if your solution is worth spending time on, or if it perhaps has a fatal flaw. I look forward to reading your protocol description.

Comparison with SQRL

I like the comparison table in the READMe, and would love to see a comparison to Steve Gibson's SQRL protocol in there. I'm an avid listener of his Security now podcast, and his protocol was the first decentralized passwordless protocol I heard about. It got me really excited.

[SecureLogin App] Remove the "Legacy Password Generator"?

The "Legacy Password Generator" just makes SecureLogin even more difficult to understand. Is it really useful?

My understanding is that user email serves no purpose in your system. Why not removing it?
Asking for user email has the following drawbacks:

  • More complex UI
  • End users will think you'll use their email for some dark purpose
  • Cryptographic expert will say that using a piece of public data to generate a secret is a weak spot

I know you use the email as a profile name. See below.

Understanding what "profile" is about is difficult. It is just a character string to identify the active password, isn't it? I suggest you:

  • Forget about the term "profile"
  • Replace it by the notion of "active password" and "password label"

A Few Security Concerns

Deterministic keypair derivation: I get that the idea is to avoid having another file that you must keep secure, but it is well proven that passwords suck. You could have the same smooth integration with a truly random per-device private key. Can even reuse code from PGP and/or SSH keys.

Writing down password: https://securelogin.pw/ says "Make sure you write down your master password" - y'know, that thing that you are NEVER supposed to do. Why would you advocate this?

Plaintext private key: In issue #16, it was stated "Users are encouraged to use full disk encryption and a passcode on their devices. Apps are not responsible for this." - encouraging is not enough. We've been through this with FileZilla, who had to give in after 9 years: https://trac.filezilla-project.org/ticket/2935 - Encrypting the private key does help, as it prevents random malware from making use of the file while the filesystem is unlocked.

Add flow diagram

I'm really missing the flow diagram. Sharing a showing code examples is nice. So are animated gifs. But this repository is missing one key ingredient - how it works. This information should be right at the main page.

Here is example of a such diagram:
oauth2 flow diagram

Auth on device other than current device?

I saw a mention of 2.0 working with desktop+mobile.

Will it be possible to designate a central device for 2FA? I imagine that all "slave" clients will somehow contact the "master" client so that you can authenticate there, or at least set up some sort of P2P replicated password vault?

Zero Knowledge Proofs

Hi Egor,
Been seeing a few issues posted here that parallel one concern I was putting into my general analysis, so I thought it better to post it here for clarification rather than leave it until later.

It appears from reading through the code (there really should be a written spec) that the SecureLogin authentication scheme uses an Ed25519 asymmetric key pair to perform a Zero Knowledge authentication by deed of signing a random challenge. It does this by having a user generate a single authentication key pair for all sites via a deterministic hash function that takes as input a provided email address and passphrase. This hash is then used as the feed to generate signing keys for a given challenge.

Issue 1
Having only deterministic inputs to generate signing keys degrades them for their use in Zero Knowledge Proof (ZKP). This is because the root of ZKP is that given perfect knowledge of everything that passes it should be infeasible for an attacker to generate their own proof to any given random challenge.

But, in SecureLogin the 'email' parameter & public key is passed for storage on the server side leaving only the passphrase as an unknown. This reduces the entropy of generated keys to that of the passphrase and thus leaks knowledge of that in the reverse direction making the protocol no longer a ZKP. The task then of finding the private key from captured/exfiltrated data is one of guessing passwords and running the known key generation algorithm to produce public keys for comparison.

This then makes SecureLogin potentially as weak as any traditional stored password hash systems that uses an equivalently strong salted password key derivation function.

Solution
It is my belief that signing keys must be generated from an entropy source of equivalent or better strength to the keys being generated. That unfortunately precludes direct password to key generation but does allow randomly generated keys to be encrypted and stored local to the client under a reproducible static key or secured in dedicated hardware where only the results of an inputted signing operation can be accessed.

Other issues will be posted separately

An option to not store private key in plain text on user device

Currently a private key is derived from the master password and then stored on the device in base64. From this point on, the master password is never needed. The saved profile is all that's needed to authenticate. At least on Windows, that can be a concern. Malware could read AppData and steal the key.

Could you provide an option to encrypt the private key and require the master password?
Or even not store the key at all. Realistic use case: one-off authentication on a friend's device.

Edit: as it stands, this is essentially like a global cookie: it's saved on the device, and if you steal it, you don't have the user's password but can still act on his behalf.

s / s.js have problems loading

In the developer tools I always see problems with /s or /s.js . In Chrome the problem is (failed) "ERR_FAILED", and on Firefox it's just stuck, never loading.

When I open /s separately, it works. But on the demo pages the above behaviour is observed.

Add tests

Hey @homakov,

We talked a bit through twitter yesterday and thought I might as well elaborate a bit more on some of my issues with the project. I'll post each of them separately so they can be fixed and tracked.

Separation of Concerns

Spec and Implementation

My most pressing point is the confusion between specification and implementation. You wrote a medium post about a protocol; but delivered a repo with an implementation. Adding to that confusion is the complete lack of structure within the example implementation.

If SecureLogin is a protocol; I would advice treating it as such and create a clear separation between specification and implementation. Spec should get a repo, and each implementation should get a repo. Changes and discussions to the protocol are relevant for everyone. But someone figuring out why Cordova 6.4 didn't compile doesn't interest someone who runs everything in GO.

Related to: #24, #34

Repo and Code

This brings me to my second point; presentation of implementation. In general it benefits everyone if code is consistently structured and follows common programming patterns. In case of a public repo it gets even more important to follow a consistent format.

First, please read up on the best practices for Cordova and Electron. How do you structure the base of your project? What are the distribution channels and how to correctly track dependencies? After that I'd suggest implementing something like Angular, React, Ember or Vue.js for your Cordova app. When you pick a framework, make sure you either follow best practices or document your own practices. This way people can navigate through your project without being familiar with it.

Put SL into modules

Like I said in spec; implementation must be strict but is irrelevant. It follows the same logic no matter what language you use. Because of this I would advice providing modules for popular languages which expose the SL api in the language of choice. If you maintain these modules you limit the effort required for implementing SL and also keep some control over the rollout of feature changes / bug fixes.

Of course each module should get its own repo with bug tracking, documentation and examples

Testing

Please write tests.. You're working on a serious project that requires 100% stability before anything is pushed to master. Imagine users losing the ability to login into existing websites, and at the same time registering new profiles with a wrongly determined password. You'll end up with a scenario where you can't roll back.


Have a nice day

Backwards compatible protocol / scheme

Hey,

One problem of deterministic schemes is that it can't store variable data. This especially becomes an issue when you need do deprecate or refactor the scheme used for password generation. A change means losing access to existing logins.

I would suggest versioning the hashing schemes, and creating a way of communicating the scheme version between the requesting and signing party. SL will always incrementally add hashing schemes while maintaining support for older ones. When a requesting party requests a deprecated hashing scheme; the password is hashed according to this scheme; but a update of the password is also sent to the requesting party along with the new version number.

This way requesting and signing parties maintain backwards compatibility and granular upgrading.

A point of concern with this would be requesting known weak schemes to attempt cracking the result. This could be solved through TTL (expiration dates) of older schemes in favour of the latest schemes. If an older scheme is requested past the TTL time frame, SL can either refuse hashing or display a warning to the user that the website is using an outdated scheme.

Password strenght

As discussed in #24, it seems you can claim additional security over traditional passwords only if the unique password is very strong. If the unique password is weak, my understanding is that your solution is weaker than traditional passwords (or maybe I'm wrong ?).

A solution: add strong conditions to the unique password. That would hit usability and adoption.

An other solution: add reasonable conditions to the unique password and ask user for one or several pieces of personal data ? (pet's name, etc.)

Chrome plugin icon not displaying anything

I tried to click on the SL icon in the Chrome toolbar, and it appears to be trying to do something (showing blank popups for parts of the second and then closing them), but in the end nothing happens.

Help with Node

I could start offer some help with the NodeJS implementation in about a week from now. Is there any known implementation already or has anyone started to work on it?

Simplify first encounter

  1. Move enrollment from securelogin.pw to modal iframe, i.e. no 3rd party windows

  2. replace confirm() with HTML modal window

Stop using browser modals

Currently, at the double check milestones (2, 4, 8, 16) the user is prompted to enter their password into a plain text JavaScript prompt. We need to find a better way to do this because we don't want the user entering their password in a plain, non obfuscated text field.

UX/UI: Empty message modal on reload

cobased.com:

Under MacOS/Safari, with an installed SecureLogin app, and logged in. Whenever I click on "Change securelogin" and press cancel - and/or allow and later on close the securelogin app -, doing a reload pops up an empty message modal with a close button in the browser.

OSX client errors

MacOS client gives the message:

"You don't have SecureLogin profiles. "

Then nothing happens :O. What I'm doing wrong?

I just dl'ed the client, installed it, then tried the demo page, but gives the same message every time. The web based client works.

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.