The invention relates to the technical field of data
encryption, in particular to a data
encryption method, which comprises the following steps: capturing an input
stream of a first file according to a preset divider to obtain captured data, a first template and first data, and dividing the first data according to a first length to obtain a second template; obtaining a first array, filling the first array to obtain a second array and a first index array, obtaining an encrypted slice sequence, a second index sequence and a key sequence through
encryption, further constructing a second file, storing
metadata and the second file on a first physical
machine, storing the encrypted slice sequence on a second physical
machine, and storing the encrypted slice sequence on a second physical
machine; the
stream mode plays a role in reading and
processing the source file in blocks, plays a role in efficiently
processing and saving the memory, the data block encryption and the secret key are independent, and the purposes that the corresponding
ciphertext block is decrypted according to the access authority to obtain the
plaintext and the influence range of the security event is effectively limited are achieved.