Secure and Sustainable Decentralized Cloud Using IPFS

. Abstract. Our paper focuses on the implementation of a decentralized cloud storage system using the IPFS (InterPlanetary File System) technology. The project aims to provide an alternative to centralized cloud storage by decentralization, enhanced security, and user control over data which is a more sustainable solution than the existing system. In a centralized cloud storage system, data is stored on a single server controlled by a service provider. This centralized approach poses potential risks such as single points of failure, data breaches, and reliance on the trustworthiness of the provider. In contrast, our decentralized cloud storage system distributes data across a network of interconnected nodes. Each node stores a portion of the data, ensuring redundancy and availability. By leveraging IPFS, which utilizes a distributed hash table and content-addressed storage, our system ensures data integrity, fault tolerance, and censorship resistance. Users of our system have greater control over their data. They can participate in the network by contributing their storage resources and accessing their files securely. The project implementation includes features such as file upload, download, retrieval based on IPFS hashes, and user authentication. It also provides functionalities like displaying connected peers, managing file metadata, and enabling file deletion. Overall, our project showcases the potential of decentralized cloud storage, exemplifying its benefits and illustrating how it can be implemented using IPFS technology.


INTRODUCTION
The secure decentralized cloud project aims to leverage the InterPlanetary File System (IPFS) to create a robust and privacy-focused cloud storage solution.Traditional cloud storage relies on centralized servers, which can present vulnerabilities and concerns regarding data privacy and security.In contrast, IPFS offers a decentralized and distributed approach to storing and retrieving files.The motivation behind this paper lies in addressing the limitations of centralized cloud storage systems.By adopting a decentralized architecture, the project aims to enhance data privacy, reduce reliance on single points of failure, and promote a more resilient cloud storage solution.With the increasing concerns surrounding data breaches, surveillance, and censorship, a secure decentralized cloud using IPFS provides an alternative approach that aligns with the principles of privacy, security, sustainability and data ownership.By leveraging the peer-to-peer network of IPFS, users can have greater control over their data, ensuring that files are stored across multiple peers rather than relying on a single centralized server.The significance of this project lies in empowering individuals and organizations to have ownership and control over their data.By utilizing IPFS, the project enables users to securely upload, store, and retrieve files while maintaining data privacy.Additionally, the integration of smart contracts and cryptocurrency payments provides a mechanism for incentivizing peers who store users' files, further enhancing the decentralized ecosystem.Overall, the secure decentralized cloud project serves as a step towards a more secure, private, and resilient cloud storage solution, providing users with increased control and ownership of their data in an era of growing concerns about data privacy and security.

Machine Learning Algorithms:
Machines are used nowadays in every part of our life.Machines can handle the large amounts of data and are not tiresome like human beings.The results we receive from machines are less error prone.So, training a machine to take care of certain health issues is a good idea.Machine learning understands like how humans will try to understand the data.The only one basic requirement is to train the machine with right and proper and valid data as those are machines.If quality data is not provided the machines may get confused and predict the results with less accuracy.Health issues should be dealt with utmost care.So, the machines trained with relevant data can predict the diseases in an effective manner.
In order to attain accurate results, the pre-processing of the data needs to be performed before giving the data to a machine as input.
The scaling of features is done in machine learning using two methods (i) Normalization and (ii) Standardization.
Normalization or min-max scalar is the rescale of the given data in the range of 0 and 1. Normalization is affected by the presence of outliers.Standardization or z-score is the rescale of given data objects' mean to 0 and standard deviation as 1.There are three types of scalars available into three types like: (i) Standard Scalar (ii) Min-max scalar and (iii) Robust scalar.Section 2 of the paper describes the related previous work done already.and Section 3 discusses the proposed method, section 4 provides the results and section 5 concludes the paper.

RELATED WORK
The paper goal is to use blockchain technology to create a decentralised storage system.The data owner registers themself at first.The owner logs in after successfully registering and uploads a file using the file picker.The system verifies the file size and guarantees network storage availability.When there is enough space, the file gets uploaded.The system then takes action.The AES 256 bit technique is being used to encrypt the submitted file.The wallet address of the owner and a salt value chosen at random are used to create the encryption key.The owner's data is encrypted using this encryption key.As a result, the data's secrecy is preserved.The IPFS protocol is then used to split the encrypted file into 64KB blocks that are delivered to various peers throughout the network.This gives back a hash value that contains the file's path information [1].
The system's goal is to experiment with and show a functional secure file storage system for compact credential files based on blockchain and cryptography.The Kademlia protocol, which is used in the construction of the P2P network, enables each node to join and leave the network at any moment, find its nearest neighbours, update its routing table, and search for any other nodes.In this research, a novel protocol for such a system has been built using several cryptography and network algorithms [2].
Services for decentralised cloud storage offer a great prospect for a distinct 17 cloud market, satisfying the supply and demand for IT resources from a large user base.Security concerns can slow down the realisation of such an opportunity, which is otherwise clearly enticing and promising for the anticipated economic gains, due to the dynamic and independent nature of the ensuing infrastructure.Using decentralised cloud services for storage [3].
The user first registers for a metamask account.The program uses web3.js to retrieve the user's account address and wallet amount from the metamask.Through the file picker, users choose the file to upload.The system determines how many peers are available.Additionally, the AES method encrypts the uploaded file using the user's wallet address as a key.A payment dialogue requests the user's approval.The user's file is saved using the IPFS protocol across all available peers after the payment is confirmed [4] The user layer, data processing layer, storage network layer, and blockchain layer are the four main components of the decentralised storage system proposed in this study.Ordinary users and administrators are the two categories of users that are registered under the user layer.Only the administrator agrees to apply for registration as an ordinary user under the system's access scheme [5].
The distributed cloud storage platform Blockchain data are archived for privacy and security.Data can be encrypted using the digital hash algorithm on a decentralised cloud with the help of the private and public keys.Data is kept in peer-to-peer decentralised cloud storage on this decentralised server.By using a cryptographic technique, it saves encrypted files from both nodes of the transaction [6].A new method for decentralised systems to address flaws such storage constraints and timeconsuming concerns in blockchain and immutably recorded transactions in the IPFS is to combine IPFS and blockchain.The originality of this study in comparison to others is communication and interaction outside of blockchain to other decentralised systems.This study addresses two issues: minimising the issue of slow response times and resolving storage constraints in blockchain [7][8][9][10][11]. .

Fig. 1. System Design for Decentralized Cloud Storage
In the deployment of a private IPFS network, all nodes and users are interconnected in a peer-to-peer (p2p) distributed manner.This means that each participant in the network can communicate directly with others, creating a decentralized and resilient infrastructure.When a user uploads a file to the IPFS network, the file undergoes a process of fragmentation.The file is divided into smaller, manageable chunks, typically around 256KB in size by default.This fragmentation process is essential for efficient distribution and storage across the network.Before these file chunks are distributed and stored among the nodes, they undergo an encryption process using the SHA-256 algorithm.SHA-256 is a cryptographic hash function known for its strong security properties.The encryption ensures that the data remains confidential and protected from unauthorized access during transit and storage.Once the file chunks are encrypted, they are distributed to all the peers (nodes/computers) in the private IPFS network.This distribution process ensures redundancy and fault tolerance, as multiple copies of each chunk are stored across different nodes.Therefore, even if some nodes become unavailable or fail, the data remains accessible from other nodes that hold copies of the same chunks.In the private IPFS network, during the download process, the user's requested file is retrieved by collecting encrypted file chunks from various distributed nodes.Once collected, these chunks are decrypted using the appropriate decryption key generated during the upload.The decrypted chunks are then merged in the correct order to reconstruct the original file.Finally, the complete file is delivered to the user in its original format, ensuring a secure, efficient, and reliable data retrieval experience [9,10].

IPFS ( InterPlanetary File System )
IPFS is a distributed peer-to-peer protocol for decentralized file storage and sharing.It uses content addressing, assigning unique cryptographic hashes to files based on their content, enabling efficient retrieval and verification.IPFS employs content caching and deduplication, storing chunks of files across nodes to enhance availability.It utilizes a distributed routing system and DHT for efficient file retrieval.IPFS ensures data integrity through cryptographic verification and supports data versioning.Overall, IPFS provides a secure, resilient, and decentralized file storage solution with promising applications for building decentralized systems and applications [11].

Python
Python was the primary programming language used in the project.It facilitated user interactions, data storage, and communication with the IPFS network.Python' s objectoriented nature allowed for efficient database modelling and storage of user information and file data.It integrated well with the `ipfshttpclient` library, enabling file uploads, retrievals, and peer-to-peer connections.Python's robustness ensured error handling and system stability.Its readable syntax made coding and debugging easier, making Python a suitable choice for building the secure decentralized cloud platform [8].

Django
Django was the core web framework used in the project.It facilitated user authentication, data storage, and retrieval through the SQLite database.With Django's templating engine, dynamic web pages were created, ensuring a smooth user experience.The framework's URL routing and view functions managed file uploads, downloads, and interactions with the IPFS network.Overall, Django simplified development and enabled the implementation of key functionalities in the decentralized cloud platform.

SQLite
SQLite was utilized as the primary database management system in the project.It served as the backend storage for essential data, including user information, file metadata, and IPFS hashes.Through the Django ORM (Object-Relational Mapping), the application interacted seamlessly with the SQLite database.This lightweight and self-contained database system provided a reliable and efficient solution for managing data in the secure decentralized cloud platform.Its integration with Django facilitated the handling of user registration, file uploads, and retrieval, ensuring a robust and scalable foundation for the application.

Designed System Swarm Key
In the context of a private network, a swarm key could be a unique identifier or access token that grants permission for certain nodes or users to interact with the Swarm network and access specific content.It might be used to authenticate nodes before they can join the private Swarm network or to control which nodes have read or write access to particular data.Every node in the private swarm contains 'swarm.key'file in the '.ipfs' directory

File Upload and Download
The user can easily upload their file through the user-friendly web interface designed using HTML and CSS.Once the file is selected and submitted using the HTML form, Django takes over the process and seamlessly handles the file.Django then securely transfers the file to IPFS (InterPlanetary File System) for decentralized storage and retrieval.By utilizing this efficient system, the user can effortlessly manage their files, ensuring they are securely stored and easily accessible.This combination of technologies brings convenience, reliability, and scalability to the file handling process, making it a seamless experience for the user.

File Management
The In the secure decentralized cloud project using IPFS, users can easily interact with their uploaded files.They have the ability to view the list of files they uploaded, download them to their local machine, and even delete them from the IPFS network.Additionally, users can access information about the peers who are currently storing a specific file, giving them insights into the distribution and availability of their data.These user-friendly features empower users to manage their files efficiently and ensure data privacy and control in the decentralized cloud environment.User can view the uploaded files, download them, or can delete them.They can also see the peers who are storing that file.

File chunk in peer's computer
The file uploaded by the user is initially split into smaller chunks, and these chunks are stored in other peers' computers in an encrypted format.Each chunk is further divided into several small parts, each with a size of 256KB.These smaller parts are then stored in a folder called 'blocks,' which is located within the '.ipfs' folder.The '.ipfs' folder is present in the 'Users' directory.

Analysis
The table above shows the storage costs of a variety of cloud providers, both centralized and decentralized.Centralized clouds are owned and operated by a single entity, while decentralized clouds are distributed across a network of nodes.As you can see, decentralized clouds are generally much more affordable than centralized clouds.Our Cloud, a new decentralized cloud, offers storage for just $0.07/TB/month, which is significantly lower than the cost of any of the centralized clouds in the table.In addition to being more affordable, decentralized clouds also offer a number of other advantages, such as greater security and resilience.Since decentralized clouds are not controlled by a single entity, they are less vulnerable to attack or censorship.The graph depicting download speed vs. the number of peers in a hypothetical IPFS scenario reveals crucial insights into the behavior of a decentralized peer-to-peer network.Initially, as the number of peers increases, the download speed experiences a rapid improvement, highlighting the network's ability to utilize multiple sources for parallel downloads and reduce latency.However, as the number of peers continues to grow, the rate of improvement slows down, indicating diminishing returns download speed.The curve eventually reaches a saturation point, where further increasing the number of peers doesn't significantly enhance download speed.This observation emphasizes the need to find an optimal balance between peer participation and download performance.The graph underscores IPFS's strength in leveraging its distributed nature for resilience and robustness, ensuring reliable content retrieval by employing multiple peers.Understanding these patterns is crucial for optimizing peer networks and improving overall system performance in real-world IPFS deployments.

CONCLUSION
In conclusion, our project aimed to explore the concept of decentralized cloud storage using IPFS (InterPlanetary File System).We developed a web application that allows users to upload, store, and retrieve files using IPFS technology.Throughout the project, we compared centralized and decentralized cloud storage models.We identified the advantages of decentralized storage, such as improved data availability, resilience to failures, and reduced dependency on a single provider.We also discussed the challenges, including slower network speeds and higher storage requirements.By implementing IPFS, we leveraged its unique features like content addressing and distributed peer-to-peer network.This allowed us to achieve data integrity, censorship resistance, and data redundancy.The files uploaded by users are split into smaller chunks, encrypted, and distributed across the IPFS network, ensuring their availability even if some nodes go offline.We integrated additional features like user registration, authentication, and file management.Users can upload files, view their uploaded files, download files using IPFS hashes, and delete files when needed.Our project showcased the potential of decentralized cloud storage and its applicability in real-world scenarios.It provides an alternative approach to traditional centralized cloud storage, offering more control and ownership over data and further opening up the possibility for a sustainable development in the same aspect.Overall, our project demonstrated the capabilities of IPFS and highlighted the benefits and challenges associated with decentralized cloud storage.It opens up avenues for further exploration and research in the field of decentralized technologies, paving the way for a more decentralized and resilient internet infrastructure.

FUTURE SCOPE
The future scope and enhancements of your project include integrating additional decentralized storage protocols like Filecoin, Sia, or Storj to offer users more storage options.Improving the user interface and experience with features such as file previews, organization, search, and error handling can enhance usability.Implementing advanced file management functionalities like versioning, sharing, and collaborative editing will enable users to track and collaborate on files effectively.Strengthening security measures with end-to-end encryption, encryption key management, and multi-factor authentication will enhance data protection.Optimizing scalability and performance with caching, load balancing, and distributed storage techniques will ensure efficient handling of user requests.Integrating blockchain technology can provide added security and transparency.Developing mobile applications will extend accessibility.Integrating with third-party services and incorporating community features will enhance collaboration and engagement.Continuous monitoring, maintenance, and staying updated with advancements in decentralized storage technologies will ensure a robust, sustainable and reliable system.