NIT Trichy B Tech Thesis Template
NIT Trichy B Tech Thesis Template
NIT Trichy B Tech Thesis Template
B.Tech.
in
DEPARTMENT OF
DEPARTMENT NAME
NATIONAL INSTITUTE OF TECHNOLOGY
TIRUCHIRAPPALLI-620015
MAY 2023
BONAFIDE CERTIFICATE
in partial fulfillment of the requirements for the award of the degree of Bachelor of
Technology in ELECTRONICS AND COMMUNICATION ENGINEERING of
i
ABSTRACT
Biometrics, with its distinctiveness to every character, has been adapted as a security
authentication function by way of many establishments. These biometric information
are processed into templates that are saved on databases, and a central authority central-
izes and controls those databases. This kind of storing biometric data, or in our case fin-
gerprint template, is uneven and susceptible to many essential safety attacks, including
fake template input, template modification or deletion, and channel interception by way
of a malicious attacker. The proposed solution consists of a novel approach for secur-
ing encrypted fingerprint templates through the use of symmetric peer-to-peer networks
and symmetric encryption. Specifically, the fingerprint template is encrypted using the
Advanced Encryption Standard (AES) algorithm, and subsequently uploaded onto a
symmetrically distributed storage system called the InterPlanetary File system (IPFS).
In order to avoid the slow transaction speed associated with decentralized blockchains,
the hash of the encrypted template is stored on the Ethereum network instead of the
template itself. This ensures that only the template’s hash is stored, which helps to re-
duce costs and prevent identity theft. Results from our experiments demonstrate that
the proposed system provides a high level of security for fingerprint templates through
the use of encryption, hashing, and decentralization.
Keywords: Biometrics, Blockchain, IPFS, AES, Decentralization
ii
ACKNOWLEDGEMENT
We would like to thank the following people for their support and guidance without
Dr. P. Sudharsan, our project guide, for helping us and guiding us in the course of this
project .
Our internal reviewers, Dr. E. S. Gopi , Dr. P. Sudharsan, for their insight and advice
We would also like to thank our individual parents and friends for their constant support.
iii
TABLE OF CONTENTS
ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
ACKNOWLEDGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
TABLE OF CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 Blockchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 IPFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Ethereum Virtual Machine (EVM) . . . . . . . . . . . . . . . . . . . . 6
3 Literature Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 Fingernail analysis management system using microscopy sensor and
blockchain technology . . . . . . . . . . . . . . . . . . . . . . . . . . 8
iv
3.3 Decentralized document version control using ethereum blockchain and
IPFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 Cloud Data Provenance using IPFS and Blockchain Technology . . . . 9
4 Proposed Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5 Technology Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1 NodeJs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 Metamask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.3 HardHat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.4 Remix Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5 Solidity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.6 Smart Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.7 Advanced Encryption Standard(AES) . . . . . . . . . . . . . . . . . . 17
5.8.3 Javascript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
v
6.2.5 Authenticate User Data . . . . . . . . . . . . . . . . . . . . . . 25
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
A Code Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
vi
List of Tables
vii
List of Figures
viii
Chapter 1
Introduction
Biometric refers to the measurement and analysis of an individual’s physical and behav-
ioral characteristics for the purpose of identifying and verifying their identity. Biometric
identifiers can include physical attributes such as fingerprints, facial features, iris pat-
terns, and voice recognition, or behavioral traits such as gait, keystroke dynamics, and
signature recognition.
Biometric systems provide a highly accurate means of identifying individuals. Un-
be lost, stolen, or forgotten. Biometric systems can also be integrated into a variety
of devices, such as smartphones and laptops, making it easy for individuals to access
secure systems and services.
uals, owing to the unique and intrinsic nature of biometric traits. In this process, the
biometric traits of an individual, such as fingerprints, facial features, or iris patterns, are
scanned and transformed into digital templates that are then stored in a central database
1
controlled by a central authority.
However, this method of storing biometric data can pose a significant security risk.
One potential threat is the creation of false templates, which occurs when an attacker
creates a new biometric template that is similar enough to the original to fool the sys-
tem. Another risk is the alteration or deletion of existing templates, which can be used
to grant unauthorized access or to disrupt the system’s operations. Furthermore, the
transmission of biometric data from the user’s device to the central database can also be
To address these concerns, we are exploring alternative solutions for storing and
transmitting biometric data. One such approach is to use blockchain technology, which
can provide a secure, decentralized, and tamper-proof method of storing and sharing
biometric data. By utilizing the distributed nature of blockchain, biometric data can
be stored across multiple nodes, reducing the risk of a single point of failure or attack.
Additionally, the use of smart contracts can enforce strict access controls and ensure the
ing:
• Proposal for Decentralized Fingerprint Storage using Ethereum and IPFS Archi-
tecture.
• Make the system more cost-effective and efficient by using algorithms like data
hashing.
2
1.2 Thesis Structure
In order to present a well-organized and structured argument, this thesis is divided into
the following sections:
• chapter 4: Proposed Solution Outlines the research approach and methods used
in the thesis.
• Chapter 6: System Design and Implementation the technical details and steps
taken to build the proposed system or solution outlined in the previous chapters.
• Chapter 7:Results and Interpretation Presents the results of the research and
analyzes them in the context of the existing system.
3
Chapter 2
Background
This section provides an overview of blockchain technology and the reasons for its use.
Key features of blockchain technology that contribute to its security are also discussed.
Along with Blockchain we have discussed IPFS and Ethereum Virtual Machine also
called as EVM.
2.1 Blockchain
A blockchain is a digital ledger technology that enables secure and transparent trans-
actions among various parties in a decentralized manner. Essentially, it is a distributed
database that stores transactions in blocks, which are then linked together in a sequential
order to form a ”blockchain.” This chain of blocks provides a secure and tamper-proof
method of storing data because each block contains a unique cryptographic hash that
links it to the previous block. One of the key features of blockchain is that it is a peer-to-
peer network, meaning that there is no central authority controlling the system. Instead,
all nodes in the network maintain a copy of the ledger and work together to validate
transactions. This makes the system more resilient to attacks, as there is no single point
of failure.
4
Figure 2.1: Structure of a Blockchain
altering all subsequent blocks. Additionally, transactions are verified and approved
by a network of nodes using complex algorithms and consensus mechanisms, further
ensuring the validity of the data. The most well-known implementation of blockchain
2.2 IPFS
IPFS, an acronym for InterPlanetary File System, is a revolutionary protocol and net-
work that facilitates a distributed method for storing and accessing files in a decentral-
5
ized manner. This innovative technology allows for the storage of files on a network of
computers that operate on a peer-to-peer basis, which renders the system more resilient
to failures and censorship than traditional centralized file storage systems. A major
advantage of IPFS is that it allows for faster and more efficient distribution of content
as users can access the nearest copy of a file instead of relying on a single central-
ized server, which can often result in slower download speeds and service disruptions.
Moreover, IPFS uses content-based addressing, which means that files are identified by
their content, rather than their name or location. This enhances the integrity of the data
stored, as any modifications made to the content would result in a distinct address.
IPFS leverages a distributed hash table (DHT) to facilitate content routing within
the network. Whenever a file is added to the IPFS network, its hash is used to iden-
tify the nodes that store the file. As a result, nodes can efficiently locate and retrieve
files from the network based on their unique hash identifiers. IPFS has the capability
to cache frequently accessed files locally, leading to decreased network traffic and im-
proved performance. Additionally, IPFS employs cryptographic techniques to ensure
the security of content on the network. By encrypting files with their corresponding
hash, any alteration to the file would generate a different hash, making it challenging
for malicious actors to manipulate files within the network.
The Ethereum blockchain runs on a software environment called the Ethereum Virtual
Machine (EVM), which is responsible for executing smart contracts and processing
achieved through the use of a consensus algorithm. Smart contracts on the Ethereum
network are written in high-level programming languages like Solidity and then com-
piled into bytecode that can be executed on the EVM. The EVM runs the bytecode in a
sandboxed environment, making sure that the code cannot access or modify the state of
6
the blockchain outside of the contract. One of the crucial features of the EVM is its abil-
ity to maintain a state transition function, which enables it to update the blockchain’s
state based on the execution of smart contracts. The EVM’s state transition function
enables the creation of complex decentralized applications that can automate various
processes and transactions. The Ethereum Virtual machine (EVM) makes it easier to
implement DApp architecture on the network.
7
Chapter 3
Literature Survey
In this paper, the researchers proposed a system for securing fingernail data that relied
on node.js to simulate a management center. The system used a network of data man-
agement nodes responsible for storing and processing fingernail data sent from device
nodes. To minimize the burden on nodes from storing and processing fingernail tem-
plates, the authors implemented an off-chain approach. Specifically, they adopted the
”full chain” technique for storing the pre-processed data in all data centers. The idea of
In this paper the researchers proposed an architecture for a biometric electronic identi-
fication document (e-ID) system that utilizes blockchain technology for citizen identity
verification during various transactions such as notary, registration, tax declaration and
payment, basic health services, and registration of economic activities. The system was
proposed to solve the invasion of malicious attackers on the previous system. The sys-
tem is considered secure as it combines citizen information with their fingerprint data,
which is then uploaded onto the blockchain network to verify the identities of registered
citizens.
8
3.3 Decentralized document version control using ethereum
blockchain and IPFS
The paper introduces a framework and solution for document sharing and version con-
trol, utilizing blockchain technology to enable secure, decentralized multi-user collab-
oration with no involvement of a centralized third party. The proposed solution is based
on the Ethereum smart contract to regulate and govern the document version control
process among creators, developers, and validators, and also utilizes the IPFS (Inter-
Planetary File System) to store documents on a decentralized file system. The solution
automates essential interactions among multiple actors, including developers and ap-
provers, to facilitate efficient collaboration while ensuring security and transparency.
In this paper the authors propose a system to address the issue of data tampering in
cloud data storage by combining the InterPlanetary File System (IPFS) and Ethereum
network. By leveraging blockchain technology, the proposed system removes the need
for users to rely on a centralized cloud storage provider (CSSP) who may have the
power to manipulate or misuse the data for their own benefit. The use of IPFS and
Ethereum creates a decentralized and secure storage system, where data is distributed
across a network of nodes and stored immutably on the blockchain, making it resistant
to tampering or unauthorized access.
9
Chapter 4
Proposed Solution
that some of these systems overlook is encrypting data prior to uploading it onto IPFS.
Moreover, even if the data is encrypted, storing it on the blockchain network can still be
expensive. Hence, our proposed system employs encryption on the fingerprint template
and saves the hash on IPFS, thus reducing costs while still ensuring data security.
10
4.1 Proposed Architecture
We used image processing techniques to convert the fingerprint image to a binary for-
mat, such as black and white pixels, where black represents the fingerprint ridges and
white represents the valleys. Once we have the binary data, we will apply the AES
encryption algorithm to encrypt the data. This can be done using a software library or
a programming language that supports AES encryption. After encryption, we saved the
encrypted data to our IPFS system. The encrypted data will look like random bytes of
data and will not be readable in its encrypted form without the secret key. To decrypt
11
the data, we used the same secret key that was used for encryption and apply the AES
decryption algorithm. The decrypted data will be the same as the original binary data
obtained from the fingerprint image.
In this system, pre-processing and encryption of the fingerprint template is done
“off-chain” in order to reduce the bottleneck of the system. The IPFS works as a dis-
tributed file system, which reduces the gas price involved when deploying smart con-
tracts and executing commands on the Ethereum network. The IPFS, after successfully
storing the encrypted fingerprint template, returns a unique 46-character hash. Sub-
sequently, this hash, with the use of a smart contract, is uploaded unto the Ethereum
network. For authentication, the user data, returned from the Ethereum network, is
12
Chapter 5
Technology Used
5.1 NodeJs
Node.js was originally created by Ryan Dahl in 2009 and has since become a prominent
technology in the world of web development.
One of the key features of Node.js is its event-driven, non-blocking I/O model. This
means that Node.js applications are highly scalable and can handle a large number of
concurrent connections without compromising performance. Instead of waiting for I/O
operations to complete, Node.js uses a callback mechanism to continue executing code
while I/O operations are being processed in the background. This approach allows
Node.js to handle a large number of requests with a relatively small number of threads,
making it ideal for building real-time applications such as chat apps, online gaming
ecosystem of third-party modules that can be easily integrated into Node.js applications
using the Node Package Manager (npm). This has made Node.js a popular choice for
building web applications, command-line tools, and server-side scripts.
Node.js is also cross-platform, which means that it can be run on a wide variety
of operating systems, including Windows, macOS, and Linux. This makes it easy to
13
develop and deploy Node.js applications on a range of environments.
5.2 Metamask
Chrome, Firefox, and other web browsers. It allows users to store, manage, and transfer
Ethereum and other ERC-20 tokens directly within their browser. Metamask is a non-
custodial wallet, which means that users retain control of their private keys and funds,
securely and conveniently access various dApps, such as decentralized exchanges, de-
centralized finance (DeFi) protocols, and blockchain-based games, without having to
leave their web browser. Metamask also provides features such as transaction history,
erated, which can be used to restore access to the wallet in case the device is lost or
stolen. Additionally, Metamask supports hardware wallets, such as Trezor and Ledger,
for even greater security.
5.3 HardHat
Hardhat is an open-source development environment for building and testing smart con-
erful features for smart contract development, including built-in support for contract
debugging, automated testing, and deployment scripts.
One of the key benefits of Hardhat is its ability to provide a local Ethereum network
for testing smart contracts. This allows developers to test their contracts in a safe and
14
controlled environment before deploying them to the main Ethereum network. Hardhat
also provides a range of tools for testing smart contracts, including a built-in testing
framework, which makes it easier to write automated tests for smart contracts.
Hardhat is highly customizable and supports a wide range of plugins, allowing de-
velopers to easily extend its capabilities. It also provides powerful command-line tools
that enable developers to quickly and easily interact with their contracts, compile them,
and deploy them to the Ethereum network. As the hardhat provides free ethereum test
tures, including code highlighting, syntax checking, and autocomplete, to help devel-
opers write clean and error-free Solidity code.
One of the key features of Remix Compiler is its ability to simulate and debug
smart contracts directly within the browser. This allows developers to test their con-
tracts in a safe and controlled environment before deploying them to the Ethereum
network. Remix Compiler also provides a range of testing tools, including a built-in
testing framework and a code coverage tool, to help developers ensure the quality and
reliability of their contracts.
In addition to its development and testing features, Remix Compiler also provides
tools for deploying and interacting with smart contracts on the Ethereum network. It
supports multiple networks, including the main Ethereum network, test networks such
as Rinkeby and Kovan, and local networks running on the developer’s machine.
15
5.5 Solidity
Solidity is a high-level programming language used for writing smart contracts on the
Ethereum blockchain. It was developed by the Ethereum Foundation and is designed
to be easy to learn and use, with syntax similar to that of other popular programming
languages such as JavaScript and C++.
Smart contracts are self-executing programs that run on the Ethereum blockchain
and are used to automate the exchange of assets, such as cryptocurrencies or digital
assets, without the need for intermediaries. Solidity is the most popular language used
for writing smart contracts on the Ethereum blockchain.
Solidity provides a range of features that make it well-suited for writing complex
and secure smart contracts. It includes features such as built-in data types, control
structures, and functions, as well as support for inheritance and polymorphism. Solidity
also provides a range of security features, such as function modifiers and access control,
to help developers prevent vulnerabilities in their smart contracts.
One of the key benefits of Solidity is its ability to interact with other smart con-
tracts and decentralized applications (dApps) on the Ethereum blockchain. This allows
developers to create complex applications that can interact with other applications and
services on the Ethereum network.
Smart contracts are self-executing programs that run on a blockchain network. They
are used to automate the execution of contracts and agreements between parties in a
trustless and decentralized manner.
Smart contracts are written in programming languages such as Solidity (for the
Ethereum network) and allow for the creation of rules and conditions that must be met
before the contract can be executed. These rules and conditions can be enforced auto-
matically, without the need for intermediaries such as lawyers or banks.
Smart contracts can be used in a wide range of applications, from financial transac-
16
tions and supply chain management to voting systems and real estate transactions. They
provide a secure and transparent way of executing contracts and agreements, with all
transactions recorded on the blockchain and visible to all parties.
One of the key benefits of smart contracts is that they are trustless and decentralized,
meaning that they operate without the need for a central authority or intermediary. This
makes them highly resistant to fraud, censorship, and manipulation. Smart contracts
can also reduce transaction costs and increase efficiency by automating the execution
of contracts and agreements. We used smart contracts to upload and retrieve data on
ethereum test network.
is a widely accepted and secure encryption algorithm used in various applications, such
as securing sensitive data and communications, protecting personal information, and
providing secure storage and access control.
symmetric encryption algorithms and is widely used in various applications that require
strong encryption, such as online banking and electronic commerce.
HTML, CSS, and JavaScript are three core technologies used in web development.
17
5.8.1 HTML
HTML (Hypertext Markup Language) is a markup language used to create the structure
and content of web pages. It provides a way to define the layout of a web page and
include content such as text, images, and videos. HTML documents are interpreted by
web browsers and converted into a visual representation that can be displayed to users.
5.8.2 CSS
CSS (Cascading Style Sheets) is a stylesheet language used to define the presentation
and styling of web pages written in HTML. CSS provides a way to control the layout,
typography, colors, and other visual aspects of a web page. It allows developers to
separate the presentation of a web page from its content, making it easier to maintain
and update the design of a website.
5.8.3 Javascript
interfaces. JavaScript code is executed by web browsers and can interact with HTML
and CSS to dynamically modify the content and presentation of a web page.
Together, HTML, CSS, and JavaScript form the foundation of web development,
allowing developers to create and design web pages that are interactive, visually ap-
pealing, and responsive. They are essential tools for creating modern, dynamic, and
interactive websites and web applications.
18
Chapter 6
we constructed a web application comprising both a frontend and a backend. For the
frontend, we utilized technologies such as HTML, CSS, and JavaScript, while for the
backend, we relied on Node.js technology to establish the necessary infrastructure.
The first phase of the biometric system involves user registration, which entails gather-
ing user information such as name, email, and fingerprint. This input is then subjected
to preprocessing procedures, which comprise multiple steps, including data hashing
and encryption, before being uploaded to the IPFS desktop. Upon successful upload,
the system generates a corresponding CID that is subsequently stored on the Ethereum
blockchain.
We created a form using Html to collect user input data like name, email and fingerprint
of the user. The details of the code are given in Appendices section.
19
Figure 6.1: User Input Form
Our proposed system incorporates a unique approach to mitigate the performance bot-
tleneck associated with directly uploading user data onto the blockchain. Specifically,
we employ an ”off-chain” preprocessing method that enhances system efficiency. The
preprocessing procedure comprises the following steps:
Data hashing for a fingerprint image involves generating a unique fixed-size string of
characters, known as a hash value, based on the biometric features and characteristics of
the fingerprint. This hash value serves as a digital fingerprint of the biometric data and
20
can be used for various purposes, such as verifying the identity of the user and detecting
Data Encryption
After obtaining the data hash for the fingerprint image, we apply encryption using the
AES algorithm to ensure data security before uploading it to the IPFS. This process
ensures the immutability feature of the entire system. By encrypting the template, we
render it useless to malicious attackers, since decryption without the appropriate key is
virtually impossible, even through brute-force attacks. This step serves to augment the
The encrypted data is stored on the IPFS, which functions as a decentralized file system.
By leveraging IPFS, we reduce the gas price required to deploy smart contracts and
execute commands on the ethereum test network. After successfully storing the data on
21
6.1.4 Upload the CID on Ethereum Test Network
After obtaining the CID, we proceed to upload it onto the Ethereum test network using
Hardhat, which is an inbuilt JavaScript library. For our simulation, we utilized Georli
as our test network, as it does not entail any real monetary expenses. We created and
deployed smart contracts for data uploading and retrieval using remix IDE. Metamask
Figure 6.3: smart contracts to upload and retrive data from Ethereum Test Net
22
6.2 User Verification
In this section, we will delve into user verification, which entails collecting user input
and comparing it against the encrypted user data that we possess. Since the data we
For User Verification also we need to get inputs from user like user email and user
fingerprint. The image below shows the same.
In order to authenticate user input against the data stored in our system, it is necessary
for both sets of information to be in the same format. However, since our stored data is
encrypted, it must be decrypted prior to comparison. To encrypt the data, we utilized
23
the AES algorithm, which is a symmetric encryption method that utilizes the same key
for both encryption and decryption processes. So to decrypt the data, use the same
secret key that was used for encryption and apply the AES decryption algorithm. The
decrypted data will be the same as the original binary data obtained from the fingerprint
image.
To perform fingerprint matching, the initial step is to identify the fingerprints that need
to be compared. Next, functions are created to extract the characteristics of these im-
ages. These extracted features are then used to generate descriptors for a group of key-
points, enabling the comparison of descriptors between the images. We used SIFT fin-
ger print matching algorithm. Its an inbuilt library in Javascript. SIFT (Scale-Invariant
Feature Transform) is a popular fingerprint matching algorithm that can identify corre-
sponding keypoints between two different fingerprint images, even if they are captured
from different angles or have been subjected to certain transformations such as scal-
ing, rotation, or translation. One interesting aspect of SIFT is that it uses a technique
called the Difference of Gaussian (DoG) to detect and describe the local features in the
fingerprint images.
match fingerprints based on their unique local features, such as ridges, valleys, and
minutiae. The algorithm works by first detecting a set of keypoints in the fingerprint
image. These keypoints are selected based on their distinctive local features and are
then described using a set of orientation and scale-invariant descriptors. The descrip-
tors are generated based on the local gradient directions and magnitudes of the im-
age patches surrounding the keypoints. Once the keypoints have been detected and
24
based on the distance between their descriptors.
fingerprint image, allowing it to match fingerprints that have been rotated with respect
to each other. Overall, SIFT is a powerful fingerprint matching algorithm that can
effectively match fingerprints under a wide range of variations, making it a popular
Upon receiving the user input, we retrieved all the stored data within our system. In our
proposed system, the user’s data is compared with all other available user data to verify
its authenticity. This verification process is used to determine whether the user’s data
is already present within the system, and if not, it is subsequently added. Furthermore,
this verification procedure can be utilized to detect the manipulation or presence of
counterfeit data. If the user is verified successfully, success verdict will be shown on
user’s screen as shown below.
25
Chapter 7
In this section we aim to provide a clear and detailed account of the research results
and to interpret them in light of the research questions, hypotheses, and theoretical
framework. We have categorized the performance analysis in 3 parts i.e., cost analysis,
We considered various images of different sizes and got the cost of uploading them
directly on blockchain. We used Ethereum blockchain test network for this experi-
mentation. The table below represents the gas consumed to upload a file directly on
blockchain.
As indicated in the table presented earlier, the amount of gas used increases with
larger file sizes. This is due to the fact that larger files require more data to be stored
on the blockchain, which in turn necessitates more computational resources and storage
space. This increased demand for resources can result in higher fees to compensate
the network nodes for the additional processing and storage costs. Furthermore, some
26
blockchain networks may prioritize smaller transactions, leading to longer confirmation
amount of gas consumed in our case is constant, regardless of the size of the input. This
makes our system more efficient and scalable.
File Size(B) Gas Consumed(in gas units) Gas consumed using our System(in gas units)
107 223559 5057
938 465001 5103
4610 665595 4080
10111 1064139 5009
12379 1383016 4912
Table 7.2: Cost analysis of Traditional system vs cost analysis of our system
Figure 7.1: Cost analysis of our system against the Traditional system
As the size of the uploaded file increases, the processing time required for the trans-
action to be included in a block on the Ethereum blockchain also increases. This is
27
because larger files consume more gas, which in turn demands more computational re-
sources and processing time. For instance, a transaction involving the upload of a small
file of a few bytes may be processed and added to a block relatively quickly. In contrast,
a transaction involving a larger file of several megabytes could take several minutes or
even hours to be processed and included in a block, depending on the congestion of the
network and the gas price set by the user. The figure below represents time analysis of
our improved system against Traditional system.
Figure 7.2: Time analysis of our system against the Traditional system
have incorporated AES encryption, which makes our system almost impervious to se-
curity breaches. AES-128 encryption offers a key space of 2128 , indicating that there
are 2128 potential keys that can be utilized for data decryption. Assuming that a hacker
gains access to a supercomputer capable of testing 1016 keys per second, it would still
take them around 1017 seconds, equivalent to 3.17 × 109 years, to perform a brute force
attack and test all possible keys.
28
Chapter 8
In this section we have summarized the key findings and contributions of the research
study. We have provided a concise overview of the main results, their implications,
and the significance of the research. We have given future scope for this project which
outlines potential directions for future research in the same area or related fields. The
future scope identifies gaps in the current study and suggest ways to fill those gaps.
8.1 Conclusion
Blockchain technology has revolutionized the field of research and information secu-
rity, and the proposed system represents a viable replacement for traditional fingerprint
databases. The system incorporates the use of IPFS, which is a cost-effective and dis-
tributed file system for securely storing data. Compared to other decentralized biomet-
ric architectures, the proposed method is cost-efficient. By storing only the hash of the
fits such as enhanced security, accessibility, and trust. The system does not require a
dedicated database administrator, which further reduces costs. Overall, our study has
demonstrated the feasibility and advantages of merging IPFS and public blockchain to
secure encrypted fingerprint templates, with a focus on economic and performance con-
siderations. We have presented two case studies that showcase modernized methods and
protocols for fingerprint template storage, highlighting the potential of this approach to
29
improve the security and efficiency of biometric authentication systems.
This proposed system has the potential for future extensions, including the incorpora-
tion of a ”side chain” feature for fingerprint processing into a comprehensive authenti-
cation system. This means that the proposed system could be integrated into a larger
system that incorporates other security features such as encryption and authentication.
Another potential future extension is to develop a robust hashing function for dif-
ferent types of fingerprint processing. This would involve creating a hashing algorithm
that is optimized for processing a wide range of fingerprint data, thus improving the
of a more robust hashing algorithm could enhance the accuracy and efficiency of the
system in processing fingerprint data.
30
Bibliography
[1] Shih Hsiung Lee and Chu Sing Yang. Fingernail analysis management system using
[2] Rafael Páez, Manuel Pérez, Gustavo Ramı́rez, Juan Montes, and Lucas Bouvarel.
An architecture for biometric electronic identification document system based on
[3] N. Nizamuddin, K. Salah, M. Ajmal Azad, J. Arshad, and M.H. Rehman. Decen-
tralized document version control using ethereum blockchain and IPFS. Computers
& Electrical Engineering, 76:183–197, June 2019.
[4] Syed Saud Hasan, Nazatul Haque Sultan, and Ferdous Ahmed Barbhuiya. Cloud
[6] Qi Yao and Huajun Zhang. Improving agricultural product traceability using
31
Appendices
32
Appendix A
Code Attachments
This part of code handles taking user input. When user enters his details in front end part
and clicks on enter button, events are fired in the back end. Those events are handled
by following functions.
1
2 % import e x p r e s s from "express" ;
3 % import m u l t e r from "multer" ;
4 % import F i n g e r p r i n t 2 from "fingerprintjs2" ;
5 % import * a s IPFS from "ipfs-core" ;
6
7 const upload = multer ( ) ;
8 c o n s t app = e x p r e s s ( ) ;
9 c o n s t node = a w a i t IPFS . c r e a t e ( ) ;
10
11 // use body-parser middleware to parse request bodies
12 app . u s e ( e x p r e s s . u r l e n c o d e d ( { e x t e n d e d : t r u e } ) ) ;
13
14 // set the view engine to ejs
15 app . s e t ( "view engine" , "ejs" ) ;
16
17 // render the form template
18 app . g e t ( "/" , ( r e q , r e s ) => {
19 r e s . r e n d e r ( "form" ) ;
20 }) ;
21
27 c o n s t f i n g e r p r i n t T e m p l a t e = F i n g e r p r i n t 2 . x64hash128 ( b y t e S t r i n g ) ;
28
29 c o n s t r e s u l t = a w a i t node . add ( {
30 p a t h : $ { r e q . body . e m a i l } . t x t ,
31 c o n t e n t : JSON . s t r i n g i f y ( {
32 name : r e q . body . name ,
33
33 e m a i l : r e q . body . e m a i l ,
34 hashedTemplate : f ing erp rin tTe mp lat e ,
35
36 }) ,
37 }) ;
38
39 console . log ( r e s u l t . cid . t o S t r i n g ( ) ) ;
40
41 c o n s t chunks = [ ] ;
42 f o r a w a i t ( c o n s t chunk o f node . c a t ( r e s u l t . c i d ) ) {
43 c h u n k s . p u s h ( chunk ) ;
44 }
45
46 c o n s t r e t r i e v e d M e t a d a t a = JSON . p a r s e ( c h u n k s . t o S t r i n g ( ) ) ;
47
48 console . log ( retrievedMetadata ) ;
49 }) ;
50
51 // start the server
52 c o n s t PORT = p r o c e s s . env . PORT | | 3 0 0 0 ;
53 app . l i s t e n ( PORT , ( ) => {
54 c o n s o l e . l o g ( S e r v e r l i s t e n i n g on p o r t $ {PORT} ) ;
55 }) ;
In this section we have mentioned all the steps involved in data preprocessing including
data hashing and encryption. Function to decrypt the data is also incuded here.
1
2
3
4 // using canvas to encrypt the image to binary data
5 c o n s t c a n v a s = document . c r e a t e E l e m e n t ( ’canvas’ ) ;
6
34
24
16
17
18 e x p o r t a s y n c f u n c t i o n addImageToIPFS ( i m a g e D a t a ) {
19 c o n s t a d d e d = a w a i t c l i e n t . add ( i m a g e D a t a ) ;
20 c o n s o l e . log ( added . c i d . t o S t r i n g ( ) ) ;
21 return added . c i d . t o S t r i n g ( ) ;
22 }
23
24 // function to add data on ipfs
25
26 a s y n c f u n c t i o n add ( ) {
27 c o n s t i m a g e U r l = ’https://imageurl.jpg’ ;
28 c o n s t response = await f e t c h ( imageUrl ) ;
29 c o n s t imageData = a w a i t r e s p o n s e . blob ( ) ;
30 c o n s t c i d = a w a i t addImageToIPFS ( i m a g e D a t a ) ;
31 c o n s o l e . l o g ( Image a d d e d t o IPFS w i t h CID $ { c i d } ) ;
32 }
33
34 add ( ) ;
35
A.4 FingerPrint Matching
1 // Define the fingerprints to compare
2 c o n s t f i n g e r p r i n t 1 = document . g e t E l e m e n t B y I d ( ’fingerprint1’ ) ;
3 c o n s t f i n g e r p r i n t 2 = document . g e t E l e m e n t B y I d ( ’fingerprint2’ ) ;
4
5 // Load the jsfeat library
6 j s f e a t = r e q u i r e ( ’jsfeat’ ) ;
7
36
50 f i l t e r e d M a t c h e s . push ( matches [ i ] ) ;
51 }
52 }
53 return f i l t e r e d M a t c h e s ;
54 }
55
56 // Call the SIFT functions to compare the fingerprints
57 const keypoints1 = detectFeatures ( fingerprint1 ) ;
58 const keypoints2 = detectFeatures ( fingerprint2 ) ;
59 const descriptors1 = computeDescriptors ( fingerprint1 , keypoints1 ) ;
60 const descriptors2 = computeDescriptors ( fingerprint2 , keypoints2 ) ;
61 const matches = m at c h De s c ri p t o rs ( d e s c r i p t o r s 1 , d e s c r i p t o r s 2 ) ;
62
This sections provides the smart contracts written in solidity language. The smart con-
26 % C o n t r a c t t o u p l o a d and r e t r i v e d a t a
27
28 pragma s o l i d i t y >=0.7.0 < 0 . 9 . 0 ;
29
30 c o n t r a c t ImageUpload {
31
32 / / D e c l a r e a b y t e s v a r i a b l e t o s t o r e t h e image
33 b y t e s p u b l i c image ;
34
37
35 / / D e c l a r e an e v e n t t o e m i t when a new image i s u p l o a d e d
36 e v e n t NewImage ( b y t e s i m a g e ) ;
37
38 / / F u n c t i o n t o u p l o a d t h e image t o t h e b l o c k c h a i n
39 f u n c t i o n u p l o a d I m a g e ( s t r i n g memory i m a g e ) p u b l i c {
40 image = b y t e s ( i m a g e ) ;
41 e m i t NewImage ( image ) ;
42 }
43
44 / / F u n c t i o n t o g e t t h e u p l o a d e d image
45 f u n c t i o n g e t I m a g e ( ) p u b l i c view r e t u r n s ( b y t e s memory ) {
46 r e t u r n image ;
47 }
48
49 }
38