Skip to content

Based on Zero knowledge architecture, client can perform all auth operations without sending password to the server

Notifications You must be signed in to change notification settings

neeraj-22/zero-knowledge-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zero Knowledge Proof for Authentication

MERN app which uses zero knowledge architecture for authentication.

Prover (client) doesn't need to share the information he has (password in this case) to Verifier (server in this case) to verify his identity

Project Based on paper : A survey of zero knowledge proof for authentication

Homepage

Registering User - A key is generated dynamically by using email and password and is encrypted using SHA-256 algorithm

Signup

Signin Route - SHA-256 algorithm creates same hash for two equal given strings

Signin Success

Hence, in case of even a change in capitalisation of a letter would generate a all new hash and thus will throw an error

Signin Fail


Development

Prerequisite

  1. Make sure you have Node.js version >= 13.

Install

Clone the repository into your system and open the directory and run this command to install all dependencies

npm install

PORT Config (backend)

To customise port of webapp, create .env

  1. Create YOUR_PORT
  2. Assign the port value of your choice in YOUR_PORT
  3. Access .env parameters in app.js using dotenv.config()
  4. Access Port value usign process.env.YOUR_PORT and provide it to app.listen()

PORT Config (frontend)

To customise port of react-app, open package.json

  1. Find Start under Scripts object
  2. Assign the port value of your choice in set PORT //default port value is 3000
"scripts": {
    "start": "set PORT=8000 && react-scripts start"
  }
  1. If you want to proceed with default port then skip above steps and do
"scripts": {
    "start": "react-scripts start"
  }

CORS

To access resources available in backend running on different port (while developing in localhost) proceed with either of following 2 steps:

  1. Make sure to run command npm i cors before using in app.js file
app.use(cors())
  1. Go to package.json of your frontend folder and add the following script :
"proxy" : "http://your.ip.address:YOUR_PORT"

Start

Open Project Folder and Frontend directory in command prompt and run following command in both directories

npm start

About

Based on Zero knowledge architecture, client can perform all auth operations without sending password to the server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published