Blockchain, as a secure distributed ledger technology, has received extensive attention from academia and industry for its decentralization, comparability and traceability. This paper proposes a method for verifying data security on blockchain, and a cryptographic uploading and retrieval scheme is combined with IOTA blockchain technology. In this way, an IoT data storage and sharing model is designed to combine blockchain with IPFS. In this paper, it is found that there is a certain delay in operating on Fabric and IOTA compared to the scenarios that do not use blockchain. But Fabric has better performance in upload and download performance than IOTA. In the proposed scheme in this paper, the uploading time is stabilized between 0.8 and 1.2, and the retrieval time is stabilized between 0.43s and 0.76s, which has superior data uploading and retrieval performance than Scheme 1. Furthermore, the time to generate a key for a 50MB file is only around 1800ms, and for a 50MB file split into 6KB blocks, the time to generate a secret key is only around 36s. In this paper, when the file size reaches 5MB, the computational overhead of encryption and decryption is about 1315ms and 1283ms, respectively, and the time overhead of data consistency validation is only about 1095ms when the data block is cut into 6KB for a file of 5MB, indicating that this paper’s scheme has a lower time overhead in the generation of the secret key, encryption and decryption, and the data consistency validation. In summary, the above experiments verify the security and applicability of this paper’s scheme in data storage and verification.