The invention discloses a data encryption and decryption method, which includes that S101, an encryption module receives encryption root secret key, encryption times and data to be encrypted; S102, the method judges whether the encryption times are larger than 1, if the times are larger than 1, S104 is conducted, if the times are equal to 1, S103 is conducted; S103, the encryption module conducts encryption on received data by utilizing the encryption root secret key and outputs encryption results; S104, the encryption module divides the data to be encrypted into a plurality of segments of data with equal length and corresponding to the encryption times; S105, the encryption module utilizes the encryption root secret key to serve as the secret key of the first segment of data to encrypt the first segment of data; S106, the encryption module sequentially utilizes the previous segments of data as the secret key to encrypt the following segments of data; S107, the method judges whether the segments of data finish encryption or not, if the segments of data finish encryption, S108 is conducted, if not, S106 is conducted; S108, results obtained by encryption of all the segments of data are sequentially combined and then output. The data encryption and decryption method has the advantages of being high in data encryption safety, convenient to achieve, low in complexity, easy to expand and the like.