Professional Documents
Culture Documents
Web App Authentication System Using Blockchain
Web App Authentication System Using Blockchain
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.
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:
• 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
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.
3
3.0 The Presentation of the Replicated Results
Step 1: The command prompt was used to install truffle, using the command below as shown
in figure 3.
Step 2: The following command was entered to update truffle, as shown in figure 4.
Step 3: The application package was created with the command below, as shown in figure 5.
4
Figure 6 shows a successfully installed 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.
5
Figure 8: Installed Ganache development environment
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
• To create a contract address, the command below was used as shown in figure 11.
truffle migrate
7
3.4 Running the Application
• To run the web system, the command below was used, as shown in figure 12.
• 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.
8
3.5 Output (Results)
• When the application runs successfully, the sign-in webpage opens as shown in figure
14 below.
9
• When the MetaMask opens, the user needs to click on confirm button, and an account
is created, as shown in figure 16 below.
• 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.
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.
• 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.
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. 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).
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