Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

WEB AUTHENTICATION APP USING BLOCKCHAIN

Nanyangwe Leah Rachael 202208075


Table of Contents
1.0 Introduction ............................................................................................................................. 1
1.1 Problem Statement ................................................................................................................ 1
1.2 Software Requirements ........................................................................................................ 1
2.0 The Proposed Algorithm in the Paper .............................................................................. 2
2.1 Sign-up Algorithm .................................................................................................................. 2
2.2 Sign-In Flowchart ................................................................................................................... 3
3.0 The Presentation of the Replicated Results ................................................................... 4
3.1 Installation of the Required Software ............................................................................... 4
3.2 Installation of the Ganache and MetaMask ..................................................................... 5
3.3 Building the Application ....................................................................................................... 7
3.4 Running the Application....................................................................................................... 8
3.5 Output (Results) ..................................................................................................................... 9
4.0 How This Work Can Be Improved .................................................................................... 11
References ......................................................................................................................................... 12

ii
1.0 Introduction

Blockchain increases the security of users by verifying and connecting users to resources on
systems such as transactions, cryptocurrencies, or medicals. Blockchain enables users to
operate on a decentralised system. Blockchain enables networks to transact even when they
do not trust each other. This enables faster reconciliation between transacting parties. An
entire blockchain web system provides its own data integrity. The log-in details used to verify
a user’s identity is stored on the block’s hash, this helps in achieving a self-sovereign identity
(Christidis and Devetsikiotis 2016).

The objective of this paper was to create a web authentication system using blockchain. the
web system enhances the privacy and security of the web system.

1.1 Problem Statement

To avoid data being modified by anyone who has access to database, there is need to restrict
access to critical data such as passwords. On most websites, authentication details are mostly
stored on databases created using programming tools such as MSQL, MongoDB. Storing
critical data onto such database can lead to:

• Data getting corrupted.


• Data being hacked by unauthorised users.
• Data being modified by anyone who has control access to the database.

1.2 Software Requirements


Software requirements for the development of the web authentication system are:

• Ganache: is a development tool in the Truffle Suite. It is used for setting up a personal
Ethereum Blockchain to deploy contracts, develop applications, and run tests.
• MetaMask: is a software cryptocurrency wallet used to interact with the Ethereum
blockchain.
• Web3 JS: For the application to be able to communicate to the blockchain.
• Solidity: For compilation smart contract.
• React JS: For the application’s front-end development.

1
• Truffle: For a development environment, asset pipeline, and testing framework for
developing smart contracts.

2.0 The Proposed Algorithm in the Paper


Blockchain stores information in form of a ledger by using the hashing technology. Storing
information on a ledger secures information against unauthorised hackers. The ledger is
updated by adding new block of data to maintain the integrity of data.

2.1 Sign-up Algorithm


The user needs to sign-up by entering their email address, username, and password. Below
is the flowchart to create a new user in the blockchain database. Figure 1 shows the sign-up
flowchart.

Figure 1: sign -up flowchart

2
2.2 Sign-In Flowchart
The user needs to enter the correct email address and password. Once the user enters the
correct username and password access is granted. If not registered the user is alerted to sign-
up. Figure 2 shows the sign-in flowchart.

Figure 2: sign-in flowchart

3
3.0 The Presentation of the Replicated Results

3.1 Installation of the Required Software


This section will discuss the steps that were taken to install, build and run the web system.

Step 1: The command prompt was used to install truffle, using the command below as shown
in figure 3.

npm install -g truffle

Figure 3: Installation of truffle.

Step 2: The following command was entered to update truffle, as shown in figure 4.

npm install -g npm@9.6.7 to update

Figure 4: Updating truffle

Step 3: The application package was created with the command below, as shown in figure 5.

npx create-react-app auth-app

Figure 5: Creating the application package

4
Figure 6 shows a successfully installed web app.

Figure 6: successful installation of the web app

Step 4: To install all the remaining required modules, the command below was used. This
was done by navigating to the auth-app to run the command as shown in figure 7 below.

npm install react-router-dom web3

Figure 7: Installation of the required modules

3.2 Installation of the Ganache and MetaMask


Step 1: Install ganache

• Download ganache and follow the step to install it.


• Open ganache and click on QuickStart.
• The network id should be 1337 and RCP server as HTTP://127.0.0.1:7545.

5
Figure 8: Installed Ganache development environment

Step 2: Install MetaMask extension


• After MetaMask extension is successfully installed on a google chrome browser, the
user has to go to the settings, add network and then give the details as shown in figure
9 below.
• After adding a Ganache network, the settings are saved by clicking on the save button.

Figure 9: Adding a Ganache network

6
3.3 Building the Application
Step 8: After successfully connecting to the Ganache Ethereum blockchain environment:

• The command below is used to build truffle folders: “migrations”, and “contracts” as
shown in figure 10 below.
truffle init

Figure 10: building truffle folders

• To create a contract address, the command below was used as shown in figure 11.
truffle migrate

Figure 11: creating the contract address

7
3.4 Running the Application
• To run the web system, the command below was used, as shown in figure 12.

npm run start

Figure 12: Running the application

• A webpage will open, together with MetaMask, clicking on the Not Connected,
connects to the ganache Ethereum blockchain environment to enable storing of sign-in
and sign-up details.

Figure 13: connects MetaMask to the ganache Ethereum blockchain environment

8
3.5 Output (Results)

• When the application runs successfully, the sign-in webpage opens as shown in figure
14 below.

Figure 14: sign-in page

• To sign-up a user needs to click on the Create New Account link.


• Once the Create New Account link is opened, the sign-up webpage shown in figure
opens.

Figure 15: sign-up page

9
• When the MetaMask opens, the user needs to click on confirm button, and an account
is created, as shown in figure 16 below.

Figure 16: Creating user on localhost:3000

• A message will be displayed as shown in figure 17 below, to indicate that the account
(transaction) was successfully registered. This update the blockchain database with new
sign-up details.

Figure 17: Confirmed transaction message

10
• Once the account is stored on the blockchain database, a user can sign-in as shown in
figure 18 below. The Ganache blockchain environment, continue to provide privacy
and security to users who sign-up. The sign-up details is privately (encrypted) stored
on the database in various decentralised blocks to provide security to user’s data.

Figure 18: signing into the web system

• When the user sign-in successfully, the message is displayed showing the account
address from Ganache and the user’s email address as shown in figure below.

Figure 19: Signed in successfully

4.0 How This Work Can Be Improved


Blockchain technology requires high computational power when validating transactions sent
by users, this slows down the network and affect its performance. An algorithm that
automatically create virtual memory that temporary stores frequently accessed transactions
within a specified time, can help increase the speed of the operations.

11
References

Alangot, Bithin, Pawel Szalachowski, Tien Tuan Anh Dinh, Souhail Meftah, Jeff Ivanos Gana,
Khin Mi Mi Aung, and Zengpeng Li. 2023. ‘Decentralized Identity Authentication with
Auditability and Privacy’. Algorithms 16(1):4. doi: 10.3390/a16010004.

Anon. 2022a. ‘Build a Authentication Using Blockchain’. GeeksforGeeks. Retrieved 30 May


2023 (https://www.geeksforgeeks.org/build-a-authentication-using-blockchain/).

Anon. 2022b. ‘How to Build a Blockchain Application? — Mobindustry’. Retrieved 27 May


2023 (https://www.mobindustry.net/blog/what-are-blockchain-apps-and-how-to-
develop-one/).

Anon. 2022c. ‘What Is Blockchain Authentication?’ GeeksforGeeks. Retrieved 30 May 2023


(https://www.geeksforgeeks.org/what-is-blockchain-authentication/).

Anon. 2023. ‘Blockchain Tutorial’. GeeksforGeeks. Retrieved 28 May 2023


(https://www.geeksforgeeks.org/blockchain/).

Anon. n.d.-a. ‘Ganache - Blockchain Quick Start Guide [Book]’. Retrieved 30 May 2023
(https://www.oreilly.com/library/view/blockchain-quick-
start/9781789807974/9134ee72-d1a3-42ad-82c3-38d3f2fb8aa8.xhtml).

Anon. n.d.-b. ‘What Is Blockchain Technology? - Blockchaining Explained - AWS’. Amazon


Web Services, Inc. Retrieved 27 May 2023 (https://aws.amazon.com/what-
is/blockchain/).

Baig, Mirza Jabbar Aziz, M. Tariq Iqbal, Mohsin Jamil, and Jahangir Khan. 2021a. ‘Design
and Implementation of an Open-Source IoT and Blockchain-Based Peer-to-Peer Energy
Trading Platform Using ESP32-S2, Node-Red and, MQTT Protocol’. Energy Reports
7:5733–46. doi: 10.1016/j.egyr.2021.08.190.

Baig, Mirza Jabbar Aziz, M. Tariq Iqbal, Mohsin Jamil, and Jahangir Khan. 2021b. ‘Design
and Implementation of an Open-Source IoT and Blockchain-Based Peer-to-Peer Energy
Trading Platform Using ESP32-S2, Node-Red and, MQTT Protocol’. Energy Reports
7:5733–46. doi: 10.1016/j.egyr.2021.08.190.

Benchoufi, Mehdi, and Philippe Ravaud. 2017. ‘Blockchain Technology for Improving
Clinical Research Quality’. Trials 18(1):335. doi: 10.1186/s13063-017-2035-z.

Carreño, Ricardo, Verónica Aguilar, Daniel Pacheco, Marco Antonio Acevedo, Wen Yu, and
María Elena Acevedo. 2019. ‘An IoT Expert System Shell in Block-Chain Technology
with ELM as Inference Engine’. International Journal of Information Technology &
Decision Making 18(01):87–104. doi: 10.1142/S0219622018500499.

Christidis, Konstantinos, and Michael Devetsikiotis. 2016. ‘Blockchains and Smart Contracts
for the Internet of Things’. IEEE Access 4:2292–2303. doi:
10.1109/ACCESS.2016.2566339.

Frikha, Tarek, Faten Chaabane, Nadhir Aouinti, Omar Cheikhrouhou, Nader Ben Amor, and
Abdelfateh Kerrouche. 2021. ‘Implementation of Blockchain Consensus Algorithm on

12
Embedded Architecture’. Security and Communication Networks 2021:e9918697. doi:
10.1155/2021/9918697.

Hang, Lei, Chun Chen, Linchao Zhang, and Jun Yang. 2022. ‘Blockchain for Applications of
Clinical Trials: Taxonomy, Challenges, and Future Directions’. IET Communications
16(20):2371–93. doi: 10.1049/cmu2.12488.

Kuo, Tsung-Ting, Hyeon-Eui Kim, and Lucila Ohno-Machado. 2017. ‘Blockchain Distributed
Ledger Technologies for Biomedical and Health Care Applications’. Journal of the
American Medical Informatics Association 24(6):1211–20. doi: 10.1093/jamia/ocx068.

Oh, Se-Chang, Min-Soo Kim, Yoon Park, Gyu-Tak Roh, and Chin-Woo Lee. 2017.
‘Implementation of Blockchain-Based Energy Trading System’. Asia Pacific Journal
of Innovation and Entrepreneurship 11(3):322–34. doi: 10.1108/APJIE-12-2017-037.

Pal, Om, Bashir Alam, Vinay Thakur, and Surendra Singh. 2021. ‘Key Management for
Blockchain Technology’. ICT Express 7(1):76–80. doi: 10.1016/j.icte.2019.08.002.

Pieroni, Alessandra, Noemi Scarpato, Luca Di Nunzio, Francesca Fallucchi, and Mario Raso.
2018. ‘Smarter City: Smart Energy Grid Based on Blockchain Technology’.
International Journal on Advanced Science, Engineering and Information Technology
8(1):298–306.

Radanović, Igor, and Robert Likić. 2018. ‘Opportunities for Use of Blockchain Technology in
Medicine’. Applied Health Economics and Health Policy 16(5):583–90. doi:
10.1007/s40258-018-0412-8.

Saeed, Muhammad, Rashid Amin, Muhammad Aftab, and Naeem Ahmed. 2022. ‘Trust
Management Technique Using Blockchain in Smart Building’. Engineering
Proceedings 20(1):24. doi: 10.3390/engproc2022020024.

Yue, Xiao, Huiju Wang, Dawei Jin, Mingqiang Li, and Wei Jiang. 2016. ‘Healthcare Data
Gateways: Found Healthcare Intelligence on Blockchain with Novel Privacy Risk
Control’. Journal of Medical Systems 40(10):218. doi: 10.1007/s10916-016-0574-6.

Zhuang, Yan, Lincoln R. Sheets, Zonyin Shae, Yin-Wu Chen, Jeffrey J. P. Tsai, and Chi-Ren
Shyu. 2020. ‘Applying Blockchain Technology to Enhance Clinical Trial Recruitment’.
AMIA Annual Symposium Proceedings 2019:1276–85.

Zhuang, Yan, Luxia Zhang, Xiyuan Gao, Zon-Yin Shae, Jeffrey J. P. Tsai, Pengfei Li, and Chi-
Ren Shyu. 2022. ‘Re-Engineering a Clinical Trial Management System Using
Blockchain Technology: System Design, Development, and Case Studies’. Journal of
Medical Internet Research 24(6):e36774. doi: 10.2196/36774.

13

You might also like