The invention discloses a
blockchain-based
data cloud storage
encryption method and
system. The method includes the following steps that: a data owner uses a symmetric key to encrypt a file so as to obtain a file
ciphertext, and then, encrypts the symmetric key by using the public key of the data owner so as to obtain a key
ciphertext, and the data owner uses the public key of an attribute key pair to perform secondary
encryption on the key
ciphertext, and stores the file ciphertext and the key ciphertext which has been subjected to secondary
encryption to could, wherein the attribute encryption public and private key pair is generated by a proxy re-encryption module; the proxy re-encryption module generates a re-encryption key that authorizes access to the file ciphertext to a data visitor, and writes the re-encryption key and the private key of the attribute encryption public and private key pair into a
blockchain; and the data owner writs the
access control policy of the file ciphertext into a
smart contract. According to the
blockchain-based
data cloud storage encryption method and
system of the embodiments of the invention, the re-encryption technology and the attribute encryption technology are combined, so that the encrypted storage of data files on the cloud can be realized; and the
smart contract technology is used to realize the
access control of the data on the cloud, and therefore, the privacy and security of the data can be fully guaranteed.