This invention discloses an AES file
obfuscation and
encryption method, apparatus,
system, storage medium, and
computer program product based on dynamic slice reconstruction, belonging to the field of computer
data security and file
encryption technology. To address the problems of
high memory consumption in existing whole-file
encryption, insufficient
obfuscation in sequential block encryption structures, incomplete file header
recovery parameters, and weak enterprise
authorization and decryption control capabilities, this invention obtains the
file size, encryption level, and
server key material of the file to be encrypted. It adaptively determines the
block size based on the
file size, generates a slice reconstruction seed based on the AES key, salt value, and
file size, and uses this seed to construct a deterministic out-of-order block arrangement sequence. During encryption, a file header containing the key version, salt value,
block size, number of blocks, original file size, slice reconstruction seed, and header
checksum is generated. Each
plaintext block is encrypted and authenticated using an independent
initialization vector using AES-GCM, and then written to the
ciphertext file in out-of-order order. During decryption, after
server authorization is passed, the block arrangement sequence is reconstructed, and each block is authenticated, decrypted, and written back to its original logical offset position. This invention can improve the
obfuscation capability of the
physical structure of encrypted files while ensuring file
recovery, reduce the
memory footprint of large file encryption, and support key
version management, authorized decryption, and automatic encryption based on enterprise policies.