Coder Social home page Coder Social logo

mrkazawa / two-chain Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 33.6 MB

This repository is the implementation from our paper "TwoChain: Leveraging Blockchain and Smart Contract for Two Factor Authentication"

License: MIT License

JavaScript 45.59% HTML 50.77% Solidity 3.63%
ethereum 2fa webservice

two-chain's Introduction

TwoChain

This repository is the implementation from our paper "TwoChain: Leveraging Blockchain and Smart Contract for Two Factor Authentication," which is published here.

Installation

You need nodejs for this project. So install them first if you do not have it yet on your machine. You can download it here.

foo@ubuntu:~$ cd ~/
foo@ubuntu:~$ git clone https://github.com/mrkazawa/two-chain.git
foo@ubuntu:~$ cd ~/two-chain

foo@ubuntu:~$ npm install # install all dependencies
foo@ubuntu:~$ npm run-script # to show all available NPM commands

Running

Our implementation consists of three parts: the blockchain, the web-app server, and the client-app.

1. Run the blockchain

For this project, we will use ganache-cli as our local network to simulate the Ethereum network. Open a new terminal and run the following commands.

foo@ubuntu:~$ cd ~/two-chain
foo@ubuntu:~$ npm eth-network

You will see the local network spawned in your machine. You can access this network through 127.0.0.1:8545 address.

2. Run the web-app server

The web-app server will serve as our provider. It is built using express web service and sqlite as its database.

For starters, we need to initiate our database. Open a new terminal and run the following.

foo@ubuntu:~$ cd ~/two-chain
foo@ubuntu:~$ npm run init-db

foo@ubuntu:~$ npm run delete-db # in case you want to delete it

Then, we will run our server. In the same terminal window, run the following.

foo@ubuntu:~$ cd ~/two-chain
foo@ubuntu:~$ npm run 2fa-server

You can then access the server using your browser through http://127.0.0.1:3000/ address. From that site, you can register a user. After login, you can set up the 2FA on the Setting page. You need to submit your Ethereum address. For that, we need to run our client-app.

3. Run the client-app

The client-app is a CLI-based application that can submit an address to the Ethereum blockchain and signs generated one-time-password (OTP) for the 2FA process.

To run our client, do the following.

foo@ubuntu:~$ cd ~/two-chain
foo@ubuntu:~$ npm run 2fa-client

From there, you can choose the menu to begin the client operations.

Authors

  • Yustus Oktian - Initial work

Acknowledgments

  • Hat tip to anyone whose code was used
  • Fellow researchers
  • Korea Government for funding this project

two-chain's People

Contributors

mrkazawa avatar

Stargazers

0xA avatar Yasser_L avatar

Watchers

James Cloos avatar  avatar  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.