The application discloses a data
encryption method, and belongs to the technical field of text
encryption. First, the text data is converted into binary code and split into odd and even bit sequences, and corresponding matrices are constructed respectively; the odd and even shift matrices are obtained by generating matrix row / column state bits, calculating shift amount and performing
cyclic shift; then the rows and columns of the
shift matrix are converted into decimal numerical vectors, combined with fractal offset key vectors for
encryption, and four types of encryption matrices of odd row, odd column, even row and even column are generated; the same type of matrices are subjected to XOR
processing, and the
confusion value is generated based on the odd part and the even part related value, so that the mixed enhanced encryption matrix is obtained; finally, the two types of enhanced matrices are restored into sequences and reorganized according to the odd and even bits, and the
ciphertext is output. Through the multilevel
processing of bit splitting, matrix shifting, fractal key encryption and XOR
confusion, the complexity and anti-
cracking ability of data encryption are significantly improved, and the safety of
data transmission and storage is ensured.