Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Decentralized Web-Based File Storage & Sharing

System on Ethereum

Vinay Kiran Polisetti Anirban Bhattacharjee Amrit Gupta


IIIT NAYA RAIPUR IIIT NAYA RAIPUR IIIT NAYA RAIPUR
Rajahmundry, India Korba, India Ramagundam, India
polisetti21100@iiitnr.edu.in anirban21100@iiitnr.edu.in amrit21100@iiitnr.edu.in

Abstract— Blockchain technology has been widely explored as needing a centralized server. IPFS allows the Dapp faster file
a decentralized solution for recording transactions, but it has access, reduced bandwidth consumption, and improved
limitations when it comes to storing large files or documents. A scalability compared to traditional centralized file-sharing
decentralized storage system called IPFS has been developed to systems [1]. Moreover, the files shared through IPFS are
overcome this challenge. Although there have been attempts to encrypted via Advanced Encryption Standard (AES) to
combine IPFS and blockchain, sharing data through this provide total control over who can access them. This ensures
approach has proven to be inefficient. To address this issue, a that files are only accessible by authorized users and that the
secure file-sharing system is proposed that utilizes a dAapp for
privacy of the users is protected.
distributed access control and group key management. The
dApp takes charge of control policies, while the combination of
the IPFS server and blockchain network enables a secure file-
sharing system where members can create or join groups based Metamask is a popular browser extension and mobile wallet
on their preferences. Although the IPFS server and blockchain that allows users to interact with decentralized applications
network lack an access control mechanism, the secure file- (dApps) on the Ethereum blockchain. As a wallet, it allows
sharing system manages access control policies so that users to securely store and manage their Ethereum and ERC-
members can access only the files they are authorized to. 20 tokens. As a browser extension, it enables users to easily
access and interact with dApps, such as decentralized
Keywords— Ethereum, Decentralization, File Sharing, IPFS, exchanges, NFT marketplaces[2], and more.
Blockchain, MetaMask, INFURA, KEYS

I. INTRODUCTION

Digital privacy is becoming increasingly important in the


modern age as more personal information is shared and
stored online. Internet privacy is crucial to protect individuals
from identity theft, financial fraud, and other malicious
activities. The problem addressed is the lack of privacy and
security in traditional centralized file-sharing systems, and
the need for a decentralized and secure alternative for file
sharing on a global and peer-to-peer network along with team
collaboration. The use of Blockchain such as Ethereum and
InterPlanetary File System (IPFS) in decentralized
applications (Dapps) provides an opportunity to address this
problem but the privacy aspect of Dapps based on
Blockchain and IPFS has not been fully explored.

The objectives include showing the advantages and trouble-


free nature of using decentralized cloud and Blockchain over
centralized file-sharing applications, suggesting a model for Fig.1 Metamask transaction interface
file-sharing with enhanced privacy including a planet-wide
efficient zero-redundancy cloud, and building a prototype
website that demonstrates the proposal by sharing a few files
II. RESEARCH GAP
live globally and peer-to-peer followed by downloading
respectively.
Following the research gaps inferred from the investigation
of the research papers:
The Dapp allows users to upload and share files of any size 1. Blockchain networks can be used for two purposes.
through a fully decentralized system, which is powered by The integrity of the hash data collected from cloud
IPFS. IPFS is a peer-to-peer file-sharing protocol that allows collection to the blockchain network is protected
for the distribution of files across a network of nodes without
and stored in a distributed manner to ensure encrypting a large amount of data. As compared to RSA,
stability. which is a computationally heavy algorithm used to
securely transfer the AES key.
Paper Title Methodology
Enhancing the Security of Combining Blockchain and
III. PROPOSED SOLUTIONS
the Blockchain and the File IPFS to store files. Using
Contents only AES to encrypt file
contents. When a new user wants to sign up to the website, they will
Secure Distributed Cloud Using a Ethereum have to enter a username (and a full name field). It is
Storage based on the Blockchain to store & assumed that the user has a MetaMask account and is and is
Blockchain Technology transfer files using smart already logged into it and is accessing the website through
and Smart Contracts contracts. Using only RSA the same browser window that has MetaMask installed. A
for encryption. user’s public and private key is generated using RSA. The
Decentralized File Storage Uses Blockchain and IPFS public and private keys along with the username are sent to
(Interplanetary File to transfer files. Only peer- the node that has a contract named main deployed on it. The
System) using Blockchain to-peer transfer is main contract will now take all three inputs (username, user
possible .No groups or public key, and user private key) and creates a new user on
global space. the Ethereum blockchain. The block is then deployed using
Employs secure file a transaction facilitated by the MetaMask wallet. In our
A Secure File Sharing sharing with distributed solution, upon initiating a transaction, a signed transaction
System Based on IPFS and access control and group reaches an Infura endpoint which then redirects it to an
Blockchain key management, without a address on the blockchain where the block is to be deployed.
global space.

Fig.2 Summary of related research papers

2. To secure the data record, the cloud server is


obliged to request block data from the blockchain
network as permanent proof of data integrity.
3. Additionally, data analytics data analysis and
control system and server analysis can help
determine the first stage of denying a distribution of
service attacks.
Fig.3 Shows the mechanism of adding users
4. In addition, each response from the cloud server and
website access will be recorded in a block series for
further review or investigation.
After a user is logged in, in this case, we call the user a
5. Not only will the data record be kept permanently, client, the client is given the freedom to create a group, to
but a data block will also be generated to validate which it can add other clients as many as it wants/required.
the data. The non-owner clients get a notification/request in their
6. Each data collected from the cloud collection is dashboard regarding the group joins invitation. They can
structured as meta-ancestor time data. After sending either accept or reject the group join request. In the same
a meta-ancestor to the control system, the control dashboard, the users can search for all the registered users
system transfers hash data to the blockchain on the website using usernames which on a successful fetch
network and sends the original data to the cloud returns the user’s MetaMask address and a list of common
database. groups. When creating a group, the user enters a group
name. A group public-private key pair is created and sent to
7. At the same time, the control system will revert the user account instance already deployed on the
back to the cloud collection of some command data,
blockchain. The instance hosts a function to create a group
these commands will also be converted to time,
instance. The group instance is then created and deployed
command format, and recorded in the blockchain.
after a transaction through the MetaMask wallet. The group
instance consists of a custom self-implemented data
Furthermore, our research proposal intends to implement structure called FolderTree. Each node in the tree can have
a global file-sharing space that allows users to obtain either a file or a folder as a child node. Every node is
files from other users without the need for a file hash or indexed as an SHA-3 Hash that takes the immediate parent
a group to which the file owner belongs. Also, our address, owner MetaMask address, & Block No. as input so
implementation consists uses hybrid cryptography for that is node is harder to compromise in case of an attack.
file encryption that first encapsulates file contents using
AES, then encrypts the AES key using RSA, providing
dual-layer protection in case of a compromise. This is
done in this order since AES is significantly faster when
The user can upload, share or download files to the IPFS
directly through the website without relying on any third
party. The website keeps track of all the file activities of the
client in a tabular format. The files here are encrypted using
the user public key which was generated during the sign-up.

While sharing a file in the groups, the file key is encrypted


using the group public key as the group private key is
common and available to all group members during
decryption. In peer-to-peer, mode the file key is encrypted
using the recipient’s public key.
Fig.4 Shows the mechanism of adding groups
In the global space that we implemented, the user has the
To add a file to the folder tree, we first convert the file to a choice to upload the files either anonymously or by using
file buffer (stream of bytes). The file before encryption is their username. The files are sorted by their extensions. The
converted to a file buffer and is encoded. We then use AES files can be directly opened on the website through IPFS
to encrypt it since file sizes can be quite large and AES is a since they are not encrypted. A real-time chat option is also
low-time complexity algorithm. The file is then uploaded on available to all users so that they can request a required file
IPFS by calling an add function on the file. The file if from all the other users using their MetaMask addresses in
successfully uploaded to IPFS, will return a hash that the global space. Users can use the chat option as a message
contains tabular information about what parts of the file are forum or use it for file sharing.
uploaded where on the IPFS. The AES key is encrypted
using RSA. Now to the group instance where this file is One Transaction each is required to send a chat message and
shared, a write operation is initiated on the group instance add a folder.
block that adds the file directory relative to the Folder Tree,
The IPFS hash, the filename, and the RSA encrypted key. When a file is deleted, the pointer variable corresponding to
Since this operation involves updating the block, a the file node marks the entire branch as invalid indicating
transaction is needed to complete this operation. On the not to search the branch for file retrieval in future requests,
website, a table created to store information about files in order to account for a folder deletion.
uploaded in the group is called to add a row corresponding
to the newly updated file. IV. RESULTS
To download a file, from the group instance, the IPFS hash
and the encrypted AES key (from the FolderTree), and the We have achieved the successful development of a
group private key are first sent to the client where the key is decentralized web-based system that facilitates various
decrypted using the group private key. The IPFS hash is sent functionalities, including account creation, automated login,
to the IPFS to retrieve a file buffer which will then be messaging and chat-based transactions, folder creation, and
decrypted using the decrypted AES key, resulting in a group management with the ability to add members.
decrypted file buffer. The file buffer can then be decoded
before downloading the file in the comfort of your home. Automatic login system through metamask account
address: This feature allows users to log in to the Dapp
To share a file, we first decrypt the encrypted AES key, and automatically using their metamask account address, which
get the file IPFS hash from the FolderTree, get the recipient provides a secure and convenient way to access the Dapp.
user instance, get their public key, decrypt the AES key of
the file buffer using the public key. Two transactions occur Decentralized file sharing: The Dapp allows users to upload
here: One is for adding a row that a file was sent from the and share files of any size through a fully decentralized
sender and the second is for adding a row that a file was system, which is powered by IPFS. Files shared through
received by the recipient. IPFS are encrypted via Advanced Encryption Standard
(AES) to provide total control over who can access them.

Team collaboration: The Dapp allows users to start a new


project and invite other users to join, creating a decentralized
collaborative workspace where team members can share,
access, and manage files efficiently and securely.

Global and peer-to-peer file sharing: The Dapp allows


users to share files globally and peer-to-peer, protected by
Public and Private Keys of the users using RSA
encryption[4]. IPFS leads to improved user experience in
multiple cases. IPFS allows for distributed storage of data
that is immune to altering and forgery[5].
Fig.5 Shows the sharing mechanism
Advantages of decentralized cloud and Blockchain:
Decentralized cloud and Blockchain technology provide
transparency, security, efficiency, and traceability, which are 5. H. Li, Y. Ren, and X. Jia, "A blockchain-based
advantages over centralized file-sharing applications like decentralized multimedia sharing system," Journal
Google Drive and Dropbox[6]. of Ambient Intelligence and Humanized
Computing, vol. 11, no. 5, pp. 27-40, May 2020.
Comparison with centralized file-sharing applications:
Centralized file-sharing applications have a restrictive nature 6. X. Zhang, X. Liu, J. Chen, and Q. Wang,
and are vulnerable to data leaks. The Dapp is based on IPFS, "Blockchain-based secure multimedia transfer
which is a content-addressed system that lowers bandwidth system," Multimedia Tools and Applications, vol.
consumption and improves file access speed[7]. 78, no. 24, pp. 29689-29706, Dec. 2019.
7. D. Tapscott and A. Tapscott, Blockchain
Advantages in smart education: The Dapp allows students Revolution: How the Technology Behind Bitcoin Is
to access educational files like video tutorials and PDFs Changing Money, Business, and the World, 1st ed.
globally, and create groups for studying together and posting New York: Portfolio, 2016.
Q&A.
8. H. Jin, et al., "BlockMedia: A Blockchain-Based
Security: Using a decentralized system to store files provides Multimedia Content Delivery System," IEEE
users with more security as files are at risk if they are in the Access, vol. 7, pp. 19395-19405, 2019.
hands of a single individual.

Global space: The Dapp provides a global space where 9. H. Huang, T. Chang, and J. Wu, "A Secure File
anyone can post any type of file (pdf, video, image, text)[8] Sharing System Based on IPFS and Blockchain,"
to share with other users. Users can also request a particular arXiv, 2022. [Online]. Available:
content file in the global space by posting a request. https://doi.org/10.1145/3409934.3409948

10. G. Solonas, Y. C. S., C. H., H. A., and N. K.,


V. CONCLUSION "Secure Distributed Cloud Storage based on the
Blockchain Technology and Smart Contracts,"
In this report, we have discussed the privacy aspect of iJournalse, 2023. [Online]. Available:
dApps based on Blockchain and IPFS and the advantages https://doi.org/10.28991/ESJ-2023-07-02-012
that they offer over centralized file-sharing applications. The
use of Blockchain and IPFS in dApps allows for 11. K. Anusree, V. Jagan Sathiaseelan, R. Dev, and A.
decentralized file sharing, team collaboration, and global Abhinav, "Decentralized File Transfer System
and peer-to-peer file sharing, all while ensuring the security Blockchain-based File Transfer," International
and privacy of users. Additionally, the use of dApps in the Journal of Engineering Research & Technology
smart education and the creation of a global space for file (IJERT), vol. 11, issue 05, May 2022.
sharing can lead to increased access to educational resources
and opportunities for collaborative learning and a more open 12. N. Wadile, J. Shamdasani, S. Deshmukh, M.
and decentralized repository of files. Sayyed, and S. Khandare, "Decentralized File
Storage (Interplanetary File System) using
Blockchain," International Journal of Engineering
REFERENCES Research & Technology (IJERT), vol. 12, issue
March, 2023.
1. J. Benet, "IPFS - Content Addressed, Versioned,
P2P File System," arXiv preprint arXiv:1407.3561,
Jul. 2014.

2. Y. Niu, C. Li, and Y. Zhang, "Decentralized


multimedia content distribution with blockchain,"
Multimedia Tools and Applications, vol. 77, no. 23,
pp. 29785-29807, Dec. 2018.

3. M. Zhou, Q. Xu, Y. Li, and Y. Liu, "A blockchain-


based secure and privacy-preserving multimedia
content delivery system," Future Generation
Computer Systems, vol. 98, pp. 764-777, Nov.
2019.

4. C. Liu, X. Zhang, Q. Wang, and J. Lu,


"Blockchain-based trust management for
multimedia sharing in IoT," Sensors, vol. 19, no.
19, article no. 4268, Oct. 2019.

You might also like