Lightweight ciphertext similarity testing method and device

By decrypting and obtaining the Bloom vector in a multi-user environment and calculating its similarity, the problem of being unable to judge the ciphertext similarity in the prior art is solved, and efficient ciphertext similarity judgment and data classification management are achieved, which enhances security.

CN117592084BActive Publication Date: 2025-08-08GUANGZHOU JINGSHI INTELLECTUAL PROPERTY SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311712180.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2025-08-08
Estimated Expiration
2043-12-13

AI Technical Summary

Technical Problem

The prior art cannot effectively judge the ciphertext similarity of different public key encryption in a multi-user environment, resulting in difficulty in managing data classification and vulnerability to attack.

Method used

By obtaining the user's encrypted ciphertext, decrypting the Bloom vector, using the similarity algorithm of the Bloom vector to determine the similarity of the plain text, and using Jaccard similarity, cosine similarity or Dice similarity to calculate the similarity of the Bloom vector.

Benefits of technology

It realizes judging the similarity of ciphertext without decrypting plaintext, improves computing efficiency, reduces computing resource requirements, and enhances attack resistance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117592084B_ABST
    Figure CN117592084B_ABST
Patent Text Reader

Abstract

The present invention provides a lightweight ciphertext similarity testing method and device, comprising: obtaining encrypted ciphertext CT1 of user 1 and encrypted ciphertext CT2 of user 2; decrypting the encrypted ciphertext CT1 and encrypted ciphertext CT2, respectively, to obtain a Bloom vector BV1 for user 1 and a Bloom vector BV2 for user 2; determining the similarity between the Bloom vector BV1 and the Bloom vector BV2, and determining the similarity between the plaintext of user 1 and the plaintext of user 2 based on the similarity. The present invention can perform similarity testing on plaintext contained in ciphertext without decrypting the plaintext; has higher computational efficiency; and can improve resistance to guessing attacks by the test server by sacrificing a small amount of test accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a lightweight ciphertext similarity testing method and device. Background Art

[0002] With the rapid development of computer science and technology, the proliferation of various personal computers and smart devices has made it easier for people to access and use the internet and various information technologies. When local devices' computing power or storage space cannot meet user needs, cloud computing and cloud storage services offer a solution. More and more businesses, organizations, and individuals are opting to outsource their data to cloud servers to reduce computing pressure or free up storage space on local devices. However, while enjoying the convenience of cloud servers, users also bear the risk of personal privacy leaks. Cloud services can be vulnerable to cyberattacks, and cloud servers themselves are inherently untrustworthy, raising concerns about user data privacy and identity security. The development of public-key cryptography offers a new approach to addressing privacy leaks. Data owners must encrypt outsourced data before sending it to cloud servers (to protect its confidentiality). However, data encryption reduces flexibility and makes operations on encrypted data difficult. Encrypted data maintains privacy but loses its identifiability (usability). For example: (1) Ciphertext data retrieval: When searching for the required encrypted files, all possible files need to be downloaded locally and decrypted before searching, which results in a large amount of space and time waste; (2) Ciphertext data deduplication: In cross-user deduplication, due to the different encryption keys of each user, the same underlying data will also be encrypted into different ciphertexts. This makes it difficult for cloud service providers to perform deduplication operations on the same data. The root cause of these problems is that different users use different encryption keys.

[0003] To address the issue of users being able to match ciphertext, some scholars have proposed public-key searchable encryption. This technique allows users to generate query trapdoors using their private keys, without revealing the plaintext, to achieve data search. Users do not need to decrypt the ciphertext; they simply use their private key to operate the query trapdoor, securely obtaining the desired data. This approach protects user privacy and data security while providing convenient data access. The introduction of public-key searchable encryption has attracted widespread attention among researchers, leading to the development of a variety of searchable encryption schemes with different functions. For example, similarity searchable encryption can search for ciphertexts that are highly similar to the target ciphertext, thereby improving the search hit rate and error tolerance. However, public-key searchable encryption does not support matching searches across data encrypted with different public keys in a multi-user environment, which presents certain limitations. To address the problem of matching data encrypted with different public keys in a multi-user environment, Yang et al. first proposed a public key encryption equivalence test scheme, also known as ciphertext equivalence test, in a multi-user environment. This scheme can test whether two ciphertexts encrypted with different public keys are generated from the same plaintext by leveraging the properties of bilinear pairings, without decrypting the ciphertext. However, both this scheme and the traditional PKEET scheme derived from it have certain limitations: they can only determine whether the underlying plaintexts that generated the two ciphertexts are the same (i.e., they can only determine whether they are identical or different), but cannot determine the similarity between the underlying plaintexts of the two ciphertexts. This makes the PKEET scheme limited in applications such as encrypted data clustering (classifying highly similar data into the same data group).

[0004] Public key ciphertext equivalence testing schemes can test whether two ciphertexts encrypted with different public keys are generated from the same plaintext in multi-user scenarios, without decrypting the ciphertexts, by leveraging the properties of bilinear pairings. This solves the problem of matching data encrypted with different public keys in multi-user scenarios. However, traditional public key ciphertext equivalence testing schemes can only determine whether the underlying plaintexts that generated the two ciphertexts are identical—that is, they can only determine whether they are identical or different, but cannot determine the similarity between the underlying plaintexts. This may lead to limitations in practical applications. For example, when we want to group ciphertexts based on ciphertext similarity, traditional public key ciphertext equivalence testing schemes can only group ciphertexts with identical test results, rather than ciphertexts with high similarity. We believe that this type of grouping is not very practical. Furthermore, if there are many similar ciphertexts but few identical ciphertexts, since only determining whether the ciphertexts are identical can result in a large number of groups, which is not conducive to data classification and management. At the same time, if the test server is compromised by hackers or the test server itself is honest and curious, they can use the trapdoor to perform a guessing attack and guess the plaintext message. Because in traditional public key ciphertext equivalence testing schemes, since the test server can extract the test trapdoor from the ciphertext for equivalence testing, the tester can obtain information related to the plaintext. Summary of the Invention

[0005] The present invention provides a lightweight ciphertext similarity testing method and device, which are used to solve the defect in the prior art that similarity testing cannot be performed on data encrypted with different public keys in a multi-user environment.

[0006] The present invention provides a lightweight ciphertext similarity testing method, comprising:

[0007] Obtain the encrypted ciphertext CT1 of user 1 and the encrypted ciphertext CT2 of user 2;

[0008] Decrypt the encrypted ciphertext CT1 and the encrypted ciphertext CT2 respectively to obtain the Bloom vector BV1 for user 1 and the Bloom vector BV2 for user 2;

[0009] The similarity between the Bloom vector BV1 and the Bloom vector BV2 is determined, and the similarity between the plaintext of user 1 and the plaintext of user 2 is determined based on the similarity.

[0010] According to a lightweight ciphertext similarity test method provided by the present invention, the encrypted ciphertext CT1 of user 1 is obtained using the following encryption method:

[0011] Extract the keyword w of the plaintext from user 1’s plaintext M1 to obtain the keyword set W = {w1, w2, w3, w4, ..., wn};

[0012] Generate a Bloom vector BV1 for user 1 using the Bloom vector generation principle for the keyword set W = {w1, w2, w3, w4, ..., wn};

[0013] Select a random number r1 and encrypt the plaintext M1 and Bloom vector BV1 of user 1 respectively to obtain CT1 = {C11, C12, C13}, where C 11 =g r1 , C12=X r1 M1, C 13 =Y r1 BV1;

[0014] Where X is the public key of the recipient, X = g x , Y is the public key of the test server, Y = g y , x, y∈Zp.

[0015] According to a lightweight ciphertext similarity testing method provided by the present invention, the Bloom vector BV1 of user 1 is obtained using the following decryption method:

[0016] Use the private key y of the test server to 1,3 To decrypt, there is C 1,3 / C 1,1 y =(Y r1 ·BV1) / g r1y =(g yr1 ·BV1) / g r1y =BV1.

[0017] According to a lightweight ciphertext similarity testing method provided by the present invention, the determining of the similarity between the Bloom vector BV1 and the Bloom vector BV2 includes using Jaccard similarity, cosine similarity or Dice similarity to determine the similarity between the Bloom vector BV1 and the Bloom vector BV2.

[0018] The present invention also provides a lightweight ciphertext similarity testing device, comprising:

[0019] An acquisition unit, configured to acquire the encrypted ciphertext CT1 of user 1 and the encrypted ciphertext CT2 of user 2;

[0020] A decryption unit, configured to decrypt the encrypted ciphertext CT1 and the encrypted ciphertext CT2, respectively, to obtain a Bloom vector BV1 for user 1 and a Bloom vector BV2 for user 2;

[0021] A determining unit is configured to determine the similarity between the Bloom vector BV1 and the Bloom vector BV2, and determine the similarity between the plaintext of user 1 and the plaintext of user 2 based on the similarity.

[0022] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the lightweight ciphertext similarity testing method described above is implemented.

[0023] The lightweight ciphertext similarity testing method and device provided by the present invention have the following beneficial effects:

[0024] 1. This invention satisfies the requirement of performing similarity tests on plaintext contained in ciphertext without decrypting the plaintext (protecting user privacy) in multi-user scenarios. A designated test server decrypts the BV vectors in different ciphertext packets and can determine the similarity of the plaintext M contained in the ciphertext by testing the Dice similarity of the BV vectors.

[0025] 2. The present invention is lightweight and has higher computational efficiency than traditional PKEET solutions. Compared to most PKEET solutions that require pairwise operations, the present invention only requires multiple hash operations to obtain the Bloom vector for similarity testing. Therefore, the present invention has higher computational efficiency and requires less computing power, making it a lightweight solution.

[0026] 3. By adjusting the Bloom vector generation parameters to increase the collision rate during hash operations, the present invention can improve resistance to guessing attacks by the test server at the expense of a small amount of test accuracy. Due to hash collisions, the test server cannot accurately determine whether a 0 at a position in its known Bloom vector is due to no keyword mapping or multiple keywords being mapped to that position. Similarly, whether a 1 at a position is the result of a single mapping or multiple mappings, making it impossible for the test server to accurately guess the keyword set represented by the Bloom vector. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0028] Figure 1 The lightweight ciphertext similarity testing method provided by the present invention Figure 1 ;

[0029] Figure 2 The lightweight ciphertext similarity testing method provided by the present invention Figure 2 ;

[0030] Figure 3 Generate example graphs for Bloom vectors;

[0031] Figure 4 This is an example diagram of the application of PKEST on encrypted data packets. DETAILED DESCRIPTION

[0032] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0033] Figure 1 The lightweight ciphertext similarity testing method provided by the present invention Figure 1 ,like Figure 1 As shown, the method includes the following steps:

[0034] Step 101: Obtain the encrypted ciphertext CT1 of user 1 and the encrypted ciphertext CT2 of user 2;

[0035] Step 102: Decrypt the encrypted ciphertext CT1 and the encrypted ciphertext CT2 respectively to obtain the Bloom vector BV1 for user 1 and the Bloom vector BV2 for user 2;

[0036] Step 103: Determine the similarity between the Bloom vector BV1 and the Bloom vector BV2, and determine the similarity between the plaintext of user 1 and the plaintext of user 2 based on the similarity.

[0037] Specifically, Figure 2 The lightweight ciphertext similarity testing method provided by the present invention Figure 2 ,like Figure 2 As shown, the method includes the following steps:

[0038] Step 1: Obtain user 1's plaintext M1 and user 2's plaintext M2;

[0039] Step 2: Encrypt M1 to obtain CT1, and upload CT1 to the test server, which receives CT1; encrypt M2 to obtain CT2, and upload CT2 to the test server, which receives CT2;

[0040] Step 3: Extract BV1 and BV2 from CT1 and CT2, and use the similarity test algorithm to test the Dice similarity between BV1 and BV2. This similarity can represent the similarity S between M1 and M2.

[0041] Before introducing the solution of the present invention in detail, the parameters involved are first explained:

[0042] Safety Parameter 1 λ : During the key generation phase, security parameters are input to determine the security and performance of the cryptographic system.

[0043] Z p : represents the set of integers {0,1,2,…,p-1}.

[0044] G: represents a cyclic group of order p.

[0045] g: a group element of the cyclic group G.

[0046] Key pair: A key pair is also called a public-private key pair (pk, sk).

[0047] M: The plaintext message you want to transmit.

[0048] W: keyword set, including multiple keywords w extracted from message M, where W = {w1,w2,w3,....,w n We believe that the main meaning of a message can be represented by a set of keywords extracted from it.

[0049] w: keyword extracted from the plaintext message M.

[0050] r:Z p Random numbers in .

[0051] n: The number of keywords.

[0052] t: length of the bloom vector.

[0053] k: the number of hash functions.

[0054] Hash function (h): A special mapping function. In this scheme, after the keyword w is input into the hash function, the hash function will output a value between 0 and t-1 (that is, the threshold of h is [0, t-1]).

[0055] H: A set of hash functions, which contains k independent hash functions. H = {h1,h2,h3,...,h k}

[0056] BV: Bloom vector, which is a vector generated in a way similar to the Bloom filter generation idea. Figure 3 Generate an example graph for the bloom vector, such as Figure 3 As shown, first set the Bloom vector parameters n, t, k, and H. Initialize each bit of the original BV vector to 0. After performing H(W), save all the resulting values and change the 0s corresponding to these values in the BV vector to 1s. If any bits are already 1, change them to 0. (For example, if there is a keyword w1 and it is entered into H with k = 5, five values will be obtained, all of which are less than t. Suppose these five values are 62, 41, 13, 106, and 412, respectively. Then, change bits 62, 41, 13, 106, and 412 in the BV vector from 0 to 1. If a bit is already 1, change it to 0.)

[0057] CT: Ciphertext package, which can be understood as the entire ciphertext. In this scheme, CT = {C1, C2, C3}. When there are two ciphertext packages, we use CT1 and CT2 to distinguish them. CT1 = {C 1,1 , C 1,2 , C 1,3} and CT2={C 2,1 , C 2,2 , C 2,3}. (Example: C 1,1 Indicates the ciphertext 1 in the first ciphertext packet CT1, C 1,2 Indicates the ciphertext 2 in the first ciphertext packet CT1, C 2,3 Represents the ciphertext 3 in the second ciphertext packet CT2)

[0058] C1: Ciphertext 1, used to transmit the random number r to the receiver and the test server.

[0059] C2: Ciphertext 2, used to deliver the plaintext message M to the receiver. When the receiver receives CT, it can decrypt the plaintext message M from C2 using its own private key sk and C1.

[0060] C3: Ciphertext 3, used to transmit the Bloom vector BV to the designated test server. Because BV is encrypted using the designated test server's public key, only the designated test server with the corresponding private key can use its private key sk and C1 to decrypt BV from C3 and perform similarity testing. Non-designated test servers without the corresponding private key cannot decrypt BV from CT and are therefore unable to perform similarity testing.

[0061] The method provided by the present invention is described in detail below:

[0062] Key generation algorithm: After the user inputs security parameters and a random number of their choice, the algorithm outputs the user's public and private key pair. The user makes the public key public and keeps the private key.

[0063] Encryption algorithm: The user inputs the message M to be encrypted, the recipient's public key pk, the test server's public key pk', and the user-selected random number r into the algorithm. The encryption algorithm first uses the recipient's public key pk and the random number r to encrypt the message M to obtain C1 and C2. It then calls the Bloom vector generation algorithm to generate BV, and uses the random number r and the test server's public key pk' to encrypt BV to obtain C3. Finally, the encryption algorithm outputs the ciphertext package CT.

[0064] Bloom vector generation algorithm: After the keyword set W that can equivalently replace the plaintext message M is input into the algorithm, the Bloom vector generation algorithm generates and outputs the Bloom vector BV in a manner similar to that of the Bloom filter.

[0065] Test algorithm: The test server needs to input the two ciphertext packages CT1 and CT2 to be tested into the algorithm. The test algorithm first uses the private key of the test server to decrypt BV1 and BV2 from the two ciphertext packages CT1 and CT2, and then calls the similarity test algorithm to test the similarity between the two Bloom vectors BV1 and BV2.

[0066] Similarity test algorithm: The Dice similarity between two Bloom vectors BV1 and BV2 can be calculated. First, count the positions of 1 in the BV1 vector and set the set of these positions as |A|. Then count the positions of 1 in the BV2 vector and set the set of these positions as |B|. The Dice similarity is calculated as follows: The threshold is [0, 1]. When the value is 0, it means that the plaintext messages contained in the two ciphertext packets are completely different; the larger the value, the more similar the plaintext messages contained in the two ciphertext packets are; when the value is 1, it means that the plaintext messages contained in the two ciphertext packets are the same.

[0067] Decryption algorithm: The user inputs the ciphertext package CT to be decrypted and his or her own private key sk into the algorithm. The decryption algorithm extracts C1 from CT and uses the private key sk to decrypt the plaintext message M from C2.

[0068] (1) Key generation stage:

[0069] Receiver: Receiver enters security parameter 1 λ , the key generation algorithm randomly selects x∈Z p And, calculate X=g on the multiplicative cyclic group G x , at this time, set the public key pk = X, the private key sk = x. Public key pk = X.

[0070] Test server: Test server input security parameter 1 λ The key generation algorithm randomly selects y∈Zp and calculates Y=g on the multiplication cycle group G. y, at this time, set the public key pk`=Y, the private key sk`=y. Public key pk`=Y.

[0071] (2) Encryption stage

[0072] Sender: The sender enters the plaintext M and public key X and public key Y on the client and executes the encryption algorithm. The encryption algorithm first extracts the keyword w from the plaintext M and obtains the keyword set W = {w1,w2,w3,w4,...,w n Then the keyword set is input into the Bloom vector generation algorithm to generate the Bloom vector BV. The encryption algorithm selects a random number r and encrypts the plaintext M and the Bloom vector BV respectively. CT = {C1, C2, C3} where C1 = g r , C2=X r M, C3 = Y r ·BV.

[0073] (3) Testing phase

[0074] Test server: When the test server receives two ciphertexts CT1 and CT2 that need to be tested for similarity, the test server inputs the private key sk'=y and the ciphertexts CT1 and CT2 into the test algorithm. The test algorithm first uses the test server's private key sk'=y to decrypt the ciphertexts in CT1. 1,3 There is C 1,3 / C 1,1 y =(Y r1 ·BV1) / g r1y =(g yr1 ·BV1) / g r1y =BV1. The test algorithm then uses the test server's private key sk=y to decrypt C in CT2. 2,3 There is C 2,3 / C 2,1 y =(Y r2 ·BV2) / g r2y =(g yr2 ·BV2) / g r2y =BV2. At this point, the test server obtains the Bloom vectors BV1 and BV2 in the two ciphertexts. By bringing BV1 and BV2 into the similarity test algorithm, the similarity between the plaintexts contained in the two ciphertexts can be obtained.

[0075] (4) Decryption stage

[0076] Receiver: The receiver inputs its private key sk = x and the ciphertext CT into the decryption algorithm to decrypt CT, and C2 / C1x = (Xr·M) / grx = (gxr·M) / grx = M. This completes the decryption of the plaintext M.

[0077] The test server extracts the BV vector from the ciphertext package CT, and uses the BV vector to test the similarity of the plaintext M contained in the ciphertext, and groups the ciphertext packages with high similarity into one group.

[0078] Figure 4 This is an example diagram of the application of PKEST on encrypted data packets, such as Figure 4 As shown, by using the method provided by the invention, plaintexts with high similarity can be grouped together, thereby facilitating the management of encrypted data (for example, in traditional searchable encryption, all ciphertexts need to be matched and tested before accurate search results can be returned, but after we effectively group the data, we can search in a specific data group, thereby returning search results more quickly and efficiently).

[0079] This invention demonstrates through theoretical and experimental evidence that the difference between the Dice similarity between Bloom vectors and the Dice similarity between plaintext messages is extremely small or even negligible when parameters are properly preset. Using Bloom vectors, the test server can perform similarity tests without knowing the plaintext messages but only the ciphertext, thereby determining the similarity between two ciphertexts. Compared to traditional similarity searches for encrypted data, this invention is applicable to multi-user scenarios and can perform similarity tests on ciphertexts encrypted with different public keys. Furthermore, compared to traditional public key equivalence testing schemes that only compare two ciphertexts for equality, this invention can determine the degree of similarity between two ciphertexts through testing, thereby better grouping ciphertexts. Furthermore, compared to most equivalence testing schemes that require multiple hash operations, this invention only requires multiple hash operations to obtain the Bloom vector, resulting in higher computational efficiency and less computing power, making it a lightweight solution. Furthermore, the collision rate during hash operations can be improved by adjusting the Bloom vector generation parameters. This improves resistance to guessing attacks by the test server at the expense of a small loss in test accuracy. In the solution of the present invention, the test server has a Bloom vector, and the test server may guess the keyword set represented by the Bloom vector by exhaustively enumerating all hash results of all keywords. However, due to the existence of hash collisions, the test server cannot accurately know whether the 0 at a certain position in its known Bloom vector is caused by no keyword mapping or by multiple keywords being mapped to that position. Similarly, whether the 1 at a certain position is caused by one mapping or multiple mappings, thereby making it impossible for the test server to accurately guess the keyword set represented by the Bloom vector.

[0080] The lightweight ciphertext similarity testing device provided by the present invention is described below. The lightweight ciphertext similarity testing device described below and the lightweight ciphertext similarity testing method described above can refer to each other.

[0081] A lightweight ciphertext similarity testing device, comprising:

[0082] An acquisition unit, configured to acquire the encrypted ciphertext CT1 of user 1 and the encrypted ciphertext CT2 of user 2;

[0083] A decryption unit, configured to decrypt the encrypted ciphertext CT1 and the encrypted ciphertext CT2, respectively, to obtain a Bloom vector BV1 for user 1 and a Bloom vector BV2 for user 2;

[0084] A determining unit is configured to determine the similarity between the Bloom vector BV1 and the Bloom vector BV2, and determine the similarity between the plaintext of user 1 and the plaintext of user 2 based on the similarity.

[0085] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A lightweight ciphertext similarity testing method, characterized in that: include: Obtain the encrypted ciphertext CT1 of user 1 and the encrypted ciphertext CT2 of user 2; Decrypt the encrypted ciphertext CT1 and the encrypted ciphertext CT2 respectively to obtain the Bloom vector BV1 for user 1 and the Bloom vector BV2 for user 2; Determine the similarity between the Bloom vector BV1 and the Bloom vector BV2, and determine the similarity between the plaintext of user 1 and the plaintext of user 2 based on the similarity; The encrypted ciphertext CT1 of user 1 is obtained using the following encryption method: Extract the keyword w of the plaintext from user 1’s plaintext M1 to obtain the keyword set W = {w1, w2, w3, w4, ..., wn}; Generate the Bloom vector BV1 for user 1 using the Bloom vector generation principle for the keyword set W = {w1, w2, w3, w4, ..., wn}; Select a random number r1, encrypt the plaintext M1 and Bloom vector BV1 of user 1, and get CT1={C 11 , C 12 , C 13 }, where C 11 =g r1 , C 12 =X r1 M1, C 13 =Y r1 BV1; Where X is the public key of the recipient, X = g x , Y is the public key of the test server, Y = g y , x, y∈Zp; The Bloom vector is generated by inputting the keyword into the hash function to obtain the corresponding hash value; changing the 0 at the position corresponding to the hash value in the BV vector to 1; if it is already 1, changing it to 0.

2. The lightweight ciphertext similarity testing method according to claim 1, characterized in that: The Bloom vector BV1 of user 1 is obtained by the following decryption method: Use the private key y of the test server to 1,3 To decrypt, there is C 1,3 / C 1,1 y =(Y r1 ·BV1) / g r1y =(g yr1 ·BV1) / g r1y =BV1.

3. The lightweight ciphertext similarity testing method according to claim 2, characterized in that: The determining of the similarity between the Bloom vector BV1 and the Bloom vector BV2 includes using Jaccard similarity, cosine similarity, or Dice similarity to determine the similarity between the Bloom vector BV1 and the Bloom vector BV2.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the lightweight ciphertext similarity testing method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Searchable encryption method based on Chinese in cloud environment

    CN105681280A

  • Ciphertext security retrieval method oriented to spatial keyword similarity

    CN116881739A