A personal bill privacy protection record screening and amount statistics method
Personal bill data is homomorphically encrypted through the Paillier encryption system, and homomorphic operations are performed by a trusted third party, which solves the problem of the inability to implement ciphertext range proof in existing technologies, realizes the privacy protection and amount statistics of personal bills, and improves data security.
Patent Information
- Application Number
- CN202411605994.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-11
AI Technical Summary
In the existing technology, the privacy protection algorithm for personal bills cannot implement range proof operations on ciphertext when screening records, and the symmetric encryption algorithm limits the possibility of direct calculation of ciphertext, weakening the effectiveness of privacy protection.
The Paillier encryption system is used to homomorphically encrypt the amount, time and description data in personal bills, and homomorphic operations are performed through a trusted third party. It supports the screening of amount ranges, time ranges and descriptive keywords, and realizes the range proof and amount statistics of ciphertext data.
It realizes the encrypted storage and query of personal billing data, supports filtering based on amount range, time range and descriptive keywords, improves the privacy protection level of users' personal billing data, and ensures that the server only has access to encrypted data.
Smart Images

Figure CN119484089B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of privacy protection and relates to a method for screening privacy protection records of personal bills and for calculating the amount of the personal bills. Background Art
[0002] Amidst the rapid development of information technology, key technologies such as big data, intelligent computing, cloud computing, and mobile internet are driving social progress and industrial upgrading. Against this backdrop, a large number of applications and platforms have emerged, leading to a massive increase in personal and corporate data. While this trend has greatly enriched the digital ecosystem, it has also significantly increased the potential threat of data privacy leaks.
[0003] Homomorphic encryption is a prominent example of functional encryption algorithms. It allows computations that would normally be performed on plaintext to be performed directly on encrypted data without decrypting the data. It is also a core technology for enabling privacy-preserving computing. This means that data owners can authorize third parties to perform data analysis and computations without revealing the original data content. This feature not only ensures data security but also greatly facilitates data circulation and value mining, making it particularly suitable for use cases such as personal billing. Data such as the amount, time, and description in a user's personal bill can be considered private and uploaded to a server after homomorphic encryption. Users can submit queries for fields such as amount ranges, time ranges, and descriptions, or perform amount statistics based on time ranges. The server then performs homomorphic operations on the ciphertext and returns the results to the user for decryption. Throughout the entire process, the server only accesses the ciphertext data, maximizing user privacy. In the field of personal data encryption and privacy protection, the most mature approach today is to use symmetric encryption algorithms such as AES for efficient encryption of personal data. However, symmetric encryption requires a high degree of randomness in the ciphertext, which limits the possibility of direct computation on the ciphertext. Consequently, computations on the data are still performed through decryption followed by computation, which somewhat weakens privacy protection. In recent years, homomorphic encryption technology has gained popularity due to its support for ciphertext segment operations. However, due to the limitations of cryptographic algorithms, designing corresponding homomorphic versions for the many specific operations in specific application scenarios remains a topic worthy of further research. Personal bills are a type of important personal data that is closely related to everyone and are also important data for scenarios requiring privacy protection. Summary of the Invention
[0004] In order to solve the above technical problems existing in the prior art, the present invention proposes a method for screening and calculating the amount of personal bill privacy protection records. The specific technical solution is as follows:
[0005] A method for screening and calculating the amount of personal bill privacy protection records includes the following steps:
[0006] Step 1: Records of personal bills incurred by users, each record R i Including bill amount A i 、Income and expenditure category C i , bill description string D i , and the occurrence time T i ;
[0007] Step 2: The user uses the Paillier encryption system to reconcile the statement amount A i , Occurrence time T i , and the bill description string D i Perform homomorphic encryption;
[0008] Step 3: The user uploads all homomorphically encrypted ciphertext data, the public key, and auxiliary information to the bill management server and shares the private key with a trusted third party.
[0009] Step 4: The user begins filtering bill records. The filtering criteria include the keyword string K in the bill description, the bill amount range [AL, AU], and the record occurrence time range [TL, TU]. These three filtering criteria can be connected by AND or OR.
[0010] Step 5: The user homomorphically encrypts the filtering conditions and uploads the encrypted filtering conditions along with the length of the description string to the server;
[0011] Step 6: The server performs homomorphic operations on the total conditions according to the screening conditions and sends the results to the trusted third party;
[0012] Step 7: The trusted third party performs homomorphic decryption on the calculation results to obtain the records that meet the conditions and returns the index of the matching records to the server;
[0013] Step 8: The server returns the corresponding ciphertext record to the user based on the index of the hit record. The user decrypts the plaintext in the same way to complete the record screening.
[0014] Step 9: The user starts bill statistics by entering the income and expenditure categories (SC) to be counted and the bill occurrence time range (STL, STU). The user then encrypts the time range and uploads the encrypted time range and the income and expenditure categories (SC) to the server.
[0015] Step 10: The server performs a homomorphic operation on the bill amount of each record by interacting with the trusted third party and returns the operation result RES2 to the user;
[0016] Step 11: The user performs homomorphic decryption on the calculation result RES2 to calculate the total amount and complete the amount statistics.
[0017] Furthermore, the step 2 specifically includes:
[0018] Step 2.1: The user generates a key pair (pk, sk) by using the Paillier encryption system, where pk represents the public key and sk represents the private key.
[0019] Step 2.2: Set the bill amount data A i Expand 100 times to get a non-negative integer sa i , the user then encrypts the non-negative integer sa with the public key pk i , get the ciphertext E(sa i ), which is the encrypted amount of the bill;
[0020] Step 2.3: Time T will occur i Convert to timestamp ts i , the user then encrypts the timestamp ts with the public key pk i , get the ciphertext E(ts i );
[0021] Step 2.4: In the bill description string D i Fill the right side with empty characters until the upper limit of characters is l, and then encode it into a positive integer d i , the user then encrypts the positive integer d with the public key pk i , get the ciphertext E(d i ).
[0022] Furthermore, in step 3, all encrypted ciphertext data include: E(sa i ),E(ts i ),E(d i ), the auxiliary information includes: income and expenditure category C i , the length of the string of bill description len(D i ).
[0023] Furthermore, the step 5 specifically includes:
[0024] Step 5.1: For the bill amount range [AL,AU], expand its upper and lower bounds by 100 times to obtain the corresponding non-negative integers sal and sau. Then use the public key pk to encrypt the expanded upper and lower bounds of the amount to obtain the corresponding ciphertext (E(sal), E(sau)).
[0025] For the keyword string K in the bill description, encode it into a non-negative integer d and encrypt it using the public key pk to form the ciphertext E(d);
[0026] For the record occurrence time interval [TL, TU], first convert its upper and lower bounds into corresponding timestamps (tsl, tsu), and then use the public key pk to encrypt the upper and lower bounds of the timestamp respectively to obtain the corresponding ciphertext (E(tsl), E(tsu));
[0027] Step 5.2: The user concatenates the three ciphertexts of the screening criteria (E(sal), E(sau)), E(d), and (E(tsl), E(tsu)) according to the AND / OR conditions entered, and then uploads them to the bill server BS along with the bill description string length. The concatenation expression is:
[0028] FC i =((E(sal),E(sau)),conj,E(d),conj,(E(tsl),E(tsu))),
[0029] The conjunction conj="AND" or conj="OR".
[0030] Furthermore, the step 6 specifically includes:
[0031] Step 6.1: Based on the corresponding ciphertext E(sal) and E(sau) of the screening amount range, for the encrypted amount E(sa i ), respectively execute E(sal) and E(sa i ), E(sau) and E(sa i ) of the Paillier subtraction homomorphic operation, and the results are recorded as α i and β i ;
[0032] According to the ciphertext E(d) of the filtered bill description, for each encrypted bill description E(d i ), and j=0,…,l-len(K), execute E(d<<j) and E(d i ) and then integrated into the vector γ i =(γ i (0) ,…,γ i (l-len(K)) );
[0033] According to the corresponding ciphertext E(tsl) and E(tsu) of the time interval of the screening, the encryption time E(ts i ), respectively execute E(tsl) and E(ts i ), E(tsu) and E(ts i ) is a subtraction homomorphic operation, and the results are recorded as δ i With ε i;
[0034] Step 6.2: The server combines the operation results according to the AND / OR connection word submitted by the user, and each operation result expression is:
[0035] FR i = ((α i , β i ), conj, γ i , conj, (δ i , ε i )).
[0036] and sends all operation results FR i to the trusted third party.
[0037] Further, the step 7 specifically includes:
[0038] Step 7.1: The trusted third party performs homomorphic decryption on each operation result FR i using the private key sk to obtain the result:
[0039] D(FR i ) = ((D(α i ), D(β i )), conj, D(γ i ), conj, (D(δ i ), D(ε i ))) ;
[0040] If D(α i ) < 0 and D(β i ) > 0, then this index i is counted into the amount screening hit index set AI;
[0041] If the decoding result of each component of the vector D(γ i ) has a character-by-character Hamming weight of no more than len(D i ) - len(K), then this index i is counted into the bill description screening hit index set DI;
[0042] If D(δ i ) < 0 and D(ε i ) > 0, then this index i is counted into the time screening hit index set TI;
[0043] Step 7.2: The trusted third party calculates the intersection or union of the three hit index sets AI, DI, and TI according to the connection word conj = "AND" or conj = "OR", forms a result index set I, and sends it back to the server.
[0044] Further, the step 8 specifically includes:
[0045] Step 8.1: The server BS records the corresponding ciphertext bill according to the index set I returned by the trusted third party, forms the result RES1, and sends it to the user;
[0046] Step 8.2: After receiving the result RES1, the user uses the private key sk to decrypt the E(sa i )、E(ts i )、E(d i ), and get the expanded amount sa i , timestamp ts i , integer d i , and then sa i Reduce it by 100 times to get the real amount a i , and the timestamp ts i Convert to actual time, the integer d i Use decoding and remove the null character on the right to get D i , complete the record screening.
[0047] Furthermore, the step 9 specifically includes:
[0048] Step 9.1: The user enters the income and expenditure category SC and the bill occurrence time range [STL, STU] to be counted;
[0049] Step 9.2: The user converts the upper and lower bounds of the time range [STL, STU] into timestamps tssl and tssu, respectively, encrypts the upper and lower bounds of the timestamps with the public key pk, and obtains the corresponding ciphertext (E(tssl), E(tssu)). The user submits the ciphertext of the time range and the income and expenditure category SC to the server BS.
[0050] Furthermore, the step 10 specifically includes:
[0051] Step 10.1: The server timestamps the ciphertext E(tssl) and E(tssu) in each ciphertext bill according to the corresponding ciphertext E(tssl) and E(tssu) of the statistical time. i ), respectively execute E(tssl) and E(ts i ), E(tssu) and E(ts i ) of the Paillier subtraction homomorphic operation, and the results are recorded as λ i With μ i and send the result of this operation to a trusted third party;
[0052] Step 10.2: The trusted third party uses the private key sk to i With μ i Perform decryption, if D(λ i )<0 and D(μ i)>0, then this indicator i is counted into the hit index set TI, and finally TI is returned to the server;
[0053] Step 10.3: Based on the hit index TI and the income and expenditure category SC submitted by the user, the server performs an addition homomorphic operation on the encrypted amount in each ciphertext bill record that matches the income and expenditure category and the hit index, and returns the operation result RES2 to the user.
[0054] Furthermore, the step 11 is specifically as follows: the user performs homomorphic decryption on the result RES2 to obtain the total amount, then reduces it by 100 times, completes the amount statistics and combines them into the final query result.
[0055] The present invention has the following advantages:
[0056] Supports encrypted and protected storage of sensitive data such as the amount, description, and time of each record in personal bills.
[0057] Supports filtering of bill records based on amount range, time range, and bill description keywords, and supports AND or OR connections of three filtering conditions.
[0058] Supports ciphertext amount statistics for bill records based on income and expenditure categories and time intervals.
[0059] This paper explores the ciphertext characteristics of homomorphic encryption and studies the range proof technology of ciphertext data, thereby solving the problem that the existing personal bill privacy protection algorithm cannot implement the range proof operation of ciphertext when screening records. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flow chart of a method for screening and calculating the amount of personal bill privacy protection records of the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and technical effect of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0062] The present invention discloses a method for screening and counting the privacy protection records of personal bills. The user can homomorphically encrypt the data involved in the personal bill, including the bill amount, income and expenditure category, bill description, and occurrence time, and upload it to the server; the user then inputs three conditions: the keywords of the bill description, the interval of the bill amount, and the occurrence time range. The server performs a combination of several homomorphic operations on the ciphertext data based on the AND / OR combination of the three conditions, and returns the results to the user, who decrypts and restores the query results; finally, the user inputs the required income and expenditure category and the occurrence time range, the server performs homomorphic operations, and returns the operation results to the user, who performs homomorphic decryption, calculates the total amount, completes the amount statistics and combines them into the final query result. Specifically, if Figure 1 As shown, the following steps are included:
[0063] Step 1: Records of personal bills incurred by users, each record R i Including bill amount A i 、Income and expenditure category C i , Bill Description D i , and the occurrence time T i ;
[0064] Step 2: The user uses the Paillier encryption system to reconcile the statement amount A i , Occurrence time T i , and the string data D describing the bill i Perform homomorphic encryption;
[0065] Step 3: The user uploads all homomorphically encrypted ciphertext data, the public key, and auxiliary information to the bill management server and shares the private key with a trusted third party.
[0066] Step 4: The user begins filtering bill records. The filtering criteria include the keyword string K in the bill description, the bill amount range [AL, AU], and the record occurrence time range [TL, TU]. These three filtering criteria can be connected by AND or OR.
[0067] Step 5: The user homomorphically encrypts the filtering conditions and uploads the encrypted filtering conditions along with the length of the description string to the server;
[0068] Step 6: The server performs homomorphic operations on the total conditions according to the screening conditions and sends the results to the trusted third party;
[0069] Step 7: The trusted third party performs homomorphic decryption on the calculation results to obtain the records that meet the conditions and returns the index of the matching records to the server;
[0070] Step 8: The server returns the corresponding ciphertext record to the user based on the index of the hit record. The user decrypts the plaintext in the same way to complete the record screening.
[0071] Step 9: The user starts bill statistics by entering the income and expenditure categories (SC) to be counted and the bill occurrence time range (STL, STU). The user then encrypts the time range and uploads the encrypted time range and the income and expenditure categories (SC) to the server.
[0072] Step 10: The server performs a homomorphic operation on the bill amount of each record by interacting with the trusted third party and returns the operation result RES2 to the user;
[0073] Step 11: The user performs homomorphic decryption on the calculation result RES2 to calculate the total amount and complete the amount statistics.
[0074] In the following specific implementation examples of the present invention for user bill screening and amount statistics, the method described above is only used for the case where the modulus n = p * q in Paillier encryption is 128 bits. In actual operation, a security parameter of n of at least 1024 bits should be used. The details are as follows:
[0075] (1) Paillier encryption parameter settings:
[0076] p=12153769557201040739,
[0077] q=11720984366135379773,
[0078] pk:N=p*q=142454142969565515784496273884609572247,
[0079] sk:λ=(p-1)*(q-1)=142454142969565515760621519961273151736,
[0080] μ=λ -1 mod N=138764946862713715597479501644265181870.
[0081] (2) Assume that the user generates a total of 10 bill data in September 2024, as shown in Table 1:
[0082] Table 1 Original bill data
[0083] Bill Number Billing time Bill amount Bill Description Income and expenditure categories 0 2024-09-01 16:05:58 431.55 E-commerce Expense 1 2024-09-05 19:06:19 198 Train Ticket Expense 2 2024-09-07 15:19:15 22.69 Utility Bills Expense 3 2024-09-10 06:24:25 53.59 E-commerce Expense 4 2024-09-12 04:58:37 582.31 Flight Ticket Expense 5 2024-09-13 13:09:07 100 Phone Recharge Expense 6 2024-09-16 15:21:11 1174.95 Flight Ticket Expense 7 2024-09-20 16:04:33 6901.72 Salary Income 8 2024-09-26 13:52:18 24.62 Utility Bills Expense 9 2024-09-29 06:49:21 861.08 Labor Fee Income
[0084] (3) The user first processes the three columns of private data: time, amount, and description, and encrypts them using the public key pk. The encrypted results are shown in Table 2:
[0085] Table 2 Bill encryption column data
[0086]
[0087]
[0088] Then, the user uploads all the above encrypted data, the public key held, and auxiliary information: income and expenditure categories, and the length of the description string to the server.
[0089] (4) The user needs to filter bill records that occurred between September 10 and September 20 and whose bill description contains "Ticket", which is the AND connection of the occurrence time and the bill description. The specific expression is as follows:
[0090] [TL,TU]=[2024 / 09 / 10 00:00:00,2024 / 09 / 20 23:59:59]AND D='Ticket'.
[0091] (5) The user processes the screening conditions, including:
[0092] First, convert the occurrence time [TL, TU] into a timestamp (tsl, tsu) = (1725897600, 1726847999), and homomorphically encrypt it into ciphertext (E(tsl), E(tsu)) as follows:
[0093] (10158395881406777149774239903382210838560302277666039258515014283884972671858,
[0094] 19997655163751078721757901974142906317158721676128140493695034395126194931910).
[0095] Then encode the keyword string K in the bill description into a large integer d = 92811616281972 and homomorphically encrypt it into ciphertext:
[0096] E(d)
[0097] =14027678541534099900420143243633916620682248209229288295104184320873847320076.
[0098] Finally, upload the above encrypted data to the server.
[0099] (6) The server uses the ciphertext E(d) of the bill description to calculate the encrypted description E(d) in each ciphertext bill. i ), and j=0,…,9, execute E(d<<j) and E(d i ) is homomorphic to the subtraction operation, so each component is calculated accordingly Reintegrate into vector γ i =(γ i (0) ,…,γ i (9) ). All γ i (j) The values are shown in Table 3:
[0100] Table 3 All γ i (j) Distribution of values
[0101]
[0102]
[0103] Then, according to the corresponding ciphertext E(tsl) and E(tsu) of the screening time interval, the encryption time E(ts i ), respectively execute E(tsl) and E(ts i ), E(tsu) and E(ts i ) is a subtraction homomorphic operation, then each result δ i With ε i The vectors are:
[0104] δ=
[0105] [13463170233930527470563281441865029531766551120939264945410135609626988869302,11499713527326509401381467682673531206819467045351199628526335396238420151922,32438485985225249508493681208737272745 96388758897372368324491342519248755373,9892716805280476207220392543541127122020138503430168742113457253887303427507,13108602504211291257088820480352906541974968366795144078347950824784723879545,1 8164916637122949809881843078406766360217137852805280037735585304538343776129,14589908209245321461961252159147176337642873358934309187746513272354286112881,1404074241005464486928032703865838199311 1597270671890716371177042686049885032, 2800770334402974074309719382159764613039545092644394495650071920198287193616, 11057163255354598373888086034321436774730567398454290137918003984682461957728], ε=
[0106] [6939504159223785462118942708652290845200968137905754548796473760151702216591,4632166797439119629296464650031124398907630118797650364888128003880251800352,73237750540804700519743254333259679135 68217878715650882496115019487727941081,19694631212149610412795789785939740723890199813612842431401485982455911878791,2570589168823106105111396393593873132015030956662332438322347006075926891403, 7989445568309486685245950021321958988306940894079944584686488891621797398018,9348494759585828045133591100626914930561843621779028734474898110026302498619,108719132693293907497059651139663779299 98653360055387903574728253255075426091,5453030980178039011463709199674526728073980294815054540635696394553190861030,5435292252715467667745922303607589995850368053423424901778179722090123839039].
[0107] The server gets each operation result represented as FR i =(γ i ,AND,(δ i ,ε i )) and sends it to a trusted third party.
[0108] (7) The trusted third party uses the private key to perform homomorphic decryption on the received result.
[0109] First, we get the decrypted result vector D(γ i), and then decode it. For example, the record in which the bill is described as 'Train Ticket', the corresponding decryption result D(γ1 ) The result after vector decoding is as follows:
[0110] ['Train Tic\x16\xfc\x10\x94\x9a\x8c',
[0111] 'Train Ti\x0f\x02\x02\x08\x9a\x8c\x00',
[0112] 'Train T\x14\xfa\x07\xfa\x0e\x8c\x00\x00',
[0113] 'Train\x00\x00\x00\x00\x00\x00\x00\x00\x00',
[0114] 'Traim\xcb\xeb\x05\xf8\x05\xf1t\x00\x00\x00',
[0115] 'Trai\x19\xb6\xf0\xfd\xfd\xf7et\x00\x00\x00',
[0116] 'Tra\x15\x04\xbc\xe9\x03\xefket\x00\x00\x00',
[0117] 'Tr\r\x00\n\xb4\xee\xf5cket\x00\x00\x00',
[0118] 'T\x1d\xf8\x06\x02\xba\xe0icket\x00\x00\x00',
[0119] '\x00\x08\xfd\xfe\x08\xacTicket\x00\x00\x00'].
[0120] Then for each component D(γ i (j) ), analyze the Hamming weight of the decoding result, that is, the number of results that are not null characters (\x00), and whether it does not exceed the upper limit of error characters len(D i)–len(K). For the 'Train Ticket' bill record with i = 1, the upper limit of the error is 12-6 = 6. In the above vector, 'Train\x00\x00\x00\x00\x00\x00\x00\x00\x00' meets the criteria, so i = 1 is added to the description hit index set DI. Similarly, the other two bill descriptions with 'FlightTicket' also meet the criteria, resulting in DI = {1, 4, 6}.
[0121] Then get each decryption result D(δ i ) and D(ε i ), the integration results are as follows:
[0122] D(δ)=[719642,363221,204045,-23065,-190717,-306547,-573671,-921873,-1432338,-1666161],
[0123] D(ε)=[1670041,1313620,1154444,927334,759682,643852,376728,28526,-481939,-715762].
[0124] From the above results, we can see that D(δ i )<0 and D(ε i )>0 are counted into the time hit index set TI, and TI={4,5,6,7,8} is obtained.
[0125] Finally, according to the conjunction AND, the intersection of the sets DI and TI is calculated to obtain the result index I = {4, 6}, which is returned to the server.
[0126] (8) The server sends the ciphertext bill record corresponding to i=4,6 to the user based on the result index I. After receiving the result RES1, the user uses the private key sk to perform decryption, and then reduces the amount by 100 times, restores the timestamp, and decodes the description. The following two bill records are obtained, as shown in Table 4, completing the record screening.
[0127] Table 4 Decrypted screening bill records
[0128]
[0129]
[0130] (9) The user needs to calculate the total amount of all expenditures incurred between September 12 and September 30, as follows:
[0131] [STL, STU] = [2024 / 09 / 12 00:00:00, 2024 / 09 / 30 23:59:59], statistical expenditure
[0132] Then the user converts [STL, STU] into corresponding timestamps (E(tssl), E(tssu)) = (1726070400, 1727711999) and homomorphically encrypts them into ciphertexts (E(tssl), E(tssu)) = (6512671613548992413802563833273908567604689898318394888018334677541208059017, 19310890201811538005727922487379357887683751373799615605582544992570056207975).
[0133] Finally, the ciphertexts are submitted to the server together with "statistical expenditure".
[0134] (10) The server performs Paillier subtraction homomorphism operation of E(tssl) and E(ts i ), E(tssu) and E(ts i ) respectively according to the corresponding ciphertexts E(tssl) and E(tssu) of the statistical time, calculates λ i and μ i of each item of ciphertext time stamp E(ts i ), and integrates them as:
[0135] λ=[3046549642287640044538328533559856966412700504063661889778748996593678293716,8757089095697488610270276704141852410879958489974872780531812595710234272876,1363694270417451701497286476581225482 4066327419294869392087561030215731387376,18731429736222016091187527632520761500667022618074391680843090295716637360244,1420655648425693271952716194964152307912591626421149122825212867440610237107 3.9656874512138061641883987304010543990017143685984478638464581298519959141829,3112988426557266679153345947378011396355592976419419131329840569320787152875,144054161126028541113924102051938232318 92411843528471667061407424042058774386,8959312357396951780695301954496209138340470610043117992094131117286374209620,15677530929068055227216879118686393425191649834053563962024491931646382890601];
[0136] μ=[15234902789116333461244695455982677925169887086552311208495137019547499395927,7140322143835225 034411145869305786518232755739808472053503772057812192327859,157265427513367202887428345363703079 84846674312639391168171584074694792914467,10480655681187212982247526950661126012241612473937526362310354615054531839335,595061663956921944798676044889031169264566820418529177771947249724761386250 8,3714527715807214844986343847073633154087309829678851218790839851136577077101,8240518179451723291384926875904695492774451167278773656746207352879532404022,19406556228357907150551723938796117020 508546848430244298981734887688972339120,9557008623347686597844483864978822461148636154420884812155867912788246975092,9086942514942974550331383714403227408682415687696922256052830519378468096654].
[0137] And send it to a trusted third party. The trusted third party uses the private key sk to i With μ i Execute decryption and perform symbol processing to obtain the result D(λ i ) and D(μ i ), the integration results are as follows:
[0138] D(λ)=[892442,536021,376845,149735,-17917,-133747,-400871,-749073,-1259538,-1493361],
[0139] D(μ)=[2534041,2177620,2018444,1791334,1623682,1507852,1240728,892526,382061,148238].
[0140] If D(λ i )<0 and D(μ i )>0, then the indicator i is counted into the hit index set TI, and the result TI={4,5,6,7,8,9} is obtained.
[0141] The server will use the hit index TI and the income and expenditure category SC submitted by the user to match the income and expenditure category and the hit index to encrypt the amount E (sa i ) performs an addition homomorphic operation. In TI, the 4th, 5th, 6th, and 8th records belong to the expenditure category, so the encrypted amounts corresponding to these records are calculated to obtain the result:
[0142] RES2=2488559241975645618594798028961946995308086765449337272794511232330664746083,
[0143] And return the result of this operation to the user.
[0144] (11) The user decrypts the result RES2 and obtains the ciphertext 188188, which is then reduced by 100 times to complete the amount statistics. That is, the total amount of all expenditures between September 12 and September 30 is 1881.88 = 582.31 + 100 + 1174.95 + 24.62 yuan, as shown in Table 5.
[0145] Table 5 Statistics of decrypted bill record amounts
[0146] Bill Number Billing time Bill amount Bill Description Income and expenditure categories 4 2024-09-12 04:58:37 582.31 Flight Ticket Expense 5 2024-09-13 13:09:07 100 Phone Recharge Expense 6 2024-09-16 15:21:11 1174.95 Flight Ticket Expense 8 2024-09-26 13:52:18 24.62 Utility Bills Expense Sum / 1881.88 / /
[0147] In summary, the present invention overcomes the limitation of existing encryption algorithms that cannot perform interval discrimination operations by exploring the mechanism for symbol discrimination of homomorphic subtraction results in homomorphic encryption algorithms; and realizes a substring matching mechanism between keywords and strings by exploring the relationship between subtraction of string vectors and large integer representations. Not only is the user's personal bill's numerical data such as amount and time, as well as string data such as description, encrypted and stored, but the user is also supported to query the bill and conduct preliminary amount statistics based on these fields. Throughout the entire process, the server can only access the encrypted data of these private fields, which greatly improves the privacy protection level of the user's personal bill data.
[0148] The above description is only a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the implementation process of the present invention is described in detail above, it is still possible for those familiar with the art to modify the technical solutions described in the above examples or to replace some of the technical features therein with equivalents. Any modifications, equivalent replacements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A method for screening and calculating the amount of personal bill privacy protection records, characterized in that: The steps include: Step 1: Records of personal bills incurred by users, each record R i Including bill amount A i 、Income and expenditure category C i , bill description string D i , and the occurrence time T i ; Step 2: The user uses the Paillier encryption system to reconcile the statement amount A i , Occurrence time T i , and the bill description string D i Perform homomorphic encryption; Step 3: The user uploads all homomorphically encrypted ciphertext data, the public key, and auxiliary information to the bill management server and shares the private key with a trusted third party. Step 4: The user begins filtering bill records. The filtering criteria include the keyword string K in the bill description, the bill amount range [AL, AU], and the record occurrence time range [TL, TU]. These three filtering criteria can be connected by AND or OR. Step 5: The user homomorphically encrypts the filtering conditions and uploads the encrypted filtering conditions along with the length of the description string to the server; Step 6: The server performs homomorphic operations on the total conditions according to the screening conditions and sends the results to the trusted third party; Step 7: The trusted third party performs homomorphic decryption on the calculation results to obtain the records that meet the conditions and returns the index of the matching records to the server; Step 8: The server returns the corresponding ciphertext record to the user based on the index of the hit record. The user decrypts the plaintext in the same way to complete the record screening. Step 9: The user starts bill statistics by entering the income and expenditure categories (SC) to be counted and the bill occurrence time range (STL, STU). The user then encrypts the time range and uploads the encrypted time range and the income and expenditure categories (SC) to the server. Step 10: The server performs a homomorphic operation on the bill amount of each record by interacting with the trusted third party and returns the operation result RES2 to the user; Step 11: The user performs homomorphic decryption on the calculation result RES2 to calculate the total amount and complete the amount statistics.
2. The method for screening and calculating the amount of personal bill privacy protection records according to claim 1, characterized in that: The step 2 specifically includes: Step 2.1: The user generates a key pair (pk, sk) by using the Paillier encryption system, where pk represents the public key and sk represents the private key. Step 2.2: Set the bill amount data A i Expand 100 times to get a non-negative integer sa i , the user then encrypts the non-negative integer sa with the public key pk i , get the ciphertext E(sa i ), which is the encrypted amount of the bill; Step 2.3: Time T will occur i Convert to timestamp ts i , the user then encrypts the timestamp ts with the public key pk i , get the ciphertext E(ts i ); Step 2.4: In the bill description string D i Fill the right side with empty characters until the upper limit of characters is l, and then encode it into a positive integer d i , the user then encrypts the positive integer d with the public key pk i , get the ciphertext E(d i ).
3. The method for screening and calculating the amount of personal bill privacy protection records according to claim 2, characterized in that: In step 3, all encrypted ciphertext data include: i ),E(ts i ),E(d i ), the auxiliary information includes: income and expenditure category C i , the length of the string of bill description len(D i ).
4. The method for screening and calculating the amount of personal bill privacy protection records according to claim 2, characterized in that: The step 5 specifically includes: Step 5.1: For the bill amount range [AL,AU], expand its upper and lower bounds by 100 times to obtain the corresponding non-negative integers sal and sau. Then use the public key pk to encrypt the expanded upper and lower bounds of the amount to obtain the corresponding ciphertext (E(sal), E(sau)). For the keyword string K in the bill description, encode it into a non-negative integer d and encrypt it using the public key pk to form the ciphertext E(d); For the record occurrence time interval [TL, TU], first convert its upper and lower bounds into corresponding timestamps (tsl, tsu), and then use the public key pk to encrypt the upper and lower bounds of the timestamp respectively to obtain the corresponding ciphertext (E(tsl), E(tsu)); Step 5.2: The user concatenates the three ciphertexts of the screening criteria (E(sal), E(sau)), E(d), and (E(tsl), E(tsu)) according to the AND / OR conditions entered, and then uploads them to the bill server BS along with the bill description string length. The concatenation expression is: FC i N((E(sal),E(sau)),conj,E(d),conj,(E(tsl),E(tsu))), The conjunction conj="AND" or conj="OR".
5. The method for screening and calculating the amount of personal bill privacy protection records according to claim 4, characterized in that: The step 6 specifically includes: Step 6.1: Based on the corresponding ciphertext E(sal) and E(sau) of the screening amount range, for the encrypted amount E(sa i ), respectively execute E(sal) and E(sa i ), E(sau) and E(sa i ) of the Paillier subtraction homomorphic operation, and the results are recorded as α i and β i ; According to the ciphertext E(d) of the filtered bill description, for each encrypted bill description E(d i ), and j=0,…,l-len(K), execute E(d*256 j ) and E(d i ) and then integrated into the vector γ i =(γ i (0) ,…,γ i (l-len(K)) ); According to the corresponding ciphertext E(tsl) and E(tsu) of the time interval of the screening, the encryption time E(ts i ), respectively execute E(tsl) and E(ts i ), E(tsu) and E(ts i ) is a subtraction homomorphic operation, and the results are recorded as δ i With ε i ; Step 6.2: The server combines the operation results according to the AND / OR conjunctions submitted by the user. Each operation result expression is: FR i =((a i ,b i ),conj,c i ,conj,(δ i ,he i )). And all the operation results FR i Send to a trusted third party.
6. The method for screening and calculating the amount of personal bill privacy protection records according to claim 5, characterized in that: The step 7 specifically includes: Step 7.1: The trusted third party uses the private key sk to calculate each operation result FR i Perform homomorphic decryption and get the result: D(FR i )=((D(a i ),D(β i )),conj,D(γ i ),conj,(D(δ i ),D(e i ))); If D(α i )<0 and D(β i )>0, then this indicator i is included in the amount screening hit index set AI; If the vector D(γ i ) has a character-by-character Hamming weight no greater than len(D i )-len(K), then this indicator i is included in the bill description screening hit index set DI; If D(δ i )<0 and D(ε i )>0, then this indicator i is included in the time screening hit index set TI; Step 7.2: The trusted third party calculates the intersection or union of the three hit index sets AI, DI, and TI based on the conjunction conj="AND" or conj="OR" to form a result index set I and sends it back to the server.
7. The method for screening and calculating the amount of personal bill privacy protection records according to claim 6, characterized in that: The step 8 specifically includes: Step 8.1: The server BS records the corresponding ciphertext bill based on the index set I returned by the trusted third party, forms the result RES1, and sends it to the user; Step 8.2: After receiving the result RES1, the user uses the private key sk to decrypt the E(sa i )、E(ts i )、E(d i ), and get the expanded amount sa i , timestamp ts i , integer d i , and then sa i Reduce it by 100 times to get the real amount a i , and the timestamp ts i Convert to actual time, the integer d i Use decoding and remove the null character on the right to get D i , complete the record screening.
8. The method for screening and calculating the amount of personal bill privacy protection records according to claim 2, characterized in that: The step 9 specifically includes: Step 9.1: The user enters the income and expenditure category SC and the bill occurrence time range [STL, STU] to be counted; Step 9.2: The user converts the upper and lower bounds of the time range [STL, STU] into timestamps tssl and tssu, respectively, encrypts the upper and lower bounds of the timestamps with the public key pk, and obtains the corresponding ciphertext (E(tssl), E(tssu)). The user submits the ciphertext of the time range and the income and expenditure category SC to the server BS.
9. The method for screening and calculating the amount of personal bill privacy protection records according to claim 8, characterized in that: The step 10 specifically includes: Step 10.1: The server timestamps the ciphertext E(tssl) and E(tssu) in each ciphertext bill according to the corresponding ciphertext E(tssl) and E(tssu) of the statistical time. i ), respectively execute E(tssl) and E(ts i ), E(tssu) and E(ts i ) of the Paillier subtraction homomorphic operation, and the results are recorded as λ i With μ i and send the result of this operation to a trusted third party; Step 10.2: The trusted third party uses the private key sk to i With μ i Perform decryption, if D(λ i )<0 and D(μ i )>0, then this indicator i is counted into the hit index set TI, and finally TI is returned to the server; Step 10.3: Based on the hit index TI and the income and expenditure category SC submitted by the user, the server performs an addition homomorphic operation on the encrypted amount in each ciphertext bill record that matches the income and expenditure category and the hit index, and returns the operation result RES2 to the user.
10. The method for screening and calculating the amount of personal bill privacy protection records according to claim 9, characterized in that: The step 11 is specifically as follows: the user performs homomorphic decryption on the result RES2 to obtain the total amount, then reduces it by 100 times, completes the amount statistics and combines them into the final query result.
Citation Information
Patent Citations
Paillier-based homomorphic encryption method and application system
CN112785306A
Data protection communication method, system and equipment based on semi-homomorphic encryption and medium
CN118381639A