Method for duplicate detection and storage based on homomorphic encryption and simhash

By using homomorphic encryption and Simhash, and leveraging RSA, Chameleon Hash, and IPFS, secure retrieval and storage of copyright data in encrypted form is achieved. This solves the security deficiencies of traditional solutions and improves the security and efficiency of data storage.

CN116070276BActive Publication Date: 2025-12-05XIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310157697.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2025-12-05
Estimated Expiration
2043-02-23

AI Technical Summary

Technical Problem

Traditional copyright data storage solutions cannot be retrieved or queried in encrypted form and pose security risks, especially when dealing with large-scale data that requires decryption and verification, resulting in insufficient security.

Method used

The method employs homomorphic encryption and Simhash, generating public and private keys using the RSA algorithm, encrypting text using an improved RSA algorithm, and combining chameleon hashing and IPFS distributed storage for ciphertext verification and Simhash signature calculation. The Paillier algorithm is used for homomorphic encryption and Hamming distance calculation to achieve secure retrieval in ciphertext state.

Benefits of technology

It enables secure and efficient copyright data retrieval in encrypted form, enhances data security and uniqueness, ensures the immutability of file storage addresses, and improves storage efficiency and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116070276B_ABST
    Figure CN116070276B_ABST
Patent Text Reader

Abstract

The application discloses a homomorphic encryption and Simhash-based ciphertext duplicate checking and storage method, which comprises RSA data encryption and decryption, chameleon hash calculation, secret sharing calculation, simhash calculation and a homomorphic encryption method. The ciphertext state verification can be realized, and the security of the file is enhanced. In the encryption and decryption and chameleon hash calculation process, the random number of the algorithm is deleted, so that the ciphertext of the same file after encryption is the same, and the same chameleon hash is generated. The file is transmitted to the IPFS to realize distributed storage, and the IPFS can ensure that the file corresponds to a unique storage address according to content hash addressing. The data ciphertext is calculated by using the homomorphic encryption technology, so that the security of the data is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of information security, and particularly relates to a ciphertext duplicate checking and storage method based on homomorphic encryption and Simhash. BACKGROUND

[0002] In the current data era, the total amount of digital copyright in the cloud storage era is large, so it is necessary to consider how to operate the copyright data in the ciphertext state and how to efficiently retrieve the copyright data in the ciphertext state by using the verification rule in the storage of copyright data. It is very important to research the ciphertext storage mechanism based on homomorphic encryption in combination with the blockchain and IPFS data storage mechanism to realize the privacy protection of personal data copyright.

[0003] The traditional copyright data storage scheme cannot retrieve and query the personal copyright data in the ciphertext state, and does not introduce a ciphertext processing method in the storage of copyright data. When comparing large-scale data, if a traditional encryption method is used for encryption, the data ciphertext needs to be decrypted and verified again when retrieving the copyright data, which brings a series of security risks. SUMMARY

[0004] The purpose of the application is to provide a ciphertext duplicate checking and storage method based on homomorphic encryption and Simhash, which can improve the security of data storage.

[0005] The technical scheme adopted by the application is a ciphertext duplicate checking and storage method based on homomorphic encryption and Simhash, which is implemented according to the following steps:

[0006] Step 1, the system generates the public key and the private key of the system according to the RSA algorithm, and shares the private key of the system secretly through the shamir algorithm to m holders;

[0007] Step 2, delete the random number in the RSA algorithm as an improved RSA algorithm, upload the text to the system, and encrypt the text by using the improved RSA algorithm to obtain the ciphertext;

[0008] Step 3, perform chameleon hash on the ciphertext and the system public and private keys together, calculate and generate chameleon hash Hash, and upload the ciphertext and the chameleon hash Hash to IPFS;

[0009] Step 4, find the ciphertext and the chameleon hash Hash according to the address returned by the IPFS, perform chameleon hash operation on the ciphertext to verify the correctness of the ciphertext;

[0010] Step 5, perform RSA decryption on the ciphertext to obtain the original file;

[0011] Step 6, perform Simhash operation on the text to obtain a simhash signature fingerprint;

[0012] Step 7, homomorphic encryption calculation is carried out on the fingerprint to obtain ciphertext en simhash and storage is carried out;

[0013] Step 8, homomorphic addition calculation is carried out on the ciphertext en simhash to obtain ciphertext addition en add simhash;

[0014] Step 9, Hamming distance calculation is carried out on the ciphertext addition en add simhash, integer t is obtained, and similarity calculation is carried out on t.

[0015] The application is also characterized in that:

[0016] The specific process of step 1 is:

[0017] Step 1.1, the system generates a system key by running a GenerateRsaKey function;

[0018] The expression for generating the system key is as follows:

[0019]

[0020] Wherein, e is an integer randomly selected, e satisfies 1<e<φ(n) and e is prime with φ(n); φ(n) is the Euler function of n, n is the product of two unequal large prime numbers p and q randomly selected, and then n and e are packaged into a public key, and n and d are packaged into a private key;

[0021] Step 1.2, the private key of the system is shared secretly to m holders, and the threshold value of the holder of the lowest sub-key is set to k; the m holders respectively store a (x, P) pair, x is a randomly generated integer, and P is f(x) obtained by secret sharing;

[0022] The expression for secret sharing of the system private key s is as follows:

[0023]

[0024] Wherein, the private key s is a constant term, 1 to p in the finite field is randomly taken k-1 numbers, denoted as a1, a2, … a k-1 , as the coefficient of the k-1 polynomial f(x), a total of m terms, the m holders are denoted as P1, P2, … P n , and the shared sub-key is f(i).

[0025] The specific process of step 2 is:

[0026] The system public key (n, e) obtained through step 1 is used to encrypt the file w, the random number in the RSA algorithm is deleted as an improved RSA algorithm, and the specific expression for encrypting the file w is as follows:

[0027]

[0028] Where w is the uploaded file, c is the encrypted ciphertext of the file, and (n,e) is the system public key obtained in step 1, which is used to encrypt the file.

[0029] Step 3 is as follows:

[0030] Step 3.1: Perform a chameleon hash calculation on the ciphertext c calculated in step 2 together with the system public key and private key generated in step 1 to obtain a chameleon hash hash1;

[0031] The specific expression for the chameleon hash is:

[0032]

[0033] Where c is the encrypted ciphertext of the file, g is the group generator, and n is the system public key;

[0034] Step 3.2: Upload the ciphertext c and hash1 to IPFS for distributed storage;

[0035] Step 3.3: IPFS will return an address hash for users to query files. IPFS uses content addressing, where content determines the address. Due to the one-wayness and collision resistance of hashes, files with different content have different IPFS storage addresses.

[0036] Step 4 is as follows:

[0037] The user obtains the ciphertext c and chameleon hash hash1 based on the address hash. The ciphertext c is then recalculated to obtain chameleon hash hash2. The chameleon hash verification function is used to check whether hash1 and hash2 are equal. If they are equal, step 5 is executed.

[0038] The chameleon hash verification function expression is as follows:

[0039]

[0040] Here, 0 means that hash1 and hash2 are equal, that is, the ciphertext c has not been modified by the attacker.

[0041] Step 5 is as follows:

[0042] The system private key is recovered by secretly sharing the threshold gate k pair (x,P) and decrypting the ciphertext c to obtain the original file. (x,P) is the subkey pair obtained by the m holders in step 1.

[0043] The specific expression for the shared recovery system private key is as follows:

[0044] (a) When x=0, f(0)=s, the system private key s can be recovered;

[0045] (b) Substituting k groups (xi,pi) into the following formula will recover the system private key s;

[0046]

[0047] The specific expression for decrypting ciphertext c is:

[0048]

[0049] Where c is the ciphertext of the encrypted file, w is the plaintext after decryption, and (n,d) is the system private key.

[0050] Step 6 is as follows:

[0051] Step 6.1: Segment the text into words. The Porter extraction algorithm is used to extract the stems of the words. The extracted stems are organized into a feature set, namely vector V. Each feature is assigned a weight according to the frequency of each word.

[0052] Step 6.2: Initialize a 64-dimensional vector V to 0; initialize a 64-bit binary number S to 0; for each feature: generate a 64-bit signature b for that feature using a traditional hash algorithm;

[0053] Step 6.3: After obtaining the signature b, for i=1, ..., 64: if the i-th bit of b is 1, then add the weight of the feature to the i-th element of V; otherwise, subtract the weight of the feature from the i-th element of V.

[0054] Step 6.4: Sum the weighted code elements of each of the above feature vectors to obtain a new sequence string V';

[0055] Step 6.5: If the i-th element of the new sequence string V' is greater than 0, then the i-th bit of S is 1; otherwise, it is 0. Set each bit to decimal. Output S as the signature, which is the simhash signature value fingerprint obtained by Simhash calculation on the text.

[0056] The homomorphic encryption computation in step 7 uses the Paillier algorithm, the specific expression of which is:

[0057] Cipher

[0058] Among them, the public key is (n, g), m is the simhash signature, satisfying m < n, r is a random number, satisfying 0 < r < n.

[0059] The specific expression of the homomorphic addition in step 8 is:

[0060] Ciphertext addition

[0061] Among them, c1 and c2 are respectively the ciphertext ensimhash, that is , .

[0062] The specific process of step 9 is:

[0063] Step 9.1: Homomorphically decrypt the ciphertext addition enaddsimhash, and the specific expression is:

[0064] Plaintext

[0065] Among them, c is the ciphertext addition enaddsimhash, , define the function L(x) = (x - 1) / n, and calculate the modular inverse element ;

[0066] Step 9.2: Calculate the Hamming distance of the decrypted content to obtain an integer t;

[0067] Among them, the Hamming distance is defined as the number of 1s in the elements of the plaintext m, that is, an integer t, and the specific calculation expression is:

[0068] When the integer t is less than or equal to 3, it is determined to be similar, and the similarity is 30%;

[0069] The specific expression for calculating the similarity is:

[0070] When t < 1, the similarity is 100%;

[0071] When 1 ≤ t ≤ 3, the similarity ;

[0072] When 3 < t ≤ 64, the similarity .

[0073] The beneficial effects of the present invention are:

[0074] This invention relates to a method for ciphertext deduplication and storage based on homomorphic encryption and Simhash, including RSA data encryption / decryption, chameleon hash calculation, secret sharing calculation, Simhash calculation, and homomorphic encryption. It enables ciphertext state verification, enhancing file security. During encryption / decryption and chameleon hash calculation, the random numbers in the algorithm are removed to ensure that the ciphertext of the same file is identical after encryption, and that the same chameleon hash is generated. Files are transmitted to IPFS for distributed storage; IPFS uses content hash addressing to ensure that each file corresponds to a unique storage address. Homomorphic encryption technology is used to calculate the ciphertext, ensuring data security. Attached Figure Description

[0075] Figure 1 This is a flowchart of the file encryption storage and download process of the present invention;

[0076] Figure 2 This is a diagram illustrating the file data storage and retrieval process of the present invention;

[0077] Figure 3 This is a flowchart illustrating the overall process of Simhash and Chameleon hash calculations for file data in this invention.

[0078] Figure 4 This is a flowchart of the Simhash operation performed on the file data in this invention;

[0079] Figure 5 This is a flowchart of the homomorphic encryption operation performed on the simhash value according to the present invention. Detailed Implementation

[0080] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0081] This invention relates to a method for ciphertext deduplication and storage based on homomorphic encryption and Simhash, which is implemented according to the following steps:

[0082] Step 1: The system generates its public and private keys using the RSA algorithm, and then secretly shares the private key with m holders using the Shamir algorithm; the specific process is as follows:

[0083] Step 1.1: The system runs the GenerateRsaKey function to generate the system key;

[0084] The expression for generating the system key is as follows:

[0085]

[0086] Among them, e is a randomly selected integer, where 1 < e < φ(n) and e is relatively prime to φ(n); φ(n) is the Euler's totient function of n, and n is the product of two randomly selected unequal large prime numbers p and q. Subsequently, n and e are encapsulated as the public key, and n and d are encapsulated as the private key;

[0087] Step 1.2: The private key of the system is secretly shared among m holders. The threshold of the holder with the lowest sub-key is set to k, and the system private key can be restored by obtaining k pairs of sub-keys when restoring the system private key; each of the m holders stores a pair of (x, P), where x is a randomly generated integer and P is f(x) obtained through secret sharing;

[0088] The expression for the secret sharing of the system private key s is as follows:

[0089]

[0090] Among them, the private key s is used as a constant term, and k - 1 numbers are randomly selected in the finite field from 1 to p, denoted as a1, a2,... a k-1 , which are used as the coefficients of the k - 1 polynomial f(x). There are a total of m terms, and the m holders are denoted as P1, P2,... P n , and the sub-key shared is f(i).

[0091] The private key s is split using the Shamir algorithm and multiple users are allowed to jointly manage it. When the private key s is needed, sub-keys need to be obtained from t - 1 users, and the private key can be restored by reconstructing the t - 1 sub-keys obtained and the self-owned sub-key using the Shamir algorithm, which ensures the risk caused by the leakage of the private key.

[0092] Step 2: Delete the random number in the RSA algorithm as the improved RSA algorithm, and upload the text to the system. The system encrypts the text using the improved RSA algorithm to obtain the ciphertext; the specific process is as follows:

[0093] Encrypt the file w using the system public key (n, e) obtained in Step 1. Delete the random number in the RSA algorithm as the improved RSA algorithm. The specific expression for encrypting the file w is as follows:

[0094]

[0095] Among them, w is the uploaded file, c is the ciphertext after encrypting the file, and (n, e) is the system public key obtained in Step 1. The file is encrypted using the system public key.

[0096] The improved RSA algorithm used in the present invention does not set a random number, which can ensure that each file is the same and the encrypted ciphertext is also the same. This is convenient for the verification function in Step 4. Therefore, the main function of Step 2 is to encrypt the file.

[0097] Step 3: Perform a chameleon hash on the ciphertext and the system's public and private keys together to generate a chameleon hash. Upload the ciphertext and the chameleon hash to IPFS. The specific process is as follows:

[0098] Step 3.1: Perform a chameleon hash calculation on the ciphertext c calculated in step 2 together with the system public key and private key generated in step 1 to obtain a chameleon hash hash1;

[0099] The specific expression for the chameleon hash is:

[0100]

[0101] Where c is the encrypted ciphertext of the file, g is the group generator, and n is the system public key;

[0102] Step 3.2: Upload the ciphertext c and hash1 to IPFS for distributed storage;

[0103] Step 3.3: IPFS returns an address hash for users to query files. IPFS uses content addressing; the content determines the address. Based on the one-wayness and collision resistance of hashing, files with different content have different IPFS storage addresses. The mechanism involves taking a file and then hashing it in an encrypted way. This yields a very small and secure representation of the file, ensuring that someone cannot simply take another file with the same hash value and use it as an address.

[0104] The ciphertext and the system's public and private keys are hashed together using a chameleon hash. This facilitates verification of the ciphertext's correctness in step 4 and prevents tampering during storage, thus improving ciphertext security. It's stored in IPFS because if the stored content remains unchanged, the address hash returned by IPFS will always be the same.

[0105] Step 4: Based on the address returned by IPFS, find the ciphertext and the chameleon hash. Perform a chameleon hash operation on the ciphertext to verify its correctness. The specific process is as follows: Figure 1 As shown; the specific process is as follows:

[0106] The user obtains the ciphertext c and chameleon hash hash1 based on the address hash. The ciphertext c is then recalculated to obtain chameleon hash hash2. The chameleon hash verification function is used to check whether hash1 and hash2 are equal. If they are equal, step 5 is executed.

[0107] The chameleon hash verification function expression is as follows:

[0108]

[0109] Here, 0 means that hash1 and hash2 are equal, that is, the ciphertext c has not been modified by the attacker.

[0110] The chameleon hash operation performed on the ciphertext obtained from IPFS is to verify whether the ciphertext has been tampered with by an attacker.

[0111] Step 5: Decrypt the ciphertext using RSA to obtain the original file; the specific process is as follows:

[0112] The system private key is recovered by secretly sharing the threshold gate k pair (x,P) and decrypting the ciphertext c to obtain the original file. (x,P) is the subkey pair obtained by the m holders in step 1.

[0113] The specific expression for the shared recovery system private key is as follows:

[0114] (a) When x=0, f(0)=s, the system private key s can be recovered;

[0115] (b) Substituting k groups (xi,pi) into the following formula will recover the system private key s;

[0116]

[0117] The specific expression for decrypting ciphertext c is:

[0118]

[0119] Where c is the ciphertext of the encrypted file, w is the plaintext after decryption, and (n,d) is the system private key.

[0120] Once the original file is obtained, it will be easier for users to search for it. The process is as follows: Figure 2 As shown.

[0121] This step decrypts the ciphertext to obtain the original file, which the user can view when downloading it.

[0122] Step 6, as follows Figure 3 , Figure 4 As shown, the Simhash signature fingerprint is obtained by performing a Simhash operation on the text; the specific process consists of 5 steps: word segmentation, hashing, weighting, merging, and dimensionality reduction, namely:

[0123] Step 6.1: Segment the text into words. The Porter extraction algorithm is used to extract the stems of the words. The extracted stems are organized into a feature set, namely vector V. Each feature is assigned a weight according to the frequency of each word.

[0124] Step 6.2: Initialize a 64-dimensional vector V to 0; initialize a 64-bit binary number S to 0; for each feature: generate a 64-bit signature b for this feature using a traditional hash algorithm.

[0125] Step 6.3: After obtaining the signature b, for i = 1, ···, 64: if the i-th bit of b is 1, then add the weight of this feature to the i-th element of V; otherwise, subtract the weight of this feature from the i-th element of V.

[0126] Step 6.4: Accumulate the weighted result code elements of the above feature vectors to obtain a new sequence string V'.

[0127] Step 6.5: If the i-th element of the new sequence string V' is greater than 0, then the i-th bit of S is 1, otherwise it is 0, and set each bit to decimal; output S as the signature, that is, the simhash signature value fingerprint obtained by performing Simhash calculation on the text.

[0128] The text is calculated using the simhash algorithm because simhash can be applied to duplicate checking, while other hashes do not have this function.

[0129] Step 7: As Figure 5 shown, perform homomorphic encryption calculation on the fingerprint to obtain the ciphertext ensimhash and store it.

[0130] Homomorphic encryption refers to an encryption algorithm that satisfies the property of homomorphic operation on ciphertexts, that is, after data is encrypted by homomorphic encryption, a specific calculation is performed on the ciphertext, and the plaintext obtained after performing the corresponding homomorphic decryption on the calculation result of the ciphertext is equivalent to directly performing the same calculation on the plaintext data, realizing the computability and invisibility of data.

[0131] The homomorphic encryption calculation uses the Paillier algorithm, and the specific expression is:

[0132] Ciphertext

[0133] where the public key is (n, g), m is the simhash signature, satisfying m < n, r is a random number, satisfying 0 < r < n.

[0134] The homomorphic encryption algorithm is used to encrypt the simhash signature value before storing it, so as to ensure that the simhash signature value is stored in ciphertext and is not easily leaked.

[0135] Step 8: Perform homomorphic addition calculation on the ciphertext ensimhash to obtain the ciphertext addition enaddsimhash.

[0136] The specific expression of homomorphic addition is as follows:

[0137] Ciphertext addition

[0138] Where c1 and c2 are respectively ciphertext ensimhashes, that is:

[0139] , .

[0140] This step uses homomorphic addition operation because the operation needs to be performed in the ciphertext state, which can ensure that the text is not leaked and can be operated. And the result is the same as that of the operation without encryption.

[0141] Step 9: Calculate the Hamming distance of the ciphertext addition enaddsimhash to obtain an integer t, and calculate the similarity of t; the specific process is as follows:

[0142] Step 9.1: Perform homomorphic decryption on the ciphertext addition enaddsimhash, and the specific expression is:

[0143] Plaintext

[0144] Where c is the ciphertext addition enaddsimhash, , define the function L(x)=(x - 1) / n, and calculate the modular inverse element ;

[0145] Step 9.2: Calculate the Hamming distance of the decrypted content to obtain an integer t;

[0146] Among them, the Hamming distance is defined as the number of 1s in the elements of the plaintext m, that is, the integer t, and the specific calculation expression is:

[0147] When the integer t is less than or equal to 3, it is determined to be similar, and the similarity is 30%;

[0148] The specific expression for similarity calculation is:

[0149] When t < 1, the similarity is 100%;

[0150] When 1 ≤ t ≤ 3, the similarity ;

[0151] When 3 < t ≤ 64, the similarity .

[0152] This step decrypts the calculation result of step 8 and then calculates the similarity, which can determine whether the text is similar to the text in the database.

[0153] The working principle of the ciphertext deduplication and storage method based on homomorphic encryption and Simhash in this invention is as follows:

[0154] This invention includes RSA data encryption / decryption, chameleon hash calculation, secret sharing calculation, simhash calculation, and homomorphic encryption methods. It enables file verification without decrypting the ciphertext, enhancing file security. During encryption / decryption and chameleon hash calculation, the random numbers in the algorithm are removed to ensure that the decrypted ciphertext and generated chameleon hash of the same file are identical. Files are transferred to IPFS for distributed storage; IPFS addresses by content, ensuring that no one can simply retrieve another file with the same hash value and use it as an address. Homomorphic encryption is used to perform specific calculations on the data; the result of the calculation on the ciphertext, after homomorphic decryption, is equivalent to performing the same calculation directly on the plaintext data, achieving the computable but invisible property of data and ensuring data security.

[0155] The present invention provides a method for ciphertext deduplication and storage based on homomorphic encryption and Simhash. The steps are as follows: The data owner uploads a file to the system; the system encrypts the file using the data owner's public key to obtain ciphertext; the system distributes its private key to other administrators; the system performs a chameleon hash calculation on the ciphertext and the system's public and private keys to obtain a chameleon hash value; the ciphertext and hash value are uploaded to IPFS for distributed storage; the system retrieves the hash value and ciphertext from IPFS and verifies the hash; if verification is successful, the system decrypts the ciphertext using the data owner's private key; the file is subjected to Simhash calculation to generate a Simhash value (fingerprint); the Simhash value (fingerprint) is homomorphically encrypted and stored; the encrypted Simhash value is homomorphically added, and then homomorphically decrypted; after obtaining the decrypted value, the Hamming distance is calculated and then converted to a percentage. This invention can determine the user's permission without decrypting the ciphertext, significantly improving storage efficiency while ensuring security.

Claims

1. A method for duplicate detection and storage based on homomorphic encryption and Simhash, characterized in that, The specific implementation is as follows: Step 1, the system generates the public key and private key of the system according to the RSA algorithm, and shares the private key of the system with m holders through the shamir algorithm; Step 2, delete the random number in the RSA algorithm as an improved RSA algorithm, upload the text to the system, and encrypt the text with the improved RSA algorithm to obtain the ciphertext; Step 3, the chameleon hash of the ciphertext and the system public and private key is calculated to generate the chameleon hash Hash, and the ciphertext and the chameleon hash Hash are uploaded to the IPFS; Step 4, find the ciphertext and the chameleon hash Hash according to the address returned by the IPFS, and do the chameleon hash operation on the ciphertext to verify the correctness of the ciphertext; Step 5, the ciphertext is decrypted by RSA to obtain the original file; Step 6, the Simhash operation is performed on the text to obtain the simhash signature fingerprint; Step 7, the homomorphic encryption calculation is performed on the fingerprint to obtain the ciphertext enSimhash and store it; Step 8, the homomorphic addition calculation is performed on the ciphertext enSimhash to obtain the ciphertext addition enaddsimhash; Step 9, the Hamming distance calculation is performed on the ciphertext addition enaddsimhash to obtain the integer t, and the similarity calculation is performed on t; The specific process of step 3 is as follows: Step 3.1, the ciphertext c calculated in step 2 and the system public key and private key generated in step 1 are used to calculate the chameleon hash to obtain a chameleon hash hash1; The specific expression of the chameleon hash is as follows: Wherein, c is the ciphertext of the encrypted file, g is the group generator, and n is the system public key; Step 3.2, upload the ciphertext c and the hash hash1 to the IPFS for distributed storage; Step 3.3, IPFS will return an address hash for user to query file, IPFS is using content addressing, content determines address, according to the one-way and anti-collision of hash, makes different content of file, its IPFS storage address is different; The specific process of step 6 is as follows: Step 6.1, the text is segmented, the Porter extraction algorithm is used to extract the stem of the word, the extracted stem is arranged into a feature set, that is, a vector V, and each feature is assigned a weight according to the number of times each word appears; Step 6.2, initialize a 64-dimensional vector V to 0; initialize a 64-bit binary number S to 0; for each feature: use the traditional hash algorithm to generate a 64-bit signature b for the feature; Step 6.3, after obtaining the signature b, i=1,···,64: if the i-th bit of b is 1, then the i-th element of V is added to the weight of the feature; Otherwise, the i-th element of V is subtracted from the weight of the feature; Step 6.4, accumulate the weighted result code elements of each feature vector to obtain a new sequence string V'; Step 6.5, if the i-th element of the new sequence string V' is greater than 0, the i-th bit of S is 1, otherwise 0, and set the number of each bit to decimal; output S as the signature, that is, the simhash signature value fingerprint obtained by simhash calculation on the text.

2. The method of claim 1, wherein, Step 1 detailed process is: Step 1.1, the system runs the GenerateRsaKey function to generate the system key; The expression for generating the system key is as follows: Where e is a randomly selected integer, e satisfies 1<e<φ(n) and e is coprime with φ(n); φ(n) is the Euler function of n, n is the product of two unequal large prime numbers p and q, and then n and e are packaged into the public key, and n and d are packaged into the private key; Step 1.2, the system's private key is secretly shared to m holders, and the threshold of the lowest sub-key holder is set to k; the m holders store a (x, P) pair respectively, x is a randomly generated integer, and P is the f(x) obtained by secret sharing; The expression for secret sharing of the system private key s is as follows: Wherein, the private key s as a constant term, in the finite field of 1 to p, randomly take k-1 number, recorded as a1, a2, … a k-1 , as the coefficient of k-1 polynomial f(x), m items, m holders, recorded as P1, P2, … P n , the sub-key shared to f(i).

3. The method of claim 2, wherein, Step 2 detailed process is: The system public key (n, e) obtained by step 1 is used to encrypt the file w, and the random number in RSA algorithm is deleted as an improved RSA algorithm, and the specific expression for encrypting the file w is as follows: Where w is the uploaded file, c is the ciphertext after encrypting the file, and (n, e) is the system public key obtained in step 1, which is used to encrypt the file with the system public key.

4. The method of claim 3, wherein, Step 4 detailed process is: The user obtains the ciphertext c and chameleon hash hash1 according to the address hash, calculates the chameleon hash of the ciphertext c, obtains the chameleon hash hash2, and calculates whether hash1 and hash2 are equal through the chameleon hash verification function; if they are equal, step 5 is executed; The expression of chameleon hash verification function is as follows: Where 0 represents that hash1 and hash2 are equal, that is, the ciphertext c has not been modified by the attacker.

5. The method of claim 1, wherein, Step 5 detailed process is: The threshold k is obtained through secret sharing to recover the system private key, and the original file is obtained by decrypting the ciphertext c, (x, P) is the sub-key pair obtained by the m holders in step 1; The specific expression for sharing and recovering the system private key is as follows: (a) when x=0, f(0)=s, the system private key s can be recovered; (b) the k groups (xi, pi) are brought into the following formula to recover the system private key s; The specific expression for decrypting the ciphertext c is as follows: Where c is the ciphertext of the file, w is the plaintext after decryption of the ciphertext, and (n, d) is the system private key.

6. The method of claim 1, wherein, The homomorphic encryption calculation in step 7 uses Paillier algorithm, and the specific expression is as follows: Ciphertext Where the public key is (n, g), m is the simhash signature, and r is a random number satisfying 0<r<n.

7. The method of claim 1, wherein, The specific expression of homomorphic addition in step 8 is as follows: Ciphertext addition Where c1 and c2 are ciphertexts ensimhash, that is: , 。 8. The method of claim 1, wherein, Step 9 detailed process is: Step 9.1, homomorphic decryption of the ciphertext enaddsimhash, the specific expression is: plaintext wherein c is a ciphertext addition enaddsimhash, , define a function L(x) = (x - 1) / n, and calculate the modular inverse element ; Step 9.2, Hamming distance calculation on the decrypted content, to get an integer t; Wherein, the Hamming distance is defined as the number of 1 in the elements of plaintext m, that is, the integer t, the calculation specific expression is: Similarity calculation specific expression is: When t<1, the similarity is 100%. When 1≤t≤3, the similarity ; When 3 < t ≤ 64, the similarity .

Citation Information

Patent Citations

  • Method for locking, encrypting and de-emphasizing similar data messages in cloud environment and cloud storage system

    CN108400970A

  • Attribute encryption access control method and system for Internet of Things and storage medium

    CN112565223A