Personal bill privacy protection record screening and amount statistics method

Through the Paillier encryption system, personal bill data is homomorphically encrypted, and the cooperation between the server and trusted third parties is used to perform homomorphic operations and decryption, solving the problem of insufficient privacy protection in the existing technology and realizing the personal bill data efficient screening and amount statistics.

CN119484089AActive Publication Date: 2025-02-18HANGZHOU DIANZI UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411605994.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-18
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

The prior art is difficult to effectively perform scope proof and specific operations of ciphertext data in the privacy protection of personal bills, resulting in insufficient privacy protection.

Method used

The Paillier encryption system is used to homomorphically encrypt personal bill data, and through the cooperation between the server and trusted third parties, homomorphic operations and decryption are performed to realize the screening of statement records and amount statistics.

Benefits of technology

It realizes efficient privacy protection for personal billing data, supports the selection of amount intervals, time intervals and description keywords, and conducts statistics on cipher text amounts in revenue and expenditure categories and time intervals, improving the privacy protection level of user data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484089A_ABST
    Figure CN119484089A_ABST
Patent Text Reader

Abstract

The invention discloses a personal bill privacy protection record screening and amount statistics method, which comprises the following steps that: a user performs homomorphic encryption on data including bill amount, income and expenditure categories, bill description, occurrence time and the like involved in a personal bill, and uploads the data to a server; the user inputs three conditions including a keyword described by a bill, an interval of bill amount and an occurrence time range, the server executes a combination of a plurality of homomorphic operations on the ciphertext data according to an AND / or combination formed by the three conditions, all results are returned to the user, and the user decrypts and recovers a query result; and finally, the user inputs a required income and expenditure category and an occurrence time range, the server executes homomorphic operation and returns an operation result to the user, and the user executes homomorphic decryption, calculates a total amount, completes amount statistics and combines the amount into a final query result. According to the invention, the server only contacts the ciphertext form of the bill data, so that the privacy protection level of the individual bill data of the user is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of privacy protection and relates to a method for screening and counting the privacy protection records of personal bills. Background Art

[0002] In the wave of rapid development in the field of information technology, key technologies such as big data, intelligence, cloud computing, and mobile Internet are driving social progress and industrial upgrading. Against this background, a large number of various applications and platforms have emerged, followed by 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 leakage.

[0003] Homomorphic encryption is an outstanding representative of functional encryption algorithms. It can perform calculations that originally need to be performed on plaintext directly on encrypted data without decrypting the data. It is also one of the core technologies for realizing privacy computing. This means that the data owner can authorize a third party to perform data analysis and calculations without revealing the original data content. This feature not only ensures data security, but also greatly promotes the circulation and value mining of data, especially for application scenarios such as personal bills. The amount, time, description and other data in the user's personal bill can be regarded as the user's personal privacy. These data can be uploaded to the server after homomorphic encryption. The user can submit queries about the amount range, time range, description and other fields, or perform amount statistics based on the time range. The server can perform homomorphic operations on the ciphertext end and return the calculation results to the user for decryption. In the entire process, the server only contacts the ciphertext data, which maximizes the protection of the user's personal privacy. In the field of personal data encryption and privacy protection, the more mature method now is to use symmetric encryption algorithms such as AES to efficiently encrypt personal data. However, symmetric encryption requires that the ciphertext be highly random, which limits the possibility of direct calculation of the ciphertext. As a result, when data needs to be calculated, it is still performed in the form of decryption before calculation, which weakens the privacy protection to a certain extent. In recent years, homomorphic encryption technology has gradually gained popularity because it supports ciphertext segment operations. However, due to the limitations of the characteristics of cryptographic algorithms, how to design corresponding homomorphic versions for many specific operations in specific application scenarios is still a topic worthy of in-depth study. Personal bills are an important type of personal data that is closely related to everyone, and are also important scenario data that require 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, and its specific technical solution is as follows:

[0005] A method for screening and counting personal bill privacy protection records includes the following steps:

[0006] Step 1: Records of personal bills incurred by the user, each record R i Including bill amount A i , Revenue 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 starts to filter bill records. The filtering conditions include the keyword string K in the bill description, the bill amount range [AL, AU], and the record occurrence time range [TL, TU]. The three filtering conditions support AND or OR connection.

[0010] Step 5: The user homomorphically encrypts the filtering conditions and uploads the encrypted filtering conditions together 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 operation results to the trusted third party;

[0012] Step 7: The trusted third party performs homomorphic decryption on the calculation result to obtain the records that meet the conditions, and returns the index of the hit record to the server;

[0013] Step 8: The server returns the corresponding ciphertext record to the user according to the index of the hit record, and the user homomorphically decrypts the plaintext to complete the record screening;

[0014] Step 9: The user starts to perform bill statistics, enters the income and expenditure category SC to be counted and the bill occurrence time range [STL, STU], and encrypts the time range, and then uploads the ciphertext of the time range and the income and expenditure category SC to be counted to the server;

[0015] Step 10: The server performs homomorphic operations 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 operation result RES2, calculates the total amount, and completes 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 uses the public key pk to encrypt the non-negative integer sa i , and 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 uses the public key pk to encrypt the timestamp ts i , and 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 character limit l, then encode it into a positive integer d i , the user then uses the public key pk to encrypt the positive integer d i , and 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 describing the bill, len(D i ).

[0023] Furthermore, the step 5 specifically includes:

[0024] Step 5.1: For the bill amount interval [AL, AU], expand its upper and lower bounds by 100 times to obtain the corresponding non-negative integers sal and sau, and 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 connects the three ciphertexts of the screening conditions (E(sal), E(sau)), E(d) and (E(tsl), E(tsu)) according to the input AND / OR conditions, and then uploads them to the bill server BS together with the bill description string length. The connection 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 selected amount range, for each encrypted amount E(sa i ), respectively execute E(sal) and E(sa i ), E(sau) and E(sa i ) is a Paillier subtraction homomorphic operation, and the results are recorded as α i With β 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 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, and the results are recorded as δ i With ε i;

[0034] Step 6.2: The server combines the operation results according to the AND / OR conjunctions submitted by the user. Each operation result expression is:

[0035] FR i =((α i ,β i ),conj,γ i ,conj,(δ i ,ε i )).

[0036] And all the operation results FR i Send to a trusted third party.

[0037] Furthermore, the step 7 specifically includes:

[0038] 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:

[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 indicator i is included in the amount screening hit index set AI;

[0041] 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;

[0042] If D(δ i )<0 and D(ε i )>0, then this index i is included in 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 conjunction conj="AND" or conj="OR", forms a result index set I, and sends it back to the server.

[0044] Furthermore, 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 a 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 i Reduce it by 100 times to get the real amount a i , and set the timestamp ts i Convert to actual time, convert 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, obtains the corresponding ciphertext (E(tssl), E(tssu)), and 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 ) is a 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 to be counted 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, and then reduces it by 100 times to complete the amount statistics and combine it 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 a personal bill.

[0057] Supports filtering of bill records based on amount range, time range and bill description keywords, and supports AND or OR connection of three filtering conditions.

[0058] Supports ciphertext amount statistics for bill records based on income and expenditure categories and time intervals.

[0059] The present invention explores the ciphertext characteristics of homomorphic encryption and studies the range proof technology of ciphertext data, thereby solving the problem that the range proof operation of ciphertext cannot be implemented when screening records in the existing personal bill privacy protection algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a flow chart of a method for screening and calculating the amount of a personal bill privacy protection record according to the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical scheme and technical effect of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0062] The present invention discloses a method for screening and counting the privacy-protected 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, namely 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 according to 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 to calculate 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 the user, each record R i Including bill amount A i , Revenue 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 starts to filter bill records. The filtering conditions include the keyword string K in the bill description, the bill amount range [AL, AU], and the record occurrence time range [TL, TU]. The three filtering conditions support AND or OR connection.

[0067] Step 5: The user homomorphically encrypts the filtering conditions and uploads the encrypted filtering conditions together 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 operation results to the trusted third party;

[0069] Step 7: The trusted third party performs homomorphic decryption on the calculation result to obtain the records that meet the conditions, and returns the index of the hit record to the server;

[0070] Step 8: The server returns the corresponding ciphertext record to the user according to the index of the hit record, and the user homomorphically decrypts the plaintext to complete the record screening;

[0071] Step 9: The user starts to perform bill statistics, enters the income and expenditure category SC to be counted and the bill occurrence time range [STL, STU], and encrypts the time range, and then uploads the ciphertext of the time range and the income and expenditure category SC to be counted to the server;

[0072] Step 10: The server performs homomorphic operations 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 operation result RES2, calculates the total amount, and completes the amount statistics.

[0074] Using the above method, in the specific implementation examples of the present invention for user bill screening and amount statistics listed below, only the case where the modulus n=p*q in Paillier encryption is 128 bits is used for illustration. In actual operation, a security parameter of n of at least 1024 bits should be used. Specifically:

[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 Category 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 ciphertext data, the public key held and auxiliary information: income and expenditure categories, and description string length 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, the occurrence time [TL, TU] is converted into a timestamp (tsl, tsu) = (1725897600, 1726847999), and homomorphically encrypted into a 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 ciphertext 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 ), so we calculate each component 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, for the encryption time E(ts i ), respectively execute E(tsl) and E(ts i ), E(tsu) and E(ts i ) is a homomorphic subtraction 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, for a 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, whether the number of results that are not null characters (\x00) 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, and 'Train\x00\x00\x00\x00\x00\x00\x00\x00\x00' in the above vector meets the condition, so i=1 is added to the description hit index set DI. Similarly, the other two bill descriptions of 'Flight Ticket' also meet the condition, so DI={1,4,6} is obtained.

[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 according to the result index I. After receiving the result RES1, the user uses the private key sk to perform decryption, and performs operations such as reducing the amount by 100 times, restoring the timestamp, and decoding the description to obtain the following two bill records, 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. The specific expression is as follows:

[0131] [STL,STU] = [2024 / 09 / 12 00:00:00,2024 / 09 / 30 23:59:59], statistical expenditure

[0132] Then the user first converts [STL, STU] into the corresponding timestamp (E(tssl), E(tssu)) = (1726070400, 1727711999), and homomorphically encrypts it into ciphertext (E(tssl), E(tssu)) as (6512671613548992413802563833273908567604689898318394888018334677541208059017, 19310890201811538005727922487379357887683751373799615605582544992570056207975).

[0133] Finally, submit this ciphertext and "Statistical Expenditure" to the server.

[0134] (10) The server calculates the ciphertext timestamp E(tssl) and E(tssu) of 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 ) is a Paillier subtraction homomorphic operation, computing each term λ i With μ i , integrated into:

[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 included in the hit index set TI, and the result is TI={4,5,6,7,8,9}.

[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 encrypted amount E(sa i ) performs addition homomorphic operation, and 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,

[0144] And return the operation result to the user.

[0145] (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.

[0146] Table 5 Statistics of decrypted bill record amounts

[0147] Bill Number Billing time Bill amount Bill Description Income and Expenditure Category 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 / /

[0148] In summary, the present invention overcomes the limitation that the existing encryption algorithm cannot perform interval discrimination operations by exploring the mechanism of symbol discrimination on the result of homomorphic subtraction in the homomorphic encryption algorithm; by exploring the relationship between the subtraction of string vectors and the representation of large integers, a substring matching mechanism between keywords and strings is realized. Not only the amount, time and other numerical data of the user's personal bill, as well as the string data such as description are encrypted and stored, but also users are supported to query bills and make preliminary amount statistics based on these fields. In the whole process, the server can only access the encrypted data of these privacy fields, which greatly improves the privacy protection level of the user's personal bill data.

[0149] The above is only a preferred implementation case of the present invention and does not limit the present invention in any form. Although the implementation process of the present invention is described in detail above, for those familiar with the art, they can still modify the technical solutions recorded in the above examples, or replace some of the technical features therein with equivalents. All modifications, equivalent replacements, etc. made within the spirit and principles of the present invention should be included in the protection scope 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 the user, each record R i Including bill amount A i , Revenue 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 starts to filter bill records. The filtering conditions include the keyword string K in the bill description, the bill amount range [AL, AU], and the record occurrence time range [TL, TU]. The three filtering conditions support AND or OR connection. Step 5: The user homomorphically encrypts the filtering conditions and uploads the encrypted filtering conditions together 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 operation results to the trusted third party; Step 7: The trusted third party performs homomorphic decryption on the calculation result to obtain the records that meet the conditions, and returns the index of the hit record to the server; Step 8: The server returns the corresponding ciphertext record to the user according to the index of the hit record, and the user homomorphically decrypts the plaintext to complete the record screening; Step 9: The user starts to perform bill statistics, enters the income and expenditure category SC to be counted and the bill occurrence time range [STL, STU], and encrypts the time range, and then uploads the ciphertext of the time range and the income and expenditure category SC to be counted to the server; Step 10: The server performs homomorphic operations 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 operation result RES2, calculates the total amount, and completes 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 uses the public key pk to encrypt the non-negative integer sa i , and 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 uses the public key pk to encrypt the timestamp ts i , and 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 character limit l, then encode it into a positive integer d i , the user then uses the public key pk to encrypt the positive integer d i , and 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 describing the bill, 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 interval [AL, AU], expand its upper and lower bounds by 100 times to obtain the corresponding non-negative integers sal and sau, and 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 connects the three ciphertexts of the screening conditions (E(sal), E(sau)), E(d) and (E(tsl), E(tsu)) according to the input AND / OR conditions, and then uploads them to the bill server BS together with the bill description string length. The connection expression is: FC i ive(Sal)ol),E(sauu))oconjconnuallyolonatedolyconjivery(Andl)ol(sl)), The conjunction cinj="AND" or cinj="OR".

5. The method for screening and calculating the amount of personal bill privacy protection records according to claim 4 is characterized in that: The step 6 specifically includes: Step 6.1: Based on the corresponding ciphertext E(sal) and E(sau) of the selected amount range, for each encrypted amount E(sa i ), respectively execute E(sal) and E(sa i ), E(sau) and E(sa i ) is a Paillier subtraction homomorphic operation, and the results are recorded as α i With β 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<<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 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, 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,γ 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 )),con j ,D(γ i ),con j ,(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 index 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 according to the conjunction conj=“AND” or conj=“OR” to form a result index set I, which is sent 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 according to the index set I returned by the trusted third party, forms a 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 i Reduce it by 100 times to get the real amount a i , and set the timestamp ts i Convert to actual time, convert 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, obtains the corresponding ciphertext (E(tssl), E(tssu)), and 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 ) is a 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 to be counted 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, and then reduces it by 100 times to complete the amount statistics and combine them into the final query result.

Citation Information

Patent Citations

  • Big data correlation analysis method and system for protecting consumer privacies in electronic transaction

    CN108171076A

  • Paillier-based homomorphic encryption method and application system

    CN112785306A

  • Data protection communication method, system and equipment based on semi-homomorphic encryption and medium

    CN118381639A

  • Blockchain-Based Secure Transaction Method, Electronic Device, System and Storage Medium

    US20200374135A1