Skip to main content
. 2023 Mar 2;23(5):2757. doi: 10.3390/s23052757
Algorithm 2: Algorithm for Sign-In/Login Process
Input: Ethereum Address and Password
Initialization:
  • a)

    Initialize Metamask wallet account with faucet Ether

  • b)

    Connect to Ropsten Test Network

  1. Function login(user_password)

  2. account = web3.currentProvider.selectedAddress

  3. user_exist = check(account).call()

  4. if(user_exist) then

  5. result = loginAuth(user_password)

  6. if (result == true) then

  7. //user is authenticated

  8. //redirecting to Rest API server calls for ZKP verification

  9. evaluate c’ = character_count(user_password)

  10. and send c’ to server for ZKP verification

  11. if (c == c’) then

  12. print(“User is verified successfully”)

  13. else

  14. print (“User is not verified”)

  15. else

  16. print (“Password do not match”)

  17. else

  18. print(“User not registered”)

  19. Function submitfunction(userpassword):

  20. if (userpassword) then

  21. login(userpassword)

  22. else

print (“Enter Password”)