The present invention relates to the technical field of
data security, and in particular to an adaptive masking method and
system, and a device and a medium. The method comprises: firstly, acquiring a keyword of a current file to be masked of a sender user; then, on the basis of the keyword, performing addition, deletion and modification on a current sensitive word
library to obtain a new sensitive word
library; and finally, generating a
regular expression on the basis of the new sensitive word
library, determining the positions of sensitive words on the basis of the
regular expression, so as to obtain the sensitive words, and performing masking to obtain a masked file. Therefore, masking of a plurality of types of data is realized, and data types before and after masking remain unchanged, thereby ensuring the
readability of a masked file while guaranteeing the security of masked data, and further increasing the masking speed; on the basis of different roles of
receiver and sender users, the masking intensity is adaptively selected, thereby preventing important information from being leaked to untrusted persons, and overcoming the defect of an existing masking
algorithm failing to
resist collusion attacks and brute-force enumeration attacks; and multiple threads are used to concurrently process sensitive word retrieval and sensitive-word masking operations, thereby greatly increasing the masking speed.