The invention relates to the technical field of
information security, in particular to a searchable
encryption method and
system based on an sm4
algorithm, and the method comprises the steps:
key generation: generating a first key and a second key; index construction: constructing an
inverted index dictionary based on the
data set; key word
encryption: carrying out
encryption replacement on key words in the
reverse index by using the first key; node encryption and filling: encrypting the nodes in the inverted
record tables by using the second key, and filling all the inverted
record tables to be equal in length;
trap door generation: respectively executing first key encryption and second key encryption on the query keyword to generate a search
trap door; and searching and matching: carrying out matching retrieval in the encrypted
inverted index by utilizing the search
trap door, and outputting a corresponding encrypted
document identifier. According to the method, through
collaborative design of SM4 double-key encryption, pseudo-random permutation, equal-length filling and a trap door retrieval mechanism, high-security storage of
cloud data and efficient retrieval under the
ciphertext condition are achieved.