The invention relates to the technical field of computer
information security, and discloses an AI
data security encryption method and
system for an electronic file. An electronic file is read
byte by
byte and converted into a binary bit
stream, a main matrix is filled according to a preset row and column sequence, and insufficient parts are subjected to
zero filling to ensure uniform structure. Receiving a
master key seed, generating a sub-key parameter corresponding to the matrix scale according to a derivation rule, and generating two sets of key matrixes
element by element according to the sub-key parameter; dividing the main matrix into two parts which are not overlapped with each other according to the parity of the row and column index sum, performing XOR on the two parts and the corresponding key matrix to form a double-track
encryption matrix, and fusing to obtain a main
encryption matrix. And then, column cyclic displacement disturbance is driven by using sub-key parameters, and an in-
column structure is disrupted. And finally, carrying out row-based preferential expansion and stripping
zero padding, and outputting a compact
ciphertext. The method covers a complete process from file
transcoding,
key generation to double-track encryption, fusion disturbance and
serialization output.