A method for multi-party joint training of PCFG password models to protect privacy
By employing multi-party secure computation and secret sharing technologies, the problem of multiple password data holders jointly training the PCFG model without data leakage is solved, achieving more accurate and efficient password strength assessment and supporting iterative model updates.
Patent Information
- Application Number
- CN202310125409.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-16
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-02-16
AI Technical Summary
How can multiple password data holders jointly train an accurate PCFG password strength assessment model without leaking password data, especially when the data held by each party is insufficient, and how can more effective data be obtained to reduce the bias of the model assessment?
Employing multi-party secure computation technology, data is split into ciphertext through secret sharing. Participants perform operations on the ciphertext and recover the computation results without revealing the original data. The local model is merged by combining hash functions and security protocols, logarithmic computation is used to avoid numerical underflow, and the global model is iteratively updated to adapt to new data.
It enables the joint training of PCFG models with the same accuracy as training directly using all data without leaking data, providing more accurate, larger-scale, and more efficient password analysis capabilities, and supporting iterative updates of the model to adapt to the latest data.
Smart Images

Figure CN116049892B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of system security technology, specifically a method for multi-party joint training of PCFG password models to protect privacy. Background Technology
[0002] Text passwords remain the mainstream authentication method due to their convenience. A password strength measurer is a tool for assessing password security, evaluating the ability of a user-created password to resist attacks. Currently, the primary method for password strength measurers is to assess the number of guesses required for the password under a robust data-driven model. The accuracy of a password strength measurer is directly related to the strength of the data-driven model. An accurate password strength measurer helps users understand the true strength of their passwords, providing a reliable check on password security. However, current mainstream data-driven models are mainly trained by a single data holder. When a data holder possesses insufficient or incomplete data, the model trained on it may exhibit significant bias in password strength assessment.
[0003] Context-free grammars (PCFG)[1] is a data-driven model based on password templates. The initial PCFG model models passwords as components such as numbers, letters, special characters, and years. For example, the password "password123" will be decomposed into template L8D3, letter fragment "password", and number fragment "123". In the training step, it learns the structural information of the password and the frequency of each component. By learning the distribution information of the components, the PCFG model can enumerate and guess the password for password attack according to the probability from high to low. At the same time, the PCFG model can also be used to evaluate the password probability and then analyze the password strength information.
[0004] Password data is a significant factor affecting data-driven password models (such as context-free grammar models). A general data-driven password guessing model requires sufficient training data. In other words, insufficient password data will lead to a significant difference between the password distribution learned by the trained model and the actual password distribution, resulting in biased password strength evaluations. For data holders with limited password data, obtaining more effective data to train a more accurate password strength evaluation model is a challenge. To mitigate the impact of insufficient data, many small data holders hope to merge data from all parties to jointly train a robust password evaluation model. How to jointly train a password strength evaluation model while ensuring password information security is also a problem that needs to be solved.
[0005] One straightforward approach is to introduce a reliable central server to collect all password data from other password holders. However, this approach is impractical because data holders may not want their password data directly leaked. Furthermore, password holders may only have temporary access, requiring them to adhere to password security rules to ensure passwords are not stored by others. Another approach involves all data holders first training data-driven models locally, then using multi-party secure computation techniques to aggregate all local models into a global password model.
[0006] This invention relates to secret sharing technology [2], which is widely used in multi-party secure computation scenarios. Secret sharing refers to splitting data into multiple meaningless ciphertexts (generally the number of participants) in a certain way, with each participant holding one of the ciphertexts. A single participant cannot recover the original data based on the ciphertext it holds; only by combining the ciphertexts of all participants can the original data be recovered. Based on secret sharing technology, multi-party secure computation technology can support the execution of specific numerical operations under multiple secret sharing ciphertexts without leaking the original data of the operation. Specifically, multiple participants decompose their local plaintext data into multiple secret shares and send them to other participants; all participants perform function operations (such as addition, subtraction, multiplication, and division) on the secret sharing ciphertexts and recover the plaintext of the calculation results. The input data and all intermediate calculation results are invisible to the participants. Summary of the Invention
[0007] The purpose of this invention is to provide a method for jointly training a PCFG password model by multiple parties that can effectively protect the secure use of password data from multiple parties.
[0008] The present invention proposes a privacy-preserving method for multi-party joint training of the PCFG password model, such as... Figure 1 The process includes two phases: multiple participants jointly train a PCFG model based on local password data; the participants update the jointly trained PCFG model using newly collected passwords; this invention provides a solution for obtaining a more accurate PCFG model in multi-party scenarios and provides an effective means for the analysis of multi-party password data.
[0009] The requirement for privacy-preserving, multi-party jointly trained PCFG password models is to train a global PCFG model using local password data from multiple parties without directly disclosing password data. The goal of the global PCFG model is to achieve the same accuracy as a model trained directly using password data from all participants; furthermore, the model's structural and frequency information is stored in encrypted form by all participants.
[0010] The method for privacy-preserving multi-party joint training of the PCFG password model proposed in this invention includes the following specific steps:
[0011] Step 1: All participants train their local PCFG models based on local data;
[0012] Suppose there are K (K≥3) participants who want to combine password data from others to train a more accurate PCFG model. Each participant has permission to access the plaintext passwords on their local machine. Each participant trains its local PCFG model based on the local password data.
[0013] The PCFG model has the following characteristics:
[0014] (1) The PCFG model models the password as a structure composed of password templates. A password template consists of multiple password fragments;
[0015] (2) Password fragment types include letters, numbers, special characters, years, common words, etc.;
[0016] (3) In the PCFG model, password templates and password fragments are collectively referred to as password constituent units (structural information). Each constituent unit has statistically obtained frequency information.
[0017] Step 2: Merge all local PCFG models;
[0018] Based on the multiple local PCFG models trained in step one, all participants jointly train the global PCFG model, such as... Figure 2 The goal of joint training is to securely merge all local models into a global model. The steps of merging local models include merging all local password component spaces and jointly calculating the frequency information of the global components. Specifically, a hash function is used to encrypt the structural information of the global model, and a secret-sharing technique is used to encrypt the model's frequency information. Then, the participants jointly calculate the probability of each password component, which is the ratio of the frequency information of that component to the sum of the frequency information of all components of the same type. Since the statistical values are in the form of secret sharing in the global model, the calculation of probability values also needs to be performed on the secret sharing. This invention avoids the problem of probability underflow by introducing a logarithmic calculation method on the secret sharing to transform the statistical values into logarithmic form.
[0019] Specifically, due to the different backgrounds of the participants, the resulting local PCFG models exhibit significant differences in the space of password component units. Therefore, before merging frequency information, all participants need to obtain the global space of password component units. This invention uses the following steps to merge all local password component unit spaces:
[0020] (1) All participants first use a hash function to calculate the hash value of the password components. For the same components, the hash function guarantees that all participants will obtain the same hash value. The hash value of the password component will serve as the unique identifier of that component;
[0021] (2) Participants shall send their local template number, numeric character number, alphanumeric character number, special character number, letter case mask number, year number, and common word number to other participants in sequence;
[0022] (3) After the participants receive the set of all numbers, they take the union of the code sets according to the type as the global constituent unit space and store it locally.
[0023] For each unit within the global component space, all participants will jointly calculate the frequency information of the component without disclosing specific numerical values. For each password component, this invention uses the following steps to calculate the joint frequency of that unit:
[0024] (1) Each participant decomposes the frequency information of the unit locally into K secret shares using secret sharing technology, and sends each secret share to the corresponding participant. K is the number of participants in the joint training;
[0025] (2) Each participant will receive secret shares from K-1 participants; finally, the participant will add the K-1 secret shares received to its local secret share to obtain the encrypted form of the frequency of the constituent unit.
[0026] The probability of the password component is calculated by dividing its frequency by the sum of the frequencies of all components of the same type. For example, for a template-type component, template T... i The probability is calculated as follows:
[0027]
[0028] Here, Template represents the global template space. Template T j The frequency of the division operation is calculated. Simultaneously, the division operation is converted to a logarithmic subtraction operation to avoid decimal underflow. The optimized probability calculation is as follows:
[0029]
[0030] This invention uses second-order linear fitting to support logarithmic operations on secret sharing. Specifically:
[0031] Log(x) = -0.33722x 2 +1.9964x-1.65045(1≤x<2); (3).
[0032] The process by which the participating parties jointly calculate the probability of password component units in this invention is as follows:
[0033] (1) The participants sum the ciphertext of the frequency of the local storage components, that is, they sum the frequency of the global space; the encrypted ciphertext of the secret sharing supports additive homomorphism (the result of performing addition on the ciphertext is the same as the result of performing addition directly on the ciphertext), so the participants can securely sum the ciphertext of the frequency of the components without leaking the result of the frequency statistics.
[0034] (2) The participants calculate the logarithm of the frequency values of each component unit and the logarithm of the sum of frequencies in the global space based on the secure logarithm calculation protocol; the present invention adopts a second-order linear fitting method as shown in formula (3). Its function is to calculate the logarithm of the ciphertext on the secret sharing, so that the result obtained is consistent with the logarithm calculated directly on the plaintext;
[0035] (3) For each component unit, all participants subtract the logarithm of the sum of global spatial frequencies from the logarithm of the frequency values calculated above to obtain the logarithm of its probability; in this step, all intermediate results and calculation results are in the form of secret shared ciphertext, and the subtraction operation is a subtraction operation on the secret shared ciphertext.
[0036] Step 3: Iteratively update the global PCFG model;
[0037] Participants can iteratively use newly collected passwords to update the global PCFG model. The purpose of updating the model is to enable the global PCFG model to learn the characteristics of the new password data, thereby more accurately analyzing password strength. For newly collected password data, participants first decompose the passwords into password components and corresponding frequency information according to PCFG rules. Then, the update process includes updating the model's structural information and frequency information. Because the update process needs to maintain the consistency of the global model, only one participant is allowed to update the model at a time during the update operation; for example... Figure 3 As shown.
[0038] The specific steps are as follows:
[0039] (1) For newly collected password data, the participants first decompose the password into password components and corresponding frequency information according to the PCFG rules;
[0040] (2) Participants update password composition unit space;
[0041] Newly added passwords may contain new password components. To maintain synchronization of password components across all participants, this invention proposes a method for updating the password component space. Similar to training, participants encrypt the components to be updated into hash values. Each participant broadcasts the hash value to be updated, along with its component type, to all other participants. Other participants receive the hash value and type information of the password components to be updated and incorporate them into the space of the learned password components. Since the updated password data is input as a stream, the updated password components will expand the key space of the global PCFG model through batch iterative updates.
[0042] (3) Frequency of updates by participating parties;
[0043] Since frequency information in the global PCFG model is stored in a secret sharing format, the frequency to be updated must first be converted into a secret sharing format and broadcast to other participants. To avoid leaking the index of the updated frequency information, the updating party expands the updated frequency into an array of the same size as the component unit space (filled with 0s in the secret sharing format). All participants perform secure addition on the secret sharing between the frequency array to be updated and the original array of the password component unit to obtain the updated statistical array. Finally, due to the update of the statistical values, all participants need to recalculate the probability distribution according to the probability calculation method in step two.
[0044] The advantages of this invention are mainly manifested in the following aspects:
[0045] This paper proposes a feasible solution for multi-party secure password analysis by combining multi-party secure computation technology, enabling password analysis without disclosing the password data of the data holder. It also proposes to migrate context-free grammar models to multi-party computation scenarios and design a framework for training multi-party models by combining cryptographic and secret-sharing techniques, providing effective technical support for training more accurate, larger-scale, and more efficient password analysis models. Furthermore, it introduces iterative update features into the originally static password analysis model, allowing password analysts to update the trained model with the latest collected password data, thereby obtaining more timely and accurate password analysis conclusions. Attached Figure Description
[0046] Figure 1 Workflow diagram of the multi-party PCFG password model to protect privacy.
[0047] Figure 2 The flowchart for training a multi-party PCFG password model.
[0048] Figure 3 A flowchart for updating the multi-party PCFG model.
[0049] Figure 4Architecture diagram of the PCFG password model trained jointly by multiple parties to protect privacy. Detailed Implementation
[0050] The PCFG password model implemented in this invention adopts a distributed architecture. In multi-party scenarios, each participant has an independent structure and independent password data. The framework is implemented using a C++ library, relying on the GBW multi-party secure computation framework and referencing the latest PCFG v4.1 for complete coding development. Figure 4 The framework is divided into three layers: basic operators, security protocols, and the application of metrics. Basic operators include a UID hash function for encrypting password components and MPC operators that support secure computation. The implementation of the six MPC operators relies on the GBW framework.
[0051] To support both training and model update functions, this invention designs four security protocols. First, there's the union of the password component space. This protocol uses a global hash function to obtain a unified component space while ensuring the anonymity of the components. Second, there's the calculation of the global probability distribution. This invention designs protocols for statistical numerical calculation and probabilistic numerical calculation. The statistical numerical calculation protocol relies on the additive homomorphism of secret sharing while ensuring that the values during calculation are not leaked. The probabilistic numerical calculation protocol is based on GBW linear operators fitting a second-order logarithmic function and uses distributed storage to store the trained model. Third, there's the global model update. This invention designs a method for securely updating the global model's values. This method can hide the information of the update units, thus ensuring the security of the update process.
[0052] This invention uses the Cit0day dataset, comprised of multiple small websites, leaked in 2020, as experimental data. During the preprocessing stage, additional personal information and non-ASCII passwords were removed. The final Cit0day password dataset contained 3,117,245 plaintext passwords.
[0053] Performance is a crucial metric for evaluating the practicality of this invention. In the performance experiments, we considered two network scenarios: a local area network (LAN) and a wide area network (WAN). WANs have lower bandwidth (40 Mb / s) and higher transmission latency (40 ms). Experiments were conducted with 3, 5, and 7 participants. Simultaneously, tests were performed with a smaller data scale (5 × 10⁻⁶). 5 ) and in the case of a large data scale (2×10) 6 ) performance.
[0054] Regarding the performance of the training model, the experimental part controlled the total number of passwords used by the global model as the model size parameter. Experimental results show that joint training of a PCFG model with millions of records takes 0.27 to 0.88 hours under local area network (LAN) conditions, and 3.14 to 10.19 hours under wide area network (WAN) conditions. This indicates that although the use of secure multi-party computation techniques increases the time cost of training the model, the training time on datasets with millions of records is still acceptable (see Table 1 below).
[0055] Table 1
[0056]
[0057] Regarding the performance of the update model, the experimental section calculates the average time to update a batch of passwords as an indicator of the update model. This invention also analyzes the performance of password updates. To analyze the update performance under different environments, 1000 deduplicated passwords were selected from the Cit0day dataset as test data. During testing, one participant input the given test data into updating the global PCFG model, and used the time to update all passwords as the performance evaluation indicator. The experimental results show that the average time to update 1000 passwords is 0.66 seconds to 1.34 seconds in a local area network (LAN) and 1.58 seconds to 4.14 seconds in a wide area network (WAN). The experimental results indicate that the small-scale model update efficiency of this invention is relatively high, as shown in Table 2 below.
[0058] Table 2
[0059]
[0060] References
[0061] 【1】Weir,M.,Aggarwal,S.,Medeiros,Bd,Glodek,B.:Password crackingusing probabilistic context-free grammars.In:Proceedings of the 2009 30thIEEE Symposium on Security and Privacy.pp.391–405.SP'09,IEEE Computer Society, Washington, DC, USA (2009). https: / / doi.org / 10.1109 / SP.2009.8;
[0062] 【2】Ben-Or,M.,Goldwasser,S.,Wigderson,A.:Completeness theorems fornoncryptographic fault-tolerant distributed computation.In:Proceedings of theTwentieth Annual ACM Symposium on Theory of Computing.p.1–10.STOC’88,Association for Computing Machinery,New York,NY,USA(1988).
[0063] https: / / doi.org / 10.1145 / 62212.62213,https: / / doi.org / 10.1145 / 62212.62213。
Claims
1. A method for a privacy-preserving, multi-party jointly trained PCFG password model, characterized in that, Without directly disclosing password data, a global PCFG model is trained using password data from multiple parties. The goal of the global PCFG model is to achieve the same accuracy as a model trained directly using password data from all participants. Furthermore, the model's structure and frequency information are stored in encrypted form among multiple participants. The specific steps are as follows: Step 1: All participants train their local PCFG models based on local data; Suppose there are K participants who want to combine password data from others to train a more accurate PCFG model, K≥3; each participant has the right to access the local plaintext passwords; each participant trains its local PCFG model based on the local password data. The PCFG model has the following characteristics: (1) The PCFG model models the password as a structure composed of password templates; the password template is composed of multiple password fragments; (2) Password fragment types include letters, numbers, special characters, years, and common words; (3) Password templates and password fragments in the PCFG model are collectively referred to as password constituent units; each constituent unit has statistically obtained frequency information; Step 2: Securely merge all local PCFG models; Based on the multiple local PCFG models obtained in step one, all participants jointly train the global PCFG model. The goal of joint training is to securely merge all local models into a global model. The steps for merging local models include merging all local password component spaces and jointly calculating the frequency information of the global components. Specifically, a hash function is used to encrypt the structure information of the global model, and a secret-sharing technique is used to encrypt the model's frequency information. Then, the participants jointly calculate the probability of each password component. The probability of a password component is the ratio of its frequency information to the sum of the frequencies of all components of the same type. Since statistical values are in the form of secret sharing in the global model, probability calculations are performed on the secret sharing. By introducing logarithmic calculations on the secret sharing, statistical values are transformed into logarithmic values to avoid probability underflow. Step 3: Iteratively update the global PCFG model; Based on the global PCFG model obtained from step two, participants can iteratively use newly collected passwords to update the global PCFG model. The purpose of updating the model is to enable the global PCFG model to learn the characteristics of the new password data, thereby more accurately analyzing the password strength. For newly collected password data, participants first decompose the password into password components and corresponding frequency information according to PCFG rules. Then, the update process includes updating the model's structural information and updating the model's frequency information. Since the update process needs to maintain the consistency of the global model, only one participant is allowed to update the model during the update operation.
2. The method for multi-party joint training of the PCFG password model to protect privacy according to claim 1, characterized in that, In step two, the process of merging all local passwords to form a cell space is as follows: (1) All participants first use a hash function to calculate the hash value of the password components; for the same components, the hash function can guarantee that all participants can get the same hash value; the hash value of the password components will be used as the unique number of the unit. (2) Participants shall send their local template number, numeric character number, alphanumeric character number, special character number, letter case mask number, year number, and common word number to other participants in sequence; (3) After the participants receive the set of numbers, they merge the set of numbers according to type and store the result as a global component space locally.
3. The method for multi-party joint training of the PCFG password model to protect privacy according to claim 2, characterized in that, In step two, the process of jointly calculating the frequency information of the global constituent units is as follows: (1) Each participant decomposes the frequency information of the unit locally into K secret shares using secret sharing technology, and sends the corresponding secret shares to the corresponding participant; K is the number of participants in the joint training; (2) Each participant will receive secret shares from K-1 participants; finally, the participant will add the K-1 secret shares received to its local secret share to obtain the encrypted form of the frequency of the constituent unit.
4. The method for multi-party joint training of the PCFG password model to protect privacy according to claim 3, characterized in that, In step two, the participants jointly calculate the probability of each password component, that is, the ratio of the frequency of the component to the sum of the frequencies of all components of the same type. The division operation is converted to a logarithmic subtraction operation to avoid decimal underflow. The specific process is as follows: (1) The participants sum the ciphertext of the frequency of the local storage components, that is, they sum the frequency of the global space; the encrypted ciphertext of the secret sharing supports additive homomorphism, so the participants can securely sum the ciphertext of the frequency of the components without leaking the result of the frequency statistics. (2) The participants calculate the logarithm of the frequency value of each component and the logarithm of the sum of frequencies in the global space based on the secure logarithm calculation protocol; Its function is to calculate the logarithm of the ciphertext in the secret sharing, so that the result is consistent with the logarithm calculated directly on the plaintext; (3) For each component unit, all participants subtract the logarithm of the sum of global spatial frequencies from the logarithm of the frequency values calculated above to obtain the logarithm of its probability; wherein, all intermediate results and calculation results are in the form of secret shared ciphertext, and the subtraction operation is a subtraction operation on the secret shared ciphertext.
5. The method for multi-party joint training of the PCFG password model to protect privacy according to claim 4, characterized in that, In step three, the process of iteratively updating the global PCFG model is as follows: (1) For newly collected password data, the participants first decompose the password into password components and corresponding frequency information according to the PCFG rules; (2) Participants update password composition unit space; As during training, the participants encrypt the components that need to be updated into hash values; The participants broadcast the hash values and types that need to be updated to all other participants; other participants receive the hash values and type information of the password components to be updated and incorporate them into the space of the learned password components; since the updated password data is input in a streaming manner, the updated password components expand the structure space of the global PCFG model in a batch iterative update manner. (3) Participants update frequency information; Since the frequency information in the global PCFG model is stored in the form of secret sharing, the frequency to be updated is first converted into an array and encrypted into a secret sharing broadcast to all participants; All participants perform addition on the array of the frequency to be updated and the original array of the password constituent units on the secret sharing to obtain the updated statistical value; Due to the update of the statistical value, the participants recalculate the probability distribution after the value is updated.
Citation Information
Patent Citations
Password guessing set generation system and method
CN111241534A
Password strength detection method and device and model training method and device
CN115146255A