The Inter Planetary File System(IPFS)has been widely used due to its unique advantages and the advantages it brings as a distributed file system,which puts forward security requirements for IPFS.However,the thesis found that IPFS has some privacy issues,and even adding access control to it cannot completely avoid unauthorized access to data by malicious nodes.To address this issue,some scholars have adopted the means of encrypting data to ensure privacy security.However,this can pose another problem.Due to different encryption algorithms or encryption keys for the same data,the generated ciphertext can be quite different,which can completely undermine the important advantage of IPFS in network wide deduplication.Therefore,based on the characteristics of IPFS file slicing combined with AES and SHA,this thesis proposes a new solution,a lightweight encryption scheme.This scheme can be smoothly integrated into IPFS.During the upload process,the hash value of the first file slice is used to encrypt some of the sliced file slices according to the policies formulated by the user.During the download process,the encrypted slices are identified and decrypted.In addition,in order to further improve the performance,the thesis has improved the file encryption strategy.After experiments,the thesis found that when only part of the file content is encrypted,different file types have a significant impact on the encryption results.Therefore,the thesis further analyzes the encoding formats of mainstream file types such as zip,rar,and pdf,and designs file type recognition schemes and encryption and decryption schemes specific to each file type.Finally,the proposed scheme was tested on both js-ipfs and go-ipfs,and a prototype system was completed using Vue and other technologies.After testing,the system can increase file security without affecting the performance of IPFS itself as much as possible,and maximize the retention of the deduplication effect of IPFS. |