The invention discloses a data
encryption method, and belongs to the technical field of text
encryption. The method comprises the following steps: firstly, converting text data into binary codes, splitting the binary codes into odd bit sequences and even bit sequences, and respectively constructing corresponding matrixes; the method comprises the following steps: generating a matrix row / column status bit, calculating a shift amount and executing
cyclic shift to obtain an odd
shift matrix and an even
shift matrix; converting rows / columns of the
shift matrix into decimal numeric vectors, and performing
encryption in combination with fractal offset key vectors to generate four types of encryption matrixes of odd rows, odd columns, even rows and even columns; xOR
processing is performed on the same type of matrixes, and a
confusion value is generated based on correlation values of odd parts and even parts, so that a
hybrid enhanced encryption matrix is obtained; and finally, restoring the two types of enhanced matrixes into a sequence, recombining according to odd and even bits, and outputting a
ciphertext. According to the method, through multi-level
processing of bit splitting, matrix shifting, fractal key encryption and XOR
confusion, the complexity and
cracking resistance of data encryption are remarkably improved, and the security of
data transmission and storage is guaranteed.