Detection methods and related devices
By using elliptic curve cryptography and HMAC in collaboration between the terminal and the server to generate hash prefixes and ciphertext sets, the problem of the inability to detect account and password leaks in existing technologies is solved, and the security detection and confidentiality protection of account and passwords are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-07
- Publication Date
- 2026-03-03
AI Technical Summary
Existing password management tools are unable to effectively detect account and password leaks, threatening users' personal information and property security.
By working collaboratively between the terminal and the server, using elliptic curve cryptography and HMAC encryption methods, hash prefixes and hash ciphertext sets are generated to achieve batch detection of account passwords while maintaining password confidentiality during the detection process.
It enables batch detection of account password leaks in terminal management, ensuring the confidentiality of account passwords during the detection process and preventing leaks.
Smart Images

Figure CN115510458B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and more particularly to detection methods and related devices. Background Technology
[0002] Usernames and passwords, as identifiers and credentials of digital identities, are currently the most common methods used for identity authentication. With the explosive growth in the number of websites and applications, the number of user accounts and passwords has also increased rapidly. Password management tools can automatically fill in user accounts and passwords when users log in to websites or applications. However, the leakage of account and password information can seriously threaten the security of users' personal information and assets, making it extremely important for users to be able to detect account and password leaks in a timely manner.
[0003] Current password management tools do not have the function of detecting account and password leaks. Therefore, how to provide users with secure and convenient account and password leak detection needs further research. Summary of the Invention
[0004] This application provides a detection method and related apparatus that can detect the leakage of account passwords managed by terminals in batches, and ensure the confidentiality of account passwords during the leakage detection process.
[0005] Firstly, this application provides a detection method applied to a terminal, comprising: acquiring a first hash prefix set and a first hash ciphertext set, wherein the first hash prefix set includes hash prefixes of data in a first dataset, and the first hash ciphertext set includes hash ciphertexts of data in the first dataset, the hash ciphertexts of data in the first dataset being encrypted using a first encryption method; sending a first request to a server, the first request being used to acquire the intersection of the first dataset and a second dataset of the server, the first request carrying the first hash prefix set and the first hash ciphertext set; receiving a second hash ciphertext set and first information sent by the server; the second hash ciphertext set being encrypted using a second encryption method... The hash ciphertext in the hash ciphertext set is obtained after encryption. The first information is used to indicate the first hash ciphertext. The first hash ciphertext is the hash ciphertext corresponding to the hash prefix that matches the first hash prefix in the hash prefix of the data in the second dataset. The first hash prefix is any hash prefix in the first hash prefix set. The hash ciphertext of the data in the second dataset is determined based on the second encryption method. The hash ciphertext in the second hash ciphertext set is decrypted using the first encryption method to obtain the decrypted third hash ciphertext set. The data corresponding to the hash ciphertext that matches the first hash ciphertext in the third hash ciphertext set is determined to be the intersection data of the first dataset and the second dataset.
[0006] By implementing the embodiments of this application, it is possible to detect the leakage of account passwords managed by terminals in batches. Furthermore, through encryption using the first and second encryption methods, the confidentiality of account passwords is guaranteed during the detection process, effectively preventing the leakage of account passwords during the detection process.
[0007] In one implementation, hash ciphertext encrypted sequentially using the first encryption method and the second encryption method is equivalent to hash ciphertext encrypted sequentially using the second encryption method and the first encryption method; for hash ciphertext encrypted sequentially using the second encryption method and the first encryption method, decryption using the second encryption method yields hash ciphertext encrypted using the first encryption method. The first encryption method and the second encryption method satisfy the commutative property of encryption order.
[0008] In one implementation, the first encryption method is to encrypt using a first private key of the terminal and a preset encryption algorithm; the second encryption method is to encrypt using a second private key of the server and a preset encryption algorithm; the preset encryption algorithm satisfies the commutative property of operations on an Abelian group.
[0009] In one implementation, the preset encryption algorithm includes elliptic curve cryptography and keystream XOR encryption.
[0010] In one implementation, before obtaining the first hash prefix set and the first hash ciphertext set, the method further includes adding a preset amount of interference data to the first dataset.
[0011] In one implementation, before sending the first request to the server, the method further includes: using the private key of the terminal's digital signature to obtain a first signature of a first hash prefix set and a second signature of a first hash ciphertext set, wherein the first request also carries the first signature and the second signature, and the first signature and the second signature are used to detect the legitimacy of the first request.
[0012] In one implementation, the hash ciphertext of the first data in the first dataset is the hash ciphertext generated after encrypting the first data using a first private key of the terminal and a preset encryption algorithm. The first data is any data in the first dataset. The hash ciphertext of the second data in the second dataset is the third hash ciphertext generated after encrypting the second hash ciphertext using a third private key and a hash message authentication code (HMAC). The second hash ciphertext is the hash ciphertext generated after encrypting the second data using a second private key of the server and a preset encryption algorithm. The preset encryption algorithm satisfies the commutative property of operations on an Abelian group. The aforementioned determination of the data corresponding to the hash ciphertext matching the first hash ciphertext in the third hash ciphertext set is the intersection data of the first dataset and the second dataset specifically includes: encrypting the hash ciphertext of the first data in the third hash ciphertext set using a fourth private key and HMAC to generate a fourth hash ciphertext set, and determining the data corresponding to the hash ciphertext matching the first hash ciphertext in the fourth hash ciphertext set is the intersection data of the first dataset and the second dataset.
[0013] In one implementation, before obtaining the first hash prefix set and the first hash ciphertext set, the method further includes: sending a registration request to the server, the registration request being used to register a first service, the first service being used to obtain the intersection data of the first dataset and the second dataset; receiving a registration response sent by the server; specifically, before obtaining the first hash prefix set and the first hash ciphertext set, the method further includes: in response to the registration response, obtaining the first hash prefix set and the first hash ciphertext set.
[0014] In one implementation, before sending the first request to the server, the method further includes receiving a prompt message sent by the server, the prompt message being used to indicate to the terminal that the second dataset has been updated.
[0015] In one implementation, before sending the first request to the server, the method further includes: displaying a prompt message in response to a prompt message, the prompt message being used to notify the user that the second dataset has been updated; receiving a second input operation from the user; specifically, sending the first request to the server includes: sending the first request to the server in response to the second input operation.
[0016] In one implementation, the data in the first dataset consists of account passwords managed by the terminal, while the data in the second dataset consists of leaked account passwords obtained by the server.
[0017] In one implementation, the data in the first dataset is personal contact information managed by the terminal, and the data in the second dataset is contact information of contacts who have registered with the first application service and obtained by the server.
[0018] In one implementation, the data in the first dataset is the application software information of the terminal, and the data in the second dataset is the malicious application software information obtained by the server.
[0019] In one implementation, the data in the first dataset consists of URLs accessed by the terminal, while the data in the second dataset consists of malicious URLs obtained by the server.
[0020] Secondly, this application provides a detection method applied to a server, comprising: obtaining a hash prefix and hash ciphertext of data in a second dataset, wherein the hash ciphertext of the data in the second dataset is determined based on a second encryption method; receiving a first request sent by a terminal; the first request is used to obtain the intersection of the second dataset and the terminal's first dataset, the first request carrying a first hash prefix set and a first hash ciphertext set, the first hash prefix set including hash prefixes of data in the first dataset, the first hash ciphertext set including hash ciphertext of data in the first dataset, wherein the hash ciphertext of data in the first dataset is encrypted by a first encryption method; encrypting the hash ciphertext in the first hash ciphertext set using a second encryption method to generate a second hash ciphertext set; retrieving the first hash ciphertext corresponding to a hash prefix that matches the first hash prefix in the hash prefixes of the data in the second dataset, wherein the first hash prefix is any hash prefix in the first hash prefix set; and sending the second hash ciphertext set and first information to the terminal, wherein the first information is used to indicate the first hash ciphertext, and the second hash ciphertext set and the first information are used by the terminal to determine the intersection data of the first dataset and the second dataset.
[0021] By implementing the embodiments of this application, it is possible to detect the leakage of account passwords managed by terminals in batches. Furthermore, through encryption using the first and second encryption methods, the confidentiality of account passwords is guaranteed during the detection process, effectively preventing the leakage of account passwords during the detection process.
[0022] In one implementation, hash ciphertext encrypted sequentially using the first encryption method and the second encryption method is equivalent to hash ciphertext encrypted sequentially using the second encryption method and the first encryption method; for hash ciphertext encrypted sequentially using the second encryption method and the first encryption method, decryption using the second encryption method yields hash ciphertext encrypted using the first encryption method. The first encryption method and the second encryption method satisfy the commutative property of encryption order.
[0023] In one implementation, the first encryption method is to encrypt using a first private key of the terminal and a preset encryption algorithm; the second encryption method is to encrypt using a second private key of the server and a preset encryption algorithm; the preset encryption algorithm satisfies the commutative property of operations on an Abelian group.
[0024] In one implementation, the preset encryption algorithm includes elliptic curve cryptography and keystream XOR encryption.
[0025] In one implementation, the first information includes a filter, and before sending the second hash ciphertext set and the first information to the terminal, the method further includes mapping the first hash ciphertext to the filter.
[0026] In one implementation, the filter includes a Bloom filter, a Cuckoo filter, or a Morton filter.
[0027] In one implementation, the first information includes the first hash ciphertext.
[0028] In one implementation, the first request also carries a first signature of a first hash prefix set and a second signature of a first hash ciphertext set. The first and second signatures are generated using the private key of the terminal's digital signature. Before encrypting the hash ciphertext in the first hash ciphertext set using the second encryption method, the method further includes: verifying the legitimacy of the first request using the public key of the terminal's digital signature, the first signature, and the second signature; encrypting the hash ciphertext in the first hash ciphertext set using the second encryption method, specifically including: when the first request is verified to be legitimate, encrypting the hash ciphertext in the first hash ciphertext set using the second encryption method.
[0029] In one implementation, before receiving the first request from the terminal, the method further includes: sending a notification message to the terminal when the first dataset is updated, to notify the terminal that the first dataset has been updated; the first request is determined by the terminal based on the notification message.
[0030] In one implementation, before receiving the first request sent by the receiving terminal, the method further includes: receiving a registration request sent by the receiving terminal, the registration request being used to register the first service; and sending a registration response to the terminal.
[0031] In one implementation, the data in the first dataset consists of account passwords managed by the terminal, while the data in the second dataset consists of leaked account passwords obtained by the server.
[0032] In one implementation, the data in the first dataset is personal contact information managed by the terminal, and the data in the second dataset is contact information of contacts who have registered with the first application service and obtained by the server.
[0033] In one implementation, the data in the first dataset is the application software information of the terminal, and the data in the second dataset is the malicious application software information obtained by the server.
[0034] In one implementation, the data in the first dataset consists of URLs accessed by the terminal, while the data in the second dataset consists of malicious URLs obtained by the server.
[0035] Thirdly, this application provides a terminal including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, including computer instructions. When the one or more processors execute the computer instructions, they cause the communication device to perform the detection method in any possible implementation of the first aspect described above.
[0036] Fourthly, this application provides a server including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, including computer instructions, which, when executed by the one or more processors, cause a communication device to perform the detection method in any possible implementation of the second aspect described above.
[0037] Fifthly, embodiments of this application provide a computer storage medium including computer instructions, which, when executed on a terminal, cause a communication device to perform the detection method in any of the possible implementations of any of the above aspects.
[0038] Sixthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to execute the detection method in any of the possible implementations of any of the above aspects. Attached Figure Description
[0039] Figure 1 A schematic diagram of the communication system provided in the embodiments of this application;
[0040] Figures 2A to 2D A user interface diagram illustrating an application scenario provided in this application embodiment;
[0041] Figures 3A to 3C A user interface diagram illustrating an application scenario provided in this application embodiment;
[0042] Figures 4A to 4C A user interface diagram illustrating an application scenario provided in this application embodiment;
[0043] Figure 5 A schematic flowchart of the detection method provided in the embodiments of this application;
[0044] Figure 6 This is a functional structure diagram of the server and terminal provided in the embodiments of this application;
[0045] Figure 7 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0046] Figure 8This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0047] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0048] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0049] The communication system involved in the embodiments of this application will be described below.
[0050] Figure 1 This is a schematic diagram of a communication system 10 provided in an embodiment of this application. The communication system 10 may include at least one server 100 (only one is shown) and one or more terminals 200 (only one is shown) connected to the server 100. The server 100 and the terminals 200 may communicate via wireless and / or wired networks.
[0051] The server 100 involved in this application embodiment is a server that can provide account password leakage detection services to the terminal 200. This server can also provide other types of services to the terminal 200. The server 100 can be a cloud server or other types of servers, and no specific limitation is made here.
[0052] The terminal 200 involved in this application embodiment can request the server 100 to register an account password leakage detection service, and can initiate an account password leakage detection request to the server 100 after registering the leakage detection service.
[0053] The terminal 200 involved in this application embodiment can be equipped with iOS, Android, Microsoft, or other operating systems. The terminal 200 can also be referred to as user equipment (UE), access terminal, user unit, user station, mobile station, mobile device, user terminal, terminal equipment, wireless communication equipment, or user device. For example, the terminal 200 can be a mobile phone, tablet computer, desktop computer, laptop computer, netbook, as well as a drone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, and / or smart home device, etc. This application embodiment does not impose any special limitations on the specific type of the terminal 200.
[0054] In this embodiment, the wireless network can be a wireless fidelity network (Wi-Fi), a 3rd-generation (3G) mobile communication technology network, a 5th-generation (5G) mobile communication technology network, a new radio (NR) or general packet radio service (GPRS), etc.; the wired network can be a transmission control protocol / internet protocol (TCP / IP) network, a fiber optic network or an infinite bandwidth (IB) network, etc., and no specific limitation is made here.
[0055] It should be understood that Figure 1 This is merely a schematic diagram of the system architecture of the communication system provided in this application embodiment. The communication system may also include other devices, such as wireless relay devices and wireless backhaul devices. Figure 1 (not shown in the text), and is not limited here.
[0056] It should be noted that in this embodiment of the application, the password can also be referred to as a password, and the account and the password corresponding to the account can also be simply referred to as the account password.
[0057] The following is through Figures 2A to 4C An application scenario of the detection method provided in the embodiments of this application will be introduced.
[0058] Terminal 200 is equipped with a password vault, which can manage the user's website and / or application account passwords. When the user logs in to the account on the website and / or application on Terminal 200, the corresponding account password can be automatically filled in for the user, and the account password leakage detection function can be provided for the user.
[0059] For example, Figure 2A A user interface 11 for displaying applications installed on terminal 200 is shown. User interface 11 may include: a status bar 101, a calendar indicator 102, a weather indicator 103, a tray 104 with icons of frequently used applications, and other application icons 105. Optionally, user interface 10 may also include a page indicator 106. Other application icons may be distributed across multiple pages, and the page indicator 106 can be used to indicate which page the user is currently viewing. The user can swipe left or right on areas containing other application icons to view application icons on other pages.
[0060] like Figure 2A As shown, other application icons 105 can display settings icon 105A. Settings icon 105A can receive user input (e.g., touch operation), and in response to this input, terminal 200 can display, as shown below... Figure 2B The user interface 12 shown is configured as follows.
[0061] like Figure 2B As shown, the user interface 12 may include security and privacy settings 201, and may also include Huawei account settings, Wi-Fi and network settings, etc. The security and privacy settings 201 can be used to manage unlock codes (such as face unlock, fingerprint unlock, screen lock password, etc.), password vaults, and other privacy information. The security and privacy settings 201 can receive user input (such as touch operations), and in response to the input operations, the terminal 200 can display, for example... Figure 2C The user interface shown is 13.
[0062] like Figure 2C As shown, the user interface 13 may include a password safe entry 202, and may also include settings such as fingerprint unlocking and face unlocking. The password safe entry 202 can receive user input (e.g., touch input), and in response to such input, the terminal 200 can display... Figure 2D The user interface 14 of the password safe is shown.
[0063] In some embodiments, in response to an input operation for the password safe, the terminal 200 may also display an authentication interface, whereby the user authenticates themselves using fingerprint, facial recognition, and / or a password. The terminal 200 displays the password safe's user interface 14 only when the user successfully authenticates. This further protects the privacy information within the password safe.
[0064] like Figure 2D As shown, the user interface 14 may include a leakage detection entry 203 and password management entries for one or more applications (e.g., password management entry 204 for application 1) for password vault management. The leakage detection entry 203 can receive user input (e.g., touch input), and in response to this input, the terminal 200 can display... Figure 3A The user interface shown is 15.
[0065] like Figure 3A As shown, the user interface 15 includes a switch control 205, which can be used to turn on or off the account password leakage detection service for password vault management. When the switch control is in the ON state, the terminal 200 has registered for the account password leakage detection service with the server 100, which provides the service. The server 100 can then provide the account password leakage detection service to the terminal 200. When the switch control is in the OFF state, the terminal 200 has not registered for the service or has deleted the registration, and the server 100 will not provide the account password leakage detection service to the terminal 200. Figure 3A As shown, the switch control 205 is in the OFF state. The switch control 205 can receive user input (e.g., touch operation). In response to the input operation, the terminal 200 can switch the state of the switch control 205 to the ON state. Figure 3B The device is shown in the ON state and displays the activation detection control 206. The activation detection control 206 is used to trigger the detection of password leakage for the account password management system.
[0066] Password management entry 204 can receive user input (e.g., touch operation), and in response to the input operation, terminal 200 can display, as shown below. Figure 3C The user interface 16 for password management in application 1 is shown. For example, as... Figure 3C As shown, the user interface 16 may include login account 1 and login account 2 of application 1.
[0067] In some embodiments, when the terminal 200 detects a risk of leakage of the password for the password vault management account, it displays on the currently displayed user interface. Figure 4A The displayed message 207 prompts the user to perform a password vulnerability check in the password safe; it can also be used in... Figure 4BThe user interface 15 shown displays a prompt message 208 to alert the user that their account password is at risk of being compromised. For example, the prompt message 207 can receive user input (e.g., touch input), and in response to this input, the terminal 200 can display a message such as... Figure 4B The user interface shown is 15.
[0068] like Figure 4B and Figure 4C As shown, the leakage detection control 206 can receive user input operations (e.g., touch operations). In response to the input operations, the terminal 200 can trigger leakage detection of account passwords for password vault management applications and / or websites. When leakage of account passwords for applications and / or websites is detected, in Figure 4C The user interface 15 shows one or more leaked accounts (e.g., login account 209 for application 1 and login account 210 for email 1) and prompts the user to change the corresponding passwords in a timely manner. This can prevent further leakage of privacy information.
[0069] In some embodiments, terminal 200 registers a data leak detection service with server 100. When server 100 detects an update to a leaked account password, it broadcasts a notification message to all terminals registered with the data leak detection service (e.g., terminal 200). Terminal 200 then displays notification information 207 and / or notification information 208 based on this notification message. Optionally, after receiving the notification message from server 100, terminal 200 automatically triggers data leak detection without requiring manual triggering by the user; that is, in response to the received notification message, terminal 200 sends a data leak detection request to server 100 to assist in detecting account password leaks.
[0070] Understandable. Figures 2A to 4C The user interface displayed on terminal 200 is merely shown as an example and should not be construed as limiting the embodiments of this application.
[0071] Based on the aforementioned communication system and application scenarios, the detection method provided in the embodiments of this application will be described in detail below.
[0072] In this embodiment, terminal 200 sends a hash prefix set and a hash ciphertext set corresponding to its account password to server 100. Server 100 uses a private key to re-encrypt terminal 200's hash ciphertext set, generating a hash ciphertext set encrypted by both parties. Server 100 searches for matching hash prefixes in the hash prefixes of already leaked account passwords based on the hash prefix set sent by terminal 200, obtains the corresponding hash ciphertext, and then maps the hash ciphertext onto a filter. Based on the filter returned by server 100 and the hash ciphertext set encrypted by both parties, terminal 200 can determine whether its account password has been leaked. Implementing this embodiment enables batch detection of account password leaks managed by terminal 200, and during the leak detection process, the account password remains in an encrypted ciphertext state, ensuring that the account password is not leaked during the leak detection process.
[0073] Figure 5 A schematic flowchart of the detection method provided in the embodiment of this application is shown. The detection method includes a preprocessing stage and an execution stage. The detection method includes, but is not limited to, steps S101 to S124. The detection method will be described in detail below.
[0074] Phase 1: Preprocessing
[0075] S101, Server 100 obtains the leaked set of account passwords x, account password x i ∈x, i∈M1.
[0076] The account password set x includes m1 account passwords, and the i-th account password in the account password set x can be represented as x. i M1 = {1, ..., m1}, i ∈ M1, and m1 is a positive integer.
[0077] It should be noted that server 100 is a server that can provide account password leakage detection services. Server 100 can collect leaked account passwords from various channels, and server 100 can update the account password set x in real time based on the collected leaked account passwords. This application embodiment does not specifically limit the channels through which server 100 obtains leaked account passwords. For example, currently, there are various security detection platforms that detect leaked account passwords and provide them to trusted servers.
[0078] S102, Server 100 obtains account password x i hash value X i .
[0079] In some embodiments, server 100 will send account password x i The account and password are concatenated to generate account and password x. iThe concatenated value; server 100 performs a hash operation on the concatenated value to obtain the hash value X. i Optional, use account password x i The sequence corresponding to the account and the sequence corresponding to the password are concatenated into a single sequence in a preset order. This concatenated sequence is the concatenated value mentioned above.
[0080] The hash operation (also known as pre-image) refers to transforming an input of arbitrary length into a fixed-length output, which is the hash value, using a hash algorithm. This application does not limit the specific implementation of the hash operation.
[0081] S103, Server 100 is based on hash value X i Get account password x i The hash prefix HP(X) i ).
[0082] In some embodiments, the hash value X is taken. i The first N bits are used as the account password x i The hash prefix HP(X) i ), HP(X i ) = X i [0 bits, (N-1) bits]. Where N is a positive integer. Optionally, if the hash value X... i If it is binary, then HP(X) i ) = X i [0bit, (N-1)bit].
[0083] In some embodiments, the hash value X is taken. i The first N characters are used as the account password x i The hash prefix HP(X) i ), HP(X i ) = X i [0 characters, (N-1) characters]. One character equals 8 bits. Where N is a positive integer. Optionally, if the hash value X... i If it is in hexadecimal, then HP(X) i ) = X i [0 character, (N-1) character].
[0084] S104, Server 100 uses the private key key1 and the preset encryption algorithm E(.) to hash the value X. i Encryption, obtain account password x i The first type of hash ciphertext E(key1,X) i ), hash ciphertext set A1 = {E(key1,X i ),i∈M1}.
[0085] In this embodiment, the aforementioned preset encryption algorithm E(.) is an encryption algorithm that satisfies the commutative property of operations on Abelian groups, and satisfies the algebraic operation characteristic E(key2,E(key1,m))=E(key1,E(key2,m)), that is, the two double-encrypted ciphertexts obtained by encrypting m twice using two different keys in different encryption orders are equal. The aforementioned preset encryption algorithm can be an elliptic curve encryption algorithm, a keystream XOR encryption algorithm, etc.
[0086] In some embodiments, the preset encryption algorithm described above can be an elliptic curve cryptography algorithm. Optionally, step S104 specifically includes: server 100 calculating H(X) i ), H(X) i ) indicates that the hash value X i Mapped to points on the elliptic curve; Server 100 uses the private key key1 to map H(X) to points on the elliptic curve. i Encrypt the key to obtain the first type of hash ciphertext E(key1, X). i ), E(key1,X i )=key1·H(X i Based on the elliptic curve cryptography algorithm and the private key key1, a cryptographic security strength of 128 bits can be achieved, resulting in higher security.
[0087] Optionally, the private key key1 is an integer that is pre-randomly generated by server 100.
[0088] Optionally, the private key key1 is randomly selected by server 100 from the preset key set of the Privacy Set Intersection (PSI) protocol. The PSI protocol allows two parties holding their respective data sets to perform an intersection operation. After the PSI protocol is completed, one or both parties can obtain the intersection result, but neither party can obtain any information about the other party's data set outside the intersection.
[0089] S105, Server 100 uses the private key key2 and a hash-based message authentication code (HMAC) to verify the first type of hash ciphertext E(key1,X). i Encryption, obtain account password x i The second type of hash ciphertext HMAC(key2, E(key1, X) i The hash ciphertext set A2 = {HMAC(key2,E(key1,X)} i )),i∈M1}.
[0090] Optionally, key2 can be set to the account password x.i hash value X i Optionally, key2 can be a private HMAC key preset by server 100 and terminal 200, and both server 100 and terminal 200 use key2 for HMAC encryption.
[0091] It's understandable that further encryption using the private key key2 and HMAC can further strengthen the account password x. i The security of hash ciphertext.
[0092] S106, Server 100 generates a mapping table Table for the hash prefix of the account password and the second type of hash ciphertext, Table = {(HP(X i ),HMAC(key2,E(key1,X i ))),i∈M1}.
[0093] In some embodiments, server 100 uses the hash prefix HP(X) i As a partition index, the hash ciphertext is stored in partitions within the mapping table Table.
[0094] For example, server 100 pairs account password x i Perform hashing to obtain the account password x i hash value X i The value is “A8B1 C088 78 1C 2B 38 4F 68A4 B5 C1 66”; server 100 retrieves the hash value X. i The first two characters (i.e., "A8B1") are used as the account password x i The hash prefix; Server 100 uses elliptic curve cryptography and HMAC to hash value X. i Encrypt and generate account password x i The corresponding hash ciphertext is “Aijssksiwo84jllsbbxuskslsue9n#s*&ssabsjsj”; Server 100 generates a mapping table Table between hash prefixes and hash ciphertexts, and stores them in partitions using the hash prefix as the partition index. For example, as shown in Table 1, hash ciphertexts with the hash prefix “A8 B1” can be stored sequentially in the mapping table Table.
[0095] Table 1
[0096]
[0097] S107, Terminal 200 receives the user's first input operation, which is used to enable the account password leakage detection service.
[0098] In some embodiments, terminal 200 receives a user's first input operation for enabling an account password leakage detection service. In response to the first input operation, terminal 200 sends a registration request for the leakage detection service to server 100. After receiving the registration request from terminal 200, server 100 sends a registration response to terminal 200. For example, the first input operation is... Figure 3A The touch operation shown applies to the switch control 205. Optionally, in response to the above input operation, the terminal 200 also executes S108. Optionally, in response to the above registration response, the terminal 200 executes S108.
[0099] S108, Terminal 200 obtains the account password y from the account password set y managed by Terminal 200. j hash value Y j y j ∈y, j∈M2.
[0100] The account password set y includes m2 account passwords, and the j-th account password in the account password set y can be represented as Y. j M2 = {1, ..., m2}, j ∈ M2, and m2 is a positive integer.
[0101] In some embodiments, server 100 will send account password y j The account and password are concatenated to generate the account and password y. j The concatenated value; server 100 performs a hash operation on the concatenated value to obtain the hash value Y. i .
[0102] For example, the set of account passwords managed by terminal 200 includes Figure 2D The account passwords for the multiple applications shown (e.g., application 1, payment application, email 1, browser, etc.).
[0103] S109, Terminal 200 based on hash value Y j Get account password y j The hash prefix HP(Y) j ).
[0104] In some embodiments, the hash value Y is taken. j The first N bits are used as the account password y j The hash prefix HP(Y) j ), HP(Y j ) = Y j [0 bit, (N-1) bit]. Optional, if the hash value Y j If it is binary, then HP(X) i ) = X i [0bit, (N-1)bit].
[0105] In some embodiments, the hash value Y is taken. j The first N characters are used as the account password y j The hash prefix HP(Y) j ), HP(Y j ) = Y j [0 character, (N-1) characters]. Optional, if the hash value Y j If it is in hexadecimal, then HP(Y) j ) = Y j [0 character, (N-1) character].
[0106] It should be noted that, in the embodiments of this application, the hash prefix HP(X) i ) and hash prefix HP(Y j The methods for obtaining ) are the same.
[0107] S110 and terminal 200 use the private key key3 and the preset encryption algorithm E(.) to hash the value Y. i Encryption, obtain account password y j The first type of hash ciphertext E(key3, Y) j ), hash ciphertext set B1 = {E(key3, Y)} j ), j∈M2}.
[0108] In some embodiments, the preset encryption algorithm E(.) can be an elliptic curve cryptography algorithm. Optionally, step S110 specifically includes: terminal 200 calculating H(Y). j ), H(Y j ) indicates that the hash value Y j Mapped to points on the elliptic curve; Server 100 uses the private key key3 to map H(Y) to the elliptic curve. j Encrypt the key to obtain the first type of hash ciphertext E(key3, Y). j ), E(key3,Y j )=key3·H(Y j ).
[0109] Optionally, the private key key3 is a randomly generated integer by the terminal 200. Alternatively, the private key key3 is randomly selected by the terminal 200 from a preset key set of the PSI protocol.
[0110] S111, Terminal 200 generates hash prefix set {HP(Y j The signature S1 of the hash ciphertext set B1 and the signature S2 of the hash ciphertext set B1.
[0111] In this embodiment of the application, terminal 200 uses the private key sk2 of its digital signature to generate a hash prefix set {HP(Y jThe signature S1 of the hash ciphertext set B1 and the signature S2 of the hash ciphertext set B1.
[0112] It should be noted that steps S101 to S106 are the preprocessing process of server 100, and steps S107 to S111 are the preprocessing process of terminal 200. This application embodiment does not specifically limit the execution order of the preprocessing processes of server 100 and terminal 200.
[0113] Phase Two: Operation Phase
[0114] S112, Server 100 updated with leaked account password set x.
[0115] In this embodiment of the application, when server 100 updates the leaked account password set x, it preprocesses the newly added account passwords and updates the aforementioned mapping table Table. The mapping table involved in subsequent steps is the updated Table. Specifically, the preprocessing of the newly added account passwords can be referred to steps S102 to S106, which will not be repeated here.
[0116] S113. Server 100 sends a prompt message to terminal 200. Terminal 200 receives the prompt message sent by server 100. The prompt message is used to prompt terminal 200 to perform account password leakage detection.
[0117] In some embodiments, step S112 is optional. Optionally, regardless of whether the account password set x is updated, the server 100 periodically sends the aforementioned prompt message to the terminal 200.
[0118] S114. Terminal 200 receives a second input operation from the user, which is used to trigger account password leakage detection.
[0119] In some embodiments, after receiving the aforementioned prompt message, the terminal 200 displays a prompt message to remind the user to perform account password leakage detection; then, the terminal 200 receives a second input operation from the user, and in response to the input operation, the terminal 200 executes S115. For example, the aforementioned prompt message may be... Figure 4A The displayed message is 207 or Figure 4B The prompt message 208 shown indicates that the second input operation is... Figure 4B The touch operation shown is used to activate the detection control 206. By implementing this embodiment, the server 100 can send a notification message to the terminal 200 when it detects an update to a leaked account password, thus providing timely account password leakage detection services to protect the security of the user's privacy data.
[0120] In some embodiments, steps S112 and S113 are optional. Optionally, regardless of whether a prompt message is received from server 100, upon receiving the user's second input operation, terminal 200 triggers account password leakage detection, i.e., executes S115.
[0121] In some embodiments, steps S112, S113, and S114 are all optional. Optionally, the terminal 200 may proactively trigger account password leakage detection periodically.
[0122] S115, Terminal 200 sends a leak detection request to Server 100. The leak detection request carries the hash prefix set {HP(Y j ),j∈M2}, hash ciphertext set B1, signature S1 and signature S2, server 100 receives leakage detection request sent by terminal 200.
[0123] In some embodiments, in the hash prefix set {HP(Y) sent to server 100 j In the hash ciphertext set B1, the terminal 200 mixes in a preset number of hash prefixes and hash ciphertexts corresponding to false account passwords, i.e., performs obfuscation processing to further enhance the security of leakage detection. Optionally, after receiving the user's first operation, before executing step S108, if the number of account passwords in the account password set y is less than R, the server 100 mixes in a preset number of false account passwords in the account password set y.
[0124] S116. Server 100 verifies whether signatures S1 and S2 are digital signatures of terminal 200; if so, server 100 executes S117.
[0125] In this embodiment, the leakage detection request sent by terminal 200 in step 114 also carries the identity (ID) of terminal 200 or the account of a specified application. Server 100 can obtain the public key pk2 of the digital signature of terminal 200 based on the ID or account of terminal 200. Server 100 can use the public key pk2 to verify whether signatures S1 and S2 were generated by encryption using the private key sk2 of the digital signature of terminal 200. If so, signatures S1 and S2 are verified as valid, and correspondingly, the hash prefix set {HP(Y}) can be determined. j If the hash ciphertext set B1 and the signature S1 are valid messages from terminal 200, then the signature S1 and signature S2 have failed verification. Correspondingly, the hash prefix set {HP(Y)} can be determined to be a valid message from terminal 200. j The hash ciphertext set B1 may be an illegal message that has been tampered with, replaced, or forged.
[0126] It is understandable that if the private key of the digital signature of terminal 200 is used to generate the signature, then the public key of the digital signature of terminal 200 must be used to verify the signature.
[0127] By implementing the embodiments of this application, the security of the leakage detection service can be further guaranteed by verifying signatures S1 and S2.
[0128] In some embodiments, steps S111 and S116 are optional. Optionally, in step S115, the terminal 200 does not need to send signatures S1 and S2, and after step S115, the server 100 can directly execute step S117.
[0129] S117, Server 100 retrieves the hash prefix HP(Y) from the mapping table Table. i The hash ciphertext set A3 corresponding to the matched hash prefix, A3 = {HMAC(key2, E(key1, Z)} n )), n∈M3}.
[0130] In some embodiments, in step S106, server 100 uses the hash prefix HP(X) i Using the hash prefix HP(Y) as the partition index, the hash ciphertext in the mapping table Table is partitioned and stored; correspondingly, in step S117, server 100 uses the hash prefix HP(Y) as the partition index. i Using ) as a partition index, perform partitioned retrieval on the hash prefix in the mapping table Table, and retrieve the hash prefix HP(Y) in the mapping table Table. i The hash ciphertext set A3 is obtained by matching one or more hash prefixes, and then obtaining the second type of hash ciphertexts corresponding to the above one or more hash prefixes. A3 = {HMAC(key2, E(key1, Z)} n The hash ciphertext set A3 contains the hash ciphertexts of m3 account passwords. The hash value of the account password corresponding to the nth hash ciphertext in hash ciphertext set A3 can be represented as Z. n The nth hash ciphertext mentioned above can be represented as HMAC(key2, E(key1, Z)). n M3 = {1, ..., m3}, n ∈ M3, and m3 is a positive integer.
[0131] It should be noted that in another implementation, server 100 and terminal 200 may not encrypt the hash value of the account password. Server 100 can retrieve a matching hash prefix from the hash prefixes of the leaked account passwords based on the hash prefix sent by terminal 200, and obtain a hash set consisting of the hash values corresponding to the matching hash prefixes. This hash set includes the hash values of M account passwords, where M is a positive integer. However, in this scheme, based on the hash set obtained by the hash prefix retrieval, server 100 or a third-party attacker can deduce the hash value of the user's account password with a probability of 1 / M, and then use the leaked account password set with a probability of 1 / M to deduce the plaintext of the user's account password. In this embodiment, by re-encrypting the hash value of the account password using a preset encryption algorithm (or a preset encryption algorithm and the HAMC encryption algorithm), the above problems can be effectively avoided, ensuring the security of the account password during the leakage detection process.
[0132] S118, Server 100 maps the hash ciphertext set A3 to the filter.
[0133] The filters involved in this application are essentially numerical matrices composed of one or more arrays, used to quickly retrieve whether an element exists in a specific set. Filters include, but are not limited to, Bloom filters, Cuckoo filters, and Morton filters. The principle of the filter is as follows: when an element is added to the set, it is mapped to K positions (also called K points) in an array of the filter using K hash functions (K≥1), and the values of these K positions are set to 1. When retrieving a specific element, the mapping position corresponding to the specified element in an array is determined using the same mapping method. Then, for each array in the filter, it is determined whether all mapping positions corresponding to the specified element are 1. If at least one mapping position corresponding to the specified element is 0, the specified element does not exist in the set; if all mapping positions corresponding to the specified element are 1, the specified element is very likely to exist in the set. Compared to other data structures, retrieving a specified element through a filter has significant advantages in terms of both space and time.
[0134] Specifically, server 100 maps each hash ciphertext in hash ciphertext set A3 to K positions (K≥1) in an array of filters using K hash functions, and sets the values of the above K positions to 1.
[0135] S119. Server 100 uses the private key key1 and the preset encryption algorithm E(.) to perform secondary encryption on the first type of hash ciphertext in hash ciphertext set B1, obtaining hash ciphertext set B2, B2 = {E(key1, E(key3, Y...}). i)), i∈M1}.
[0136] In some embodiments, the preset encryption algorithm is an elliptic curve cryptography algorithm, and the first type of hash ciphertext E(key3,Y) in the hash ciphertext set B1 j )=key3·H(Y j The hash ciphertext E(key1, E(key3, Y) in hash ciphertext set B2 i ))=key1·key3·H(Y j ).
[0137] S120, server 100 sends the filter and hash ciphertext set B2 to terminal 200, and terminal 200 receives the filter and hash ciphertext set B2 sent by server 100.
[0138] It should be noted that if server 100 sends an unencrypted hash set to terminal 200, a third-party attacker can use a rainbow table to attack the hash set sent by server 100, and may then obtain the plaintext account password corresponding to the hash value in the hash set. Furthermore, directly sending back the hash set incurs significant communication overhead. In the detection method provided in this application embodiment, server 100 maps the retrieved hash ciphertext set A2 to a filter and sends the filter back. This effectively protects the security of the account password, and the filter feedback significantly reduces communication overhead.
[0139] S121. Terminal 200 uses the private key key3 to parse B2 and obtains the hash ciphertext set B3 = {E(key1,Y...} i ), i∈M1}.
[0140] In this embodiment of the application, the above-mentioned preset encryption algorithm satisfies the commutative property of operations on Abelian groups, {E(key1, E(key3, Y)} i )), i∈M1}={E(key3, E(key1,Y i Terminal 200 uses the private key key3 to parse {E(key1, E(key3, Y)}, i∈M1}. i )), i∈M1} is equivalent to using the private key key3 to parse {E(key3, E(key1, Y)} i )), i∈M1}, E(key3, E(key1,Y i The private key key3 can be parsed into E(key1, Y). i ).
[0141] In some embodiments, the preset encryption algorithm is an elliptic curve cryptography algorithm, and the hash ciphertext E(key1, E(key3, Y) in the hash ciphertext set B2 is... i))=key1·key3·H(Y j ) = key3·key1·H(Y j Terminal 200 uses the private key key3 to parse E(key1, E(key3, Y). i )) is key3 -1 ·key3·key1·H(Y j ), that is, key1·H(Y j ).
[0142] S122, Terminal 200 uses the private key key4 and the hash message authentication code HMAC to analyze the first type of hash ciphertext E(key1,Y) in the hash ciphertext set B3. i Encryption, obtain account password y i The second type of hash ciphertext HMAC(key4, E(key1, Y)) i Hash ciphertext set B4 = {HMAC(key4, E(key1, Y)} i )),i∈M1}.
[0143] Optionally, key4 can be the account password y. i hash value Y i Optionally, key4 is equal to the aforementioned key2, where key2 is the private key for HMAC preset by server 100 and terminal 200, and both server 100 and terminal 200 use key2 for HMAC encryption.
[0144] S123, Terminal 200 matches the second type of hash ciphertext in hash ciphertext set B4 with the second type of hash ciphertext mapped in the filter.
[0145] S124. When the second type of hash ciphertext mapped by the filter exists in the second type of hash ciphertext HMAC(key4,E(key1,Y) in hash ciphertext set B4. i The terminal 200 determines the hash ciphertext HMAC(key4,E(key1,Y)) by matching the hash ciphertext. i The corresponding account password is y. i It has been leaked.
[0146] Specifically, the second type of hash ciphertext HMAC(key4,E(key1,Y)) in the hash ciphertext set B4 is processed by K hash functions. i The hash is mapped to K specified positions (K≥1) in an array of filters; when all K specified positions in the first array of the filter are 1, the second type of hash ciphertext mapped by the first array is compared with the second type of hash ciphertext HMAC(key4,E(key1,Y). iThe hash is matched to determine the account password y corresponding to the hash ciphertext. i It has most likely been leaked.
[0147] It should be noted that if the private key key2 of the HMAC encryption of terminal 200 is the account password x i hash value X i The private key key4 of the HMAC encryption on server 100 is the account password y. i hash value Y i When account password x i With account password y i If they are the same, then key2 and key4 are also equal.
[0148] It should be understood that, for the same account password, since the second type of hash ciphertext in hash ciphertext set B4 and the second type of hash ciphertext mapped in the filter are both encrypted with the same private key and encryption algorithm, the second type of hash ciphertext in hash ciphertext set B3 and the second type of hash ciphertext mapped in the filter can be matched.
[0149] It is understandable that when the second type of hash ciphertext mapped by the filter does not exist in the hash ciphertext set B4, the second type of hash ciphertext HMAC(key4,E(key1,Y) will not be present. i The terminal 200 determines the hash ciphertext HMAC(key4,E(key1,Y)) by matching the hash ciphertext. i The corresponding account password is y. i It is in a safe state.
[0150] Example, reference Figure 4C After terminal 200 confirms the leaked account password, Figure 4C The user interface 15 shown displays the leaked accounts to prompt users to update their passwords promptly.
[0151] In some embodiments, step S118 is optional. Optionally, in step S120, server 100 can directly send hash ciphertext set A3 to terminal 200 without performing filter mapping; terminal 200 directly matches the second type of hash ciphertext in hash ciphertext set B4 with the second type of hash ciphertext in hash ciphertext set A3 to determine whether there is a hash ciphertext in hash ciphertext set B4 that matches the second type of hash ciphertext in hash ciphertext set A3. If a matching hash ciphertext exists, the account password corresponding to the matching hash ciphertext is determined to be a leaked account password.
[0152] In some embodiments, steps S105 and S121 are optional. Optionally, in step S106, server 100 may generate a mapping table Table of the hash prefix of the account password and the first type of hash ciphertext, Table = {(HP(X i ), E(key1,X i In step S117, server 100 obtains the hash prefix HP(Y) from the mapping table Table. i The hash ciphertext set A3 corresponding to the first type of hash ciphertext matching the hash prefix, A3 = {E(key1, Z)} n In step S118, server 100 maps the first type of hash ciphertext in hash ciphertext set A3 to the filter; after step S121, terminal 200 matches the first type of hash ciphertext in hash ciphertext set B3 with the first type of hash ciphertext mapped in the filter. When the first type of hash ciphertext mapped by the filter exists in hash ciphertext set B3, the first type of hash ciphertext E(key1,Y) is matched with the first type of hash ciphertext E(key1,Y) in hash ciphertext set B3. i The terminal 200 determines the first type of hash ciphertext E(key1,Y) based on the matched hash ciphertext. i The corresponding account password is y. i It has been leaked.
[0153] In some embodiments, in step S105, server 100 truncates the second type of hash ciphertext encrypted with HMAC to generate a truncated third type of hash ciphertext. For example, the HMAC-encrypted account password x i The second type of hash ciphertext HMAC(key2, E(key1, X) i The hash is 256 bits. Server 100 takes the first 128 bits of the hash ciphertext from the above 256 bits as the account password x. i The third type of hash ciphertext. In step S106, server 100 can generate a mapping table Table between the hash prefix of the account password and the third type of hash ciphertext; in step S117, server 100 obtains the hash prefix HP(Y) from the mapping table Table. i The hash ciphertext set A3 corresponds to the third type of hash ciphertext matching the hash prefix. In step S118, server 100 maps the third type of hash ciphertext in hash ciphertext set A3 to a filter; in step S122, terminal 200 performs the same truncation process on the second type of hash ciphertext in hash ciphertext set B4 to generate a hash ciphertext set B5 including the third type of hash ciphertext. In step S123, terminal 200 matches the third type of hash ciphertext in hash ciphertext set B5 with the third type of hash ciphertext mapped in the filter. When there is a hash ciphertext in the third type of hash ciphertext mapped by the filter that matches the third type of hash ciphertext in hash ciphertext set B5, terminal 200 determines that the account password corresponding to the hash ciphertext has been leaked.
[0154] It should be noted that truncating the hash ciphertext after HMAC encryption can reduce the storage overhead of the hash ciphertext of the account password in step S106, the communication overhead between the server 100 and the terminal 200 in step S118, and the computational overhead of hash ciphertext matching in step S123.
[0155] In some embodiments, before step S120, the method further includes: server 100 using its private key sk1 (the digital signature of server 100) to generate a filter signature S3 and a hash ciphertext set B2 signature S4. Step S120 specifically includes: server 100 sending the filter, hash ciphertext set B2, signature S3, and signature S4 to terminal 200; terminal 200 receiving the filter, hash ciphertext set B2, signature S3, and signature S4 sent by server 100. Step S121 specifically includes: terminal 200 using its public key pk1 (the digital signature of server 100) to verify whether signature S3 and signature S4 were generated using the private key of server 100's digital signature; if so, server 100 using its private key key3 to parse B2 and obtain the hash ciphertext set B3 = {E(key1,Y...}). i ), i∈M1}.
[0156] In summary, implementing the embodiments of this application enables batch detection of account password leaks managed by terminal 200, allowing users to promptly learn of leaked account passwords and avoid loss of personal property and leakage of privacy data. During the account password leak detection process, the account passwords are always in an encrypted ciphertext state, and the detection results are determined by terminal 200 and presented only on the terminal side. The user's account passwords will not be leaked to server 100 or third-party attack terminals, ensuring the confidentiality of account passwords during the leak detection process.
[0157] The detection method provided in this application is not limited to detecting account and password leaks. It can also be applied to other application scenarios, including those involving finding the intersection of the private data sets held by both parties. The detection method provided in this application is applicable to all of these scenarios, and this application does not impose any specific limitations on them. Typical extended application scenarios are described below.
[0158] Extended Scenario 1: Private Contact Discovery.
[0159] In simple terms, private contact discovery involves finding contacts on a specific application platform. When a user registers for a new application service (such as an instant messaging application), the system searches their existing contact list to see which users have already registered for the same service. This has become a standard feature when registering for new applications, providing convenience. While sending the user's contacts to the service provider effectively accomplishes this, it also exposes the user's contact information to the provider, which users do not want. Therefore, in this scenario, the detection method provided in this application provides a solution that uses the user's contact information as one input and the provider's information on all registered users as the other input. This allows for private contact discovery while preventing the leakage of the user's contact information.
[0160] For scenarios involving the discovery of private contacts, the detection method provided in this application also includes a preprocessing stage and an execution stage, wherein:
[0161] During the preprocessing stage, server 100 obtains a set of registered contacts consisting of all contact information registered with the first application service, and performs preprocessing on the set of registered contacts to obtain the hash, hash prefix, and hash ciphertext of the registered contact information; when terminal 200 registers and uses the first application service, it performs preprocessing on a set of personal contacts consisting of personal contact information to obtain the hash, hash prefix, and hash ciphertext of the personal contact information.
[0162] During operation, when a user triggers the function of finding private contacts for the first application service, terminal 200 sends hash prefix set 1 and hash ciphertext set 1 corresponding to the personal contact set to server 100. Server 100 uses its private key key1 to re-encrypt the hash ciphertext in hash ciphertext set 1 sent by terminal 200 to obtain hash ciphertext set 2, which is encrypted by both parties, corresponding to the personal contact set. Based on hash prefix set 1 sent by terminal 200, server 100 searches for the hash prefixes of registered contacts to obtain matching hash prefix pairs of registered contacts. The server 100 retrieves the corresponding hash ciphertext and maps the retrieved hash ciphertext onto the filter; the server 100 sends the filter and the hash ciphertext set 2 encrypted by both parties to the terminal 200; the terminal 200 uses its private key key3 to parse the hash ciphertext set 2 encrypted by both parties, and obtains the hash ciphertext set 3 corresponding to the personal contact set encrypted by key1; the terminal 200 matches the hash ciphertext set 3 with the hash ciphertext mapped by the filter; when there is a matching hash ciphertext in the hash ciphertext set 3, the personal contact corresponding to the hash ciphertext is the contact who has registered for the first application service.
[0163] Specifically, the preprocessing process of the above-mentioned registered contact set can be referred to the relevant descriptions of steps S101 to S106, the preprocessing process of the above-mentioned personal contact set can be referred to the relevant descriptions of steps S107 to S111, and the above-mentioned running stage can be referred to the relevant descriptions of steps S112 to S124. All of these will not be repeated here.
[0164] Extended Scenario 2: Malicious Application Software Detection.
[0165] By analyzing the application software installation list on terminal 200 and the malicious application software list on the cloud side, and solving for their intersection, it is possible to detect whether the application software installed on terminal 200 is malicious, thereby ensuring the data security of terminal 200 and a safe software usage environment.
[0166] For malicious application software detection scenarios, the detection method provided in this application embodiment also includes a preprocessing stage and an execution stage, wherein:
[0167] During the preprocessing phase, server 100 obtains a set of malicious application software composed of disclosed malicious application software information and performs preprocessing on the malicious application software set to obtain the hash, hash prefix, and hash ciphertext of the malicious application software information; terminal 200 performs preprocessing on a set of terminal application software composed of terminal application software information to obtain the hash, hash prefix, and hash ciphertext of the terminal application software information.
[0168] During operation, when a user triggers the malicious application software detection function, terminal 200 sends hash prefix set 1 and hash ciphertext set 1 corresponding to the terminal application software set to server 100. Server 100 uses its private key key1 to re-encrypt the hash ciphertext in hash ciphertext set 1 sent by terminal 200, obtaining hash ciphertext set 2, which is encrypted by both parties, corresponding to the terminal application software set. Based on hash prefix set 1 sent by terminal 200, server 100 searches for the hash prefix of malicious application software information and obtains the hash prefix corresponding to the matching malicious application software information. The server 100 generates a hash ciphertext and maps the retrieved hash ciphertext to a filter; the server 100 sends the filter and the hash ciphertext set 2 encrypted by both parties to the terminal 200; the terminal 200 uses its private key key3 to parse the hash ciphertext set 2 encrypted by both parties, and obtains the hash ciphertext set 3 corresponding to the terminal application software set encrypted by key1; the terminal 200 matches the hash ciphertext set 3 with the hash ciphertext mapped by the filter; when a matching hash ciphertext exists in the hash ciphertext set 3, the terminal application software corresponding to that hash ciphertext is the disclosed malicious application software.
[0169] In some embodiments, when the terminal 200 detects that a user has downloaded or installed application software, it sends a detection request to the server 100, requesting the server 100 to detect whether the application software is malicious. When the application software is detected to be malicious, the terminal 200 promptly reminds the user that the application software is risky and to install the application software with caution.
[0170] Specifically, the preprocessing process of the aforementioned malicious application software set can be referred to the relevant descriptions of steps S101 to S106, the preprocessing process of the aforementioned terminal application software set can be referred to the relevant descriptions of steps S107 to S111, and the aforementioned running stage can be referred to the relevant descriptions of steps S112 to S124. These will not be repeated here.
[0171] Extended Scenario 3: Malicious Website Detection.
[0172] By calculating the intersection of the URLs accessed by the browser of terminal 200 and the list of malicious URLs on the cloud side, it is possible to detect in real time whether the URL currently accessed by the browser of terminal 200 is a malicious URL, so as to maintain a safe and healthy network access environment.
[0173] For malicious website detection scenarios, the detection method provided in this application also includes a preprocessing stage and an execution stage, wherein:
[0174] During the preprocessing phase, server 100 obtains the disclosed malicious URLs to form a malicious URL set, and performs preprocessing on the malicious URL set to obtain the hash, hash prefix, and hash ciphertext of the malicious URLs.
[0175] During the operation phase, when terminal 200 accesses the first URL, terminal 200 performs preprocessing on the first URL to obtain the hash, hash prefix, and hash ciphertext of the first URL. Terminal 200 sends the hash prefix and hash ciphertext of the first URL to server 100; server 100 uses its private key key1 to re-encrypt the hash ciphertext of the first URL to obtain the hash ciphertext encrypted by both parties for the first URL; based on the hash prefix of the first URL sent by terminal 200, server 100 searches for the hash prefix of malicious URLs, obtains the hash ciphertext corresponding to the hash prefix of the matching malicious URL, and maps the retrieved hash ciphertext to a filter; server 100 sends the filter and the aforementioned hash ciphertext encrypted by both parties to terminal 200; terminal 200 uses its private key key3 to parse the aforementioned hash ciphertext encrypted by both parties to obtain the hash ciphertext of the first URL encrypted by key1; terminal 200 matches the hash ciphertext of the first URL encrypted by key1 with the hash ciphertext mapped by the filter; when a matching hash ciphertext exists, the first URL is determined to be a disclosed malicious URL.
[0176] Specifically, the preprocessing process of the aforementioned malicious URL set can be referred to the relevant descriptions of steps S101 to S106, the preprocessing process of the aforementioned first URL can be referred to the relevant descriptions of steps S108 to S111, and the aforementioned running stage can be referred to the relevant descriptions of steps S112 to S124. These will not be repeated here.
[0177] The functional modules of the server 100 and terminal 200 involved in the embodiments of this application are described below.
[0178] This application embodiment can divide the server 100 and terminal 200 into functional modules according to the aforementioned detection method. For example, each function of the terminal device can be divided into different functional modules, or two or more functions of the terminal device can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0179] For example, Figure 6 A schematic diagram of a server 100 according to an embodiment of this application is shown. For example... Figure 6As shown, server 100 includes splicing module 1, password service module 1, partitioned storage module, broadcast module, filter generation module and retrieval module.
[0180] Among them, the splicing module 1 is used to splice the account passwords x in the leaked account password set x. i Perform concatenation to generate the concatenated account password value, x i ∈x, i∈M1; Password service module 1 is used for account password x i The corresponding concatenated values are preprocessed to generate the leaked account password x. i hash value X i Hash prefix HP(X) i The partitioned storage module is used to generate the hash prefix HP(X) and the hash ciphertext; i A mapping table between the hash and the ciphertext is used, and partitioned storage is performed using the hash prefix as the partition index.
[0181] For example, Figure 6 A schematic diagram of a terminal 200 according to an embodiment of this application is also shown. For example... Figure 6 As shown, terminal 200 includes splicing module 2, password service module 2, anonymity module, display module, triggering module, ciphertext conversion module and ciphertext matching module.
[0182] Among them, the splicing module 2 is used to splice the account passwords y in the account password set y managed by terminal 200. j Perform concatenation to generate the concatenated account password value, y j ∈y, j∈M2; Password service module 1 is used for account password y j The corresponding concatenated values are preprocessed to generate the leaked account password y. j hash value Y j Hash prefix HP(Y) j The anonymous module is used to mix a preset number of false account passwords into the account password set y. The concatenation module 2 concatenates the aforementioned false account passwords, and the password service module 1 obtains the hash prefix and hash ciphertext corresponding to the aforementioned false account passwords. In this embodiment, the anonymous module is optional.
[0183] In addition, the broadcast module of server 100 is used to broadcast a prompt message to terminal 200 registered with the leakage detection service when the account password set x is updated, so as to prompt terminal 200 to perform account password leakage detection.
[0184] The display module of terminal 200 is used to display prompt information based on the prompt message sent by server 100, so as to prompt the user to trigger account password leakage detection. The triggering module of terminal 200 is used to respond to the user's input operation and trigger account password leakage detection, that is, to trigger terminal 200 to send the hash prefix set and hash ciphertext set B1 corresponding to the account password set y generated by password service module 2 to server 100.
[0185] In some embodiments, the retrieval module of server 100 is used to retrieve a matching hash prefix from the partitioned storage module based on the hash prefix set corresponding to the account password set y sent by terminal 200, thereby obtaining a hash ciphertext set A3 composed of the first type of hash ciphertext corresponding to the hash prefix; the filter generation module is used to map the first type of hash ciphertext in hash ciphertext set A3 onto a filter. The password service module 1 of server 100 is also used to encrypt hash ciphertext set B1 again to obtain a hash ciphertext set B2 encrypted by both parties. Server 100 sends the filter and hash ciphertext set B2 to terminal 200.
[0186] The ciphertext conversion module of terminal 200 is also used to parse the hash ciphertext set B2 encrypted by both parties sent by server 100 using the private key of terminal 200, and obtain the parsed hash ciphertext set B3; the ciphertext matching module is used to match the hash ciphertext set B3 with the first type of hash ciphertext mapped in the filter to determine whether there is a matching first type of hash ciphertext in hash ciphertext set B3; if there is a matching first type of hash ciphertext, then the account password corresponding to the hash ciphertext is the leaked account password in the account password set y.
[0187] In some embodiments, the retrieval module of server 100 is further configured to retrieve a matching hash prefix in the partitioned storage module based on the hash prefix set corresponding to the account password set y sent by terminal 200, thereby obtaining a hash ciphertext set A3 composed of the second type of hash ciphertext corresponding to the aforementioned hash prefix; the filter generation module is configured to map the second type of hash ciphertext in hash ciphertext set A3 onto a filter. The password service module 1 of server 100 is further configured to encrypt hash ciphertext set B1 again to obtain a hash ciphertext set B2 encrypted by both parties. Server 100 sends the filter and hash ciphertext set B2 to terminal 200.
[0188] The ciphertext conversion module of terminal 200 is also used to encrypt the hash ciphertext set B3 through HAMC to obtain the hash ciphertext set B4 of the second type of hash ciphertext. The ciphertext matching module of terminal 200 is also used to match the hash ciphertext set B4 with the second type of hash ciphertext mapped in the filter to determine whether there is a matching second type of hash ciphertext in hash ciphertext set B4; if there is a matching second type of hash ciphertext, then the account password corresponding to the hash ciphertext is the leaked account password in the account password set y.
[0189] The hardware structure of the terminal 200 involved in the embodiments of this application will be described below.
[0190] For example, Figure 7 A schematic diagram of the terminal 200 is shown.
[0191] Terminal 200 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0192] It is understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal 200. In other embodiments of this application, the terminal 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0193] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0194] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0195] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0196] The charging management module 140 is used to receive charging input from the charger.
[0197] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, display 194, camera 193, and wireless communication module 160, etc.
[0198] The wireless communication function of terminal 200 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0199] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 200 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0200] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal 200. The mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0201] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194.
[0202] The wireless communication module 160 can provide solutions for wireless communication applications on the terminal 200, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0203] In some embodiments, antenna 1 of terminal 200 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling terminal 200 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0204] Terminal 200 implements display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0205] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. In some embodiments, terminal 200 may include one or N displays screens 194, where N is a positive integer greater than 1.
[0206] Terminal 200 can implement shooting functions through an ISP, camera 193, video codec, GPU, display 194, and application processor. The ISP is used to process data fed back by camera 193. Camera 193 is used to capture still images or videos. In some embodiments, terminal 200 may include one or N cameras 193, where N is a positive integer greater than 1.
[0207] A digital signal processor (DSP) is used to process digital signals. Besides digital image signals, it can also process other digital signals. For example, when terminal 200 selects a frequency point, the DSP can perform Fourier transforms on the frequency energy.
[0208] Video codecs are used to compress or decompress digital video. Terminal 200 may support one or more video codecs. Thus, terminal 200 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0209] NPU stands for Neural-Network (NN) Computing Processor. By drawing inspiration from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can quickly process input information and continuously learn on its own.
[0210] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).
[0211] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), and double data rate synchronous dynamic random access memory (DDR SDRAM, such as fifth-generation DDR SDRAM, which is generally called DDR5 SDRAM). Non-volatile memory can include disk storage devices and flash memory.
[0212] Terminal 200 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0213] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of terminal 200, in a different position than display screen 194.
[0214] The following describes the structure of a server 100 provided in an embodiment of this application.
[0215] Figure 8 An exemplary embodiment of the present application illustrates the structure of a server 100.
[0216] like Figure 8 As shown, server 100 may include: one or more network device processors 201, memory 202, communication interface 203, receiver 205, transmitter 206, coupler 207, antenna 208, and network device interface 209. These components can be connected via bus 204 or other means. Figure 8 Taking a bus connection as an example:
[0217] The communication interface 203 can be used by the server 100 to communicate with other communication devices, such as terminal devices. Specifically, the terminal device can be... Figure 7 The terminal 200 is shown. Specifically, the communication interface 203 can be a 5G communication interface or a future new radio (NR) communication interface. Not limited to a wireless communication interface, the server 100 can also be configured with a wired communication interface 203, such as a local access network (LAN) interface. The transmitter 206 can be used to process the signals output by the network device processor 201. The receiver 205 can be used to process the mobile communication signals received by the antenna 208.
[0218] In some embodiments of this application, the transmitter 206 and receiver 205 can be considered as a wireless modem. In server 100, the number of transmitters 206 and receivers 205 can be one or more. Antenna 208 can be used to convert electromagnetic energy in a transmission line into electromagnetic waves in free space, or to convert electromagnetic waves in free space into electromagnetic energy in a transmission line. Coupler 207 is used to split the mobile communication signal received by antenna 208 into multiple paths and distribute them to multiple receivers 205.
[0219] Memory 202 is coupled to network device processor 201 and is used to store various software programs and / or sets of instructions. Specifically, memory 202 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. Memory 202 may store network communication programs that can be used to communicate with one or more auxiliary devices, one or more terminal devices, or one or more network devices.
[0220] In some embodiments of this application, the memory 202 may be used to store the implementation program of the uplink synchronization method provided in one or more embodiments of this application on the server 100 side. For the implementation of the detection method provided in one or more embodiments of this application, please refer to the above embodiments.
[0221] The network device processor 201 can be used to read and execute computer-readable instructions. Specifically, the network device processor 201 can be used to invoke a program stored in the memory 202, such as the implementation program of the detection method provided in one or more embodiments of this application on the server 100 side, and execute the instructions contained in the program.
[0222] It should be noted that, Figure 8 The server 100 shown is merely one implementation of the embodiments of this application. In actual applications, the server 100 may include more or fewer components, which is not limited here.
[0223] Based on the aforementioned communication system, application scenario, functional modules, and hardware structure, this application embodiment provides a detection method. The detection method includes steps S201 to S208, wherein:
[0224] S201, Server 100 obtains the hash prefix and hash ciphertext of the data in the second dataset. The hash ciphertext of the data in the second dataset is determined based on the second encryption method.
[0225] S202, Terminal 200 obtains a first hash prefix set and a first hash ciphertext set. The first hash prefix set includes the hash prefix of the data in the first dataset, and the first hash ciphertext set includes the hash ciphertext of the data in the first dataset. The hash ciphertext of the data in the first dataset is encrypted using a first encryption method.
[0226] S203, Terminal 200 sends a first request to server 100, and server 100 receives the first request sent by terminal 200. The first request is used to obtain the intersection of the first dataset and the second dataset of server 100. The first request carries the first hash prefix set and the first hash ciphertext set.
[0227] S204. Server 100 encrypts the hash ciphertext in the first hash ciphertext set using the second encryption method to generate the second hash ciphertext set.
[0228] S205. Server 100 retrieves the first hash ciphertext corresponding to the hash prefix that matches the first hash prefix in the hash prefix of the data in the second dataset. The first hash prefix is any hash prefix in the first hash prefix set.
[0229] S206, Server 100 sends a second hash ciphertext set and first information to Terminal 200. Terminal 200 receives the second hash ciphertext set and first information sent by Server 100. The first information is used to indicate the first hash ciphertext. The second hash ciphertext set and the first information are used by Terminal 200 to determine the intersection data between the first dataset and the second dataset.
[0230] S207, Terminal 200 uses the first encryption method to decrypt the hash ciphertext in the second hash ciphertext set and obtain the decrypted third hash ciphertext set.
[0231] S208, Terminal 200 determines the data corresponding to the hash ciphertext that matches the first hash ciphertext in the third hash ciphertext set, which is the intersection data of the first dataset and the second dataset.
[0232] In some embodiments, hash ciphertext encrypted sequentially using the first encryption method and the second encryption method is equivalent to hash ciphertext encrypted sequentially using the second encryption method and the first encryption method; for hash ciphertext encrypted sequentially using the second encryption method and the first encryption method, decryption using the second encryption method yields hash ciphertext encrypted using the first encryption method. It is understood that when encrypting using the first encryption method and the second encryption method, the encryption result is the same regardless of the encryption order, and the encryption order of the first encryption method and the second encryption method is interchangeable.
[0233] In some embodiments, the first encryption method is encryption using a first private key of terminal 200 and a preset encryption algorithm; the second encryption method is encryption using a second private key of server 100 and a preset encryption algorithm; the preset encryption algorithm satisfies the commutative property of operations on Abelian groups. Optionally, the first private key is the aforementioned private key key3, and the second private key is the aforementioned private key key1.
[0234] In some embodiments, the preset encryption algorithm includes elliptic curve cryptography and keystream XOR encryption.
[0235] In some embodiments, the first information includes a filter, and before the server 100 sends the second hash ciphertext set and the first information to the terminal 200, the method further includes: the server 100 mapping the first hash ciphertext to the filter.
[0236] In one implementation, the filter includes a Bloom filter, a Cuckoo filter, or a Morton filter.
[0237] In one implementation, the first information includes the first hash ciphertext.
[0238] In some embodiments, the second dataset is the aforementioned account password set x; the first dataset is the aforementioned account password set y, and the first hash prefix set is the hash prefix set corresponding to the account password set y, i.e., {HP(Y j The first hash ciphertext set is the aforementioned hash ciphertext set B1, B1 = {E(Key3, Y)}, j∈M2}. j The second hash ciphertext set is the aforementioned hash ciphertext set B2, B2 = {E(key1, E(key3, Y)}, j∈M2}, where j∈M2}. i The third hash ciphertext set is the aforementioned hash ciphertext set B3, B3={E(key1,Y i ), i∈M1}; the first request is the aforementioned leakage detection request; the first hash ciphertext is any hash ciphertext in the aforementioned hash ciphertext set A3.
[0239] Optionally, the hash ciphertext of the data in the second dataset is a first-type hash ciphertext encrypted using the private key key1 of server 100 and a preset encryption algorithm. The hash ciphertext set A3 includes the aforementioned first-type hash ciphertext E(key1, Z). n ), A3={E(key1,Z n ), n∈M3}.
[0240] Optionally, the hash ciphertext of the data in the second dataset is a second type of hash ciphertext encrypted using the private key key1 of server 100 and a preset encryption algorithm, and then further encrypted using a third private key and HMAC. The third private key can be the aforementioned private key key2, and the hash ciphertext set A3 includes the aforementioned second type of hash ciphertext HMAC(key2, E(key1, Z)). n ), Hash ciphertext set A3 = {HMAC(key2, E(key1, Z)} n The first hash ciphertext is a second type of hash ciphertext. The data corresponding to the hash ciphertext matching the first hash ciphertext in the third hash ciphertext set is the intersection of the first and second datasets. Specifically, this includes: encrypting the hash ciphertext of the data in the third hash ciphertext set using the fourth private key and HMAC to generate the fourth hash ciphertext set; and determining the data corresponding to the hash ciphertext matching the first hash ciphertext in the fourth hash ciphertext set, which is the intersection of the first and second datasets. The fourth private key can be the aforementioned private key key4, and the fourth hash ciphertext set can be the aforementioned hash ciphertext set B4, where B4 = {HMAC(key4, E(key1, Y...} ... i )),i∈M1}.
[0241] In some embodiments, before the terminal 200 obtains the first hash prefix set and the first hash ciphertext set, the method further includes: the terminal 200 adding a preset number of interference data to the first dataset. The preset number of interference data may be the aforementioned preset number of illegitimate account passwords.
[0242] In some embodiments, before the terminal 200 sends the first request to the server 100, the method further includes: the terminal 200 using its private key sk2 (the digital signature of the terminal 200) to obtain a first signature of a first hash prefix set and a second signature of a first hash ciphertext set; the first request also carries the first and second signatures, which are used to verify the legitimacy of the first request. Before the server 100 encrypts the hash ciphertext in the first hash ciphertext set using a second encryption method, the method further includes: the server 100 using the public key pk2 (the digital signature of the terminal 200), the first signature, and the second signature to verify the legitimacy of the first request; the encryption of the hash ciphertext in the first hash ciphertext set using the second encryption method specifically includes: when the first request is verified to be legitimate, encrypting the hash ciphertext in the first hash ciphertext set using the second encryption method. The first signature can be the aforementioned S1, and the second signature can be the aforementioned S2.
[0243] In some embodiments, before the terminal 200 obtains the first hash prefix set and the first hash ciphertext set, the method further includes: the terminal 200 sending a registration request to the server 100, the server 100 receiving the registration request sent by the terminal 200, the registration request being used to register a first service, the first service being used to obtain the intersection data of the first dataset and the second dataset; the server 100 sending a registration response to the terminal 200, the terminal 200 receiving the registration response sent by the server 100; specifically, before the terminal 200 obtains the first hash prefix set and the first hash ciphertext set, the method further includes: the terminal 200 responding to the registration response by obtaining the first hash prefix set and the first hash ciphertext set. The first service may be the aforementioned account password leakage detection service.
[0244] In some embodiments, before the terminal 200 sends the first request to the server 100, the method further includes: when the first dataset is updated, the server 100 sends a prompt message to the terminal 200, and the terminal 200 receives the prompt message sent by the server 100. The prompt message is used to prompt the terminal 200 that the second dataset has been updated.
[0245] In some embodiments, before the terminal 200 sends the first request to the server 100, the method further includes: the terminal 200 responding to the prompt message and displaying prompt information, the prompt information being used to prompt the user that the second dataset has been updated; the terminal 200 receiving the user's second input operation; the terminal 200 sending the first request to the server 100 specifically includes: the terminal 200 responding to the second input operation and sending the first request to the server 100.
[0246] In some embodiments, the data in the first dataset is personal contact information managed by the terminal, and the data in the second dataset is contact information of registered first application services obtained by the server.
[0247] In some embodiments, the data in the first dataset is application software information of the terminal, and the data in the second dataset is malicious application software information obtained by the server.
[0248] In some embodiments, the data in the first dataset consists of URLs accessed by the terminal, and the data in the second dataset consists of malicious URLs obtained by the server.
[0249] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.
[0250] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media.
[0251] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A detection method, characterized in that, Applied to terminals, including: Obtain a first hash prefix set and a first hash ciphertext set. The first hash prefix set includes the hash prefix of each data in the first dataset, and the first hash ciphertext set includes the hash ciphertext of each data in the first dataset. The hash ciphertext of the data in the first dataset is encrypted using a first encryption method. A first request is sent to the server. The first request is used to obtain the intersection of the first dataset and the server's second dataset. The first request carries the first hash prefix set and the first hash ciphertext set. The data in the first dataset is the account password managed by the terminal, and the data in the second dataset is the leaked account password obtained by the server. The system receives a second hash ciphertext set and first information sent by the server. The second hash ciphertext set is obtained by encrypting the hash ciphertext in the first hash ciphertext set using a second encryption method. The first information is used to indicate the first hash ciphertext, which is the hash ciphertext corresponding to the hash prefix that matches the first hash prefix in the hash prefix of the data in the second dataset. The first hash prefix is any hash prefix in the first hash prefix set. The hash ciphertext of the data in the second dataset is determined based on the second encryption method. The first encryption method and the second encryption method satisfy the commutative property of encryption order. The hash ciphertext in the second hash ciphertext set is decrypted using the first encryption method to obtain the decrypted third hash ciphertext set; The data corresponding to the hash ciphertext that matches the first hash ciphertext in the third hash ciphertext set is determined to be the intersection data of the first dataset and the second dataset.
2. The method according to claim 1, characterized in that, The hash ciphertext encrypted using the first encryption method and the second encryption method in sequence is equivalent to the hash ciphertext encrypted using the second encryption method and the first encryption method in sequence; for the hash ciphertext encrypted using the second encryption method and the first encryption method in sequence, it is decrypted using the second encryption method into the hash ciphertext encrypted using the first encryption method.
3. The method according to claim 2, characterized in that, The first encryption method is to encrypt using the terminal's first private key and a preset encryption algorithm; the second encryption method is to encrypt using the server's second private key and the preset encryption algorithm; the preset encryption algorithm satisfies the commutative property of operations on Abelian groups.
4. The method according to claim 3, characterized in that, The preset encryption algorithms include elliptic curve cryptography and key stream XOR encryption.
5. The method according to claim 1, characterized in that, Before obtaining the first hash prefix set and the first hash ciphertext set, the method further includes: A preset number of interference data are added to the first dataset.
6. The method according to claim 1, characterized in that, Before sending the first request to the server, the method further includes: Using the private key of the terminal's digital signature, the first signature of the first hash prefix set and the second signature of the first hash ciphertext set are obtained. The first request also carries the first signature and the second signature, which are used to detect the legitimacy of the first request.
7. A detection method, characterized in that, Applied to servers, including: Obtain the hash prefix and hash ciphertext for each data item in the second dataset, where the hash ciphertext for the data in the second dataset is determined based on the second encryption method; The receiving terminal sends a first request; the first request is used to obtain the intersection of the second dataset and the terminal's first dataset, the first request carries a first hash prefix set and a first hash ciphertext set, the first hash prefix set includes the hash prefix of each data in the first dataset, the first hash ciphertext set includes the hash ciphertext of each data in the first dataset, the hash ciphertext of the data in the first dataset is encrypted by a first encryption method; the data in the first dataset is the account password managed by the terminal, and the data in the second dataset is the leaked account password obtained by the server; The hash ciphertext in the first hash ciphertext set is encrypted using the second encryption method to generate a second hash ciphertext set; the first hash ciphertext corresponding to the hash prefix that matches the first hash prefix in the hash prefix of the data in the second dataset is retrieved, where the first hash prefix is any hash prefix in the first hash prefix set; The terminal sends the second hash ciphertext set and the first information; the second hash ciphertext set is used by the terminal to decrypt the hash ciphertext in the second hash ciphertext set using the first encryption method to obtain the decrypted third hash ciphertext set; the first information is used to indicate the first hash ciphertext, and the data corresponding to the hash ciphertext matching the first hash ciphertext in the third hash ciphertext set is the intersection data of the first dataset and the second dataset.
8. The method according to claim 7, characterized in that, The hash ciphertext encrypted using the first encryption method and the second encryption method in sequence is equivalent to the hash ciphertext encrypted using the second encryption method and the first encryption method in sequence; for the hash ciphertext encrypted using the second encryption method and the first encryption method in sequence, it is decrypted using the second encryption method into the hash ciphertext encrypted using the first encryption method.
9. The method according to claim 8, characterized in that, The first encryption method is to encrypt using the terminal's first private key and a preset encryption algorithm; the second encryption method is to encrypt using the server's second private key and the preset encryption algorithm; the preset encryption algorithm satisfies the commutative property of operations on Abelian groups.
10. The method according to claim 7, characterized in that, The first information includes a filter, and before sending the second hash ciphertext set and the first information to the terminal, the method further includes: Map the first hash ciphertext to the filter.
11. The method according to claim 7, characterized in that, The first request also carries a first signature of the first hash prefix set and a second signature of the first hash ciphertext set, wherein the first signature and the second signature are generated using the private key of the terminal's digital signature. Before encrypting the hash ciphertext in the first hash ciphertext set using the second encryption method, the method further includes: The legality of the first request is verified using the public key of the digital signature of the terminal, the first signature, and the second signature; The encryption of the hash ciphertext in the first hash ciphertext set using the second encryption method specifically includes: When the first request is verified to be valid, the hash ciphertext in the first hash ciphertext set is encrypted using the second encryption method.
12. A terminal, characterized in that, The method includes a memory and a processor, the memory and the processor being electrically coupled, the memory being used to store program instructions, and the processor being configured to invoke all or part of the program instructions stored in the memory to perform the method as described in any one of claims 1-6.
13. A server, characterized in that, The method includes a memory and a processor, the memory and the processor being electrically coupled, the memory being used to store program instructions, and the processor being configured to invoke all or part of the program instructions stored in the memory to perform the method as described in any one of claims 7-11.
14. A computer storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-6 or 7-11.
15. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-6 or 7-11.
Citation Information
Patent Citations
Weak password detection method and device
CN104933352A
Weak password detection method and device, computer equipment and service server
CN109587110A