Commercial cryptographic security assessment method and system based on deep learning
Use deep learning technology to evaluate the security of commercial passwords, use hash functions and password position encoding methods to process passwords, generate vector representations, and train neural network models, which solves the accuracy and efficiency problems of traditional evaluation methods and achieves more efficiency and secure password security assessments.
Patent Information
- Application Number
- CN202411027828.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Traditional commercial password security assessment methods have problems of insufficient accuracy and low efficiency, making it difficult to quickly complete security assessments and increasing the risk of information security vulnerabilities.
Using a method based on deep learning, by obtaining a commercial password sample set, the hash function and password position encoding method are used to process the password consistently, generate a fixed-length vector representation, and use the neural network model for training to output the password strength, Vulnerability types and assessment results.
It improves the accuracy and efficiency of assessment, achieves a more objective and rapid password security assessment, enhances the real-time and adaptability of the system, and reduces the risk of original password exposure.
Smart Images

Figure CN118551364B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a commercial cryptographic security assessment method and system based on deep learning. Background Art
[0002] In today's digitalization and informatization process, commercial encryption plays a vital role as a basic means of ensuring data security. Commercial encryption is not only used to protect personal user accounts and data, but is also widely used in the secure storage and transmission of confidential information and transaction data of enterprises. Therefore, ensuring the security of commercial encryption has become an important task in the daily operations of enterprises. Before using commercial encryption, it is necessary to accurately evaluate it, determine its strength and whether there are loopholes, so as to ensure the security of commercial encryption when used.
[0003] The security assessment of commercial encryption faces multiple challenges in practical applications. In traditional assessment methods, enterprises often rely on internal teams or entrust third-party organizations to conduct regular security assessments of commercial encryption. However, traditional methods are limited by the professional ability and technical level of the assessors, resulting in the inaccuracy of the assessment results of commercial encryption. In this case, the security of commercial encryption applications cannot be effectively guaranteed, thereby increasing the risk of information security vulnerabilities. In addition, assessments conducted by internal teams or third-party organizations often have timeliness issues, making it difficult to quickly complete the security assessment of commercial encryption, thus affecting the efficiency of commercial encryption assessments.
[0004] To sum up, with the widespread application of deep learning technology in various fields and its continuous remarkable achievements, how to apply deep learning technology to the security assessment of commercial encryption to solve the problems of insufficient accuracy and low efficiency of commercial encryption security assessment in traditional assessment methods is the current challenge. Summary of the invention
[0005] This application provides a commercial encryption security assessment method and system based on deep learning, which can effectively improve the accuracy and efficiency of commercial encryption security assessment. This application provides the following technical solutions:
[0006] In a first aspect, the present application provides a commercial encryption security assessment method based on deep learning, the method comprising:
[0007] Obtain a commercial password sample set, the commercial password sample set including a vulnerable password set, a non-vulnerable password set, password strengths corresponding to the vulnerable password set and the non-vulnerable password set, and a vulnerability type corresponding to the vulnerable password set;
[0008] Using a password conversion method based on a hash function to perform consistency processing on the vulnerable password set and the non-vulnerable password set, and generating a fixed-length vector representation of the vulnerable password set and the non-vulnerable password set;
[0009] The fixed-length vector representations of the vulnerable password set and the non-vulnerable password set are used as input data, and the corresponding password strength, whether there are vulnerabilities, and specific vulnerability types are used as output to train a preset neural network model to obtain a commercial password evaluation model;
[0010] Obtaining a password to be evaluated, performing consistency processing on the password to be evaluated using a password position encoding method, and generating a fixed-length vector representation of the password to be evaluated;
[0011] The fixed-length vector representation of the password to be evaluated is input into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated.
[0012] In a specific possible implementation scheme, the using of a password conversion method based on a hash function to perform consistency processing on the vulnerable password set and the non-vulnerable password set to generate a fixed-length vector representation of the vulnerable password set and the non-vulnerable password set includes:
[0013] Set a fixed length;
[0014] Convert the commercial password into a hash value through a hash function;
[0015] Use the transformation formula to transform the hash value;
[0016] The hash value after the transformation operation is truncated into a vector representation of fixed length;
[0017] Normalize the vector representation.
[0018] In a specific possible implementation scheme, the converting of the commercial password into a hash value by a hash function and the use of a transformation formula to transform the hash value include:
[0019] All commercial passwords are converted to hash values using the SHA-256 hash function, which is as follows:
[0020] in, represents a commercial password, Represents the converted hash value;
[0021] Use the transformation formula to transform the hash value:
[0022] in, Represents a bitwise exclusive OR operation, Indicates that Shift right two places, Indicates taking The bitwise inversion of .
[0023] In a specific implementation scheme, the steps of obtaining the password to be evaluated, performing consistency processing on the password to be evaluated using the password position encoding method, and generating a fixed-length vector representation of the password to be evaluated include:
[0024] If the length of the password to be evaluated is less than the fixed length, a specific padding character or encoding value is used to supplement it; if the length of the password to be evaluated exceeds the fixed length, the fixed length of characters in front of the password to be evaluated are truncated;
[0025] Use the position encoding formula to encode each character position of the password to be evaluated. The position encoding formula is as follows:
[0026] in Indicates The positional encoding value of the character, Indicates The ASCII value of the character, It is The sine of the character position;
[0027] Combine the calculated positional encoding values into a fixed-length vector representation;
[0028] Normalize the fixed-length vector representation of the password to be evaluated.
[0029] In a specific implementation scheme, the fixed-length vector representation of the password to be evaluated is input into the commercial password evaluation model, and after the commercial password evaluation model outputs the evaluation result of the password to be evaluated, the method further includes:
[0030] Based on the vector similarity and password strength score, the commercial password that is most similar to the password to be evaluated is selected from the vulnerable password set and the non-vulnerable password set;
[0031] Obtain the evaluation results of the most similar commercial passwords and verify the evaluation results of the password to be evaluated output by the model.
[0032] In a specific possible implementation scheme, the method of selecting the commercial password that is most similar to the password to be evaluated from the vulnerable password set and the non-vulnerable password set based on the vector similarity and the password strength score includes:
[0033] The cosine similarity is used to calculate the vector similarity between the vector representation of the password to be evaluated and the vector representation of all commercial passwords in the vulnerable password set and the non-vulnerable password set, which is recorded as the first similarity. :
[0034] in, is the vector representation of the sample to be evaluated, is the vector representation of a commercial password in the set of vulnerable passwords and the set of non-vulnerable passwords, and Respectively and The norm of ;
[0035] The following formula is used to calculate the password strength score of the password to be evaluated and the absolute value difference between the password strength scores of all commercial passwords in the vulnerable password set and the non-vulnerable password set is recorded as the second similarity. :
[0036] in is the password strength score of the password to be evaluated, The password strength score of a commercial password in the vulnerable password set and the non-vulnerable password set;
[0037] The final similarity between the password to be evaluated and all commercial passwords in the vulnerable password set and the non-vulnerable password set is calculated using the following formula: :
[0038] in is a weight parameter between 0 and 1;
[0039] After calculating the final similarities between all commercial passwords in the vulnerable password set and the non-vulnerable password set and the password to be evaluated, the commercial password corresponding to the largest final similarity is the commercial password most similar to the password to be evaluated.
[0040] In a specific implementation scheme, obtaining the evaluation result of the most similar commercial password and verifying the evaluation result of the password to be evaluated output by the model includes:
[0041] When the model outputs the evaluation result of the password to be evaluated as no vulnerability, if the evaluation result of the most similar commercial password does not have a vulnerability, the evaluation result output by the model is the final evaluation result; if the evaluation result of the most similar commercial password is that there is a vulnerability, the vector representation of the password to be evaluated is re-input into the commercial password evaluation model. If the evaluation result output by the model is still no vulnerability after the preset number of re-inputs, the evaluation result output by the model for the last time is taken as the final evaluation result; if the evaluation result output by the model for the first time after the re-input within the preset number of times has a vulnerability, it is determined that the evaluation result of the password to be evaluated has a vulnerability, and the vulnerability output by the model and the vulnerability in the evaluation result of the most similar commercial password are combined as the final evaluation result;
[0042] When the model outputs the evaluation result of the password to be evaluated as having a vulnerability, if the evaluation result of the most similar commercial password has a vulnerability, it is determined that the evaluation result of the password to be evaluated has a vulnerability, and the vulnerability output by the model and the vulnerability in the evaluation result of the most similar commercial password are merged as the final evaluation result; if the evaluation result of the most similar commercial password is that there is no vulnerability, the vector representation of the password to be evaluated is re-input into the commercial password evaluation model. If the evaluation result output by the model is still that there is a vulnerability after re-inputting a preset number of times, the evaluation result output by the model for the last time is taken as the final evaluation result; if the evaluation result output by the model for two consecutive times after re-input within the preset number of times is that there is no vulnerability, the evaluation result output by the model for the last time is taken as the final evaluation result.
[0043] In the second aspect, the present application provides a commercial cryptographic security assessment system based on deep learning, which adopts the following technical solutions:
[0044] A commercial cryptographic security assessment system based on deep learning, comprising:
[0045] A sample set acquisition module, used to acquire a commercial password sample set, wherein the commercial password sample set includes a vulnerable password set, a non-vulnerable password set, the password strengths corresponding to the vulnerable password set and the non-vulnerable password set, and the vulnerability type corresponding to the vulnerable password set;
[0046] A sample set vector generation module, used to perform consistency processing on the vulnerable password set and the non-vulnerable password set using a password conversion method based on a hash function, and generate fixed-length vector representations of the vulnerable password set and the non-vulnerable password set;
[0047] An evaluation model building module is used to train a preset neural network model using the fixed-length vector representations of the vulnerable password set and the non-vulnerable password set as input data and the corresponding password strength, the presence or absence of vulnerabilities, and the specific vulnerability types as outputs to obtain a commercial password evaluation model;
[0048] A password vector generation module, used to obtain a password to be evaluated, perform consistency processing on the password to be evaluated using a password position encoding method, and generate a fixed-length vector representation of the password to be evaluated;
[0049] An evaluation result output module is used to input the fixed-length vector representation of the password to be evaluated into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated.
[0050] In a third aspect, the present application provides an electronic device, comprising a processor and a memory; the memory stores a program, and the program is loaded and executed by the processor to implement a commercial cryptographic security assessment method based on deep learning as described in the first aspect.
[0051] In a fourth aspect, the present application provides a computer-readable storage medium, in which a program is stored. When the program is executed by a processor, it is used to implement a commercial cryptographic security assessment method based on deep learning as described in the first aspect.
[0052] In summary, the beneficial effects of this application include at least:
[0053] 1) By using deep learning model training and combining multi-dimensional information such as password strength and vulnerability type for evaluation, the comprehensiveness and accuracy of the evaluation are greatly improved. Traditional methods often rely on expert evaluation, while this method can be trained based on a large number of actual commercial password samples, overcoming the subjectivity and limitations of traditional methods, making the evaluation results more objective and accurate.
[0054] 2) The deep learning-based model has the ability to dynamically train in real time, and can regularly update the commercial password sample set and retrain the model to respond to changes in the password security environment and emerging security vulnerabilities. This real-time and adaptable nature ensures that the evaluation results can always reflect the current password security status, improving the system's response capabilities and sustainability.
[0055] 3) The password is processed consistently using hash functions and password position encoding methods to generate a fixed-length vector representation, which effectively protects the security of the original password. This processing method reduces the risk of directly exposing the original password, and at the same time provides a unified input format for the deep learning model while ensuring data security, thereby improving the overall security and credibility of the evaluation system.
[0056] By collecting a sample set of commercial passwords, including passwords with and without vulnerabilities, each password is equipped with a password strength and vulnerability type label. This step solves the limitations of traditional evaluation methods that rely on professional evaluators and time sensitivity, and ensures the diversity and integrity of evaluation data. Secondly, a password conversion method based on hash functions is used to perform consistency processing on commercial passwords to generate a fixed-length vector representation. Such processing improves the security and consistency of password data, reduces the risk of directly exposing the original password, and provides a unified input format for subsequent model training. Subsequently, these fixed-length vector representations are trained using a preset neural network model. The input is the vector representation of the password, and the output is the evaluation results of the password's strength, whether there is a vulnerability, and the specific vulnerability type. This method solves the problems of insufficient accuracy and inefficiency in traditional evaluation methods, and improves the accuracy and speed of evaluation through deep learning technology. Finally, the password to be evaluated is processed for consistency using the password position encoding method to generate its fixed-length vector representation, which is then input into the commercial password evaluation model. The model outputs the security evaluation results of the password to be evaluated, thereby effectively responding to the security challenges of commercial passwords in a digital environment and improving the comprehensiveness and real-time nature of password security evaluation.
[0057] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flow chart of a commercial encryption security assessment method based on deep learning in an embodiment of the present application.
[0059] Figure 2 It is a flowchart of using a password conversion method based on a hash function to perform consistency processing on a password set with vulnerabilities and a password set without vulnerabilities in an embodiment of the present application.
[0060] Figure 3 This is an example diagram of using a hash function-based padded password conversion method in an embodiment of the present application to perform consistency processing on a set of vulnerable passwords and a set of non-vulnerable passwords.
[0061] Figure 4 It is a flowchart of using the password position encoding method to perform consistency processing on the password to be evaluated in an embodiment of the present application.
[0062] Figure 5 This is an example diagram of using the password position encoding method to perform consistency processing on the password to be evaluated in an embodiment of the present application.
[0063] Figure 6It is a schematic diagram of the overall process of the commercial encryption security assessment method based on deep learning in the embodiment of the present application.
[0064] Figure 7 It is a structural block diagram of a commercial cryptographic security assessment system based on deep learning in an embodiment of the present application.
[0065] Figure 8 It is a block diagram of an electronic device for commercial cryptographic security assessment based on deep learning in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.
[0067] Optionally, the present application takes the deep learning-based commercial cryptographic security assessment method provided in each embodiment as an example of being used in an electronic device, where the electronic device is a terminal or a server. The terminal may be a computer, a tablet computer, etc. This embodiment does not limit the type of electronic device.
[0068] Reference Figure 1 , is a flowchart of a commercial encryption security assessment method based on deep learning provided by an embodiment of the present application, the method comprising at least the following steps:
[0069] Step S101, obtaining a commercial password sample set, the commercial password sample set including a vulnerable password set, a non-vulnerable password set, the password strengths corresponding to the vulnerable password set and the non-vulnerable password set, and the vulnerability type corresponding to the vulnerable password set.
[0070] Step S102: Use a password conversion method based on a hash function to perform consistency processing on the vulnerable password set and the non-vulnerable password set to generate fixed-length vector representations of the vulnerable password set and the non-vulnerable password set.
[0071] Step S103, using the fixed-length vector representation of the vulnerable password set and the non-vulnerable password set as input data, and the corresponding password strength, presence or absence of vulnerabilities and specific vulnerability types as output to train the preset neural network model to obtain a commercial password evaluation model.
[0072] Step S104: Obtain the password to be evaluated, use the password position encoding method to perform consistency processing on the password to be evaluated, and generate a fixed-length vector representation of the password to be evaluated.
[0073] Step S105: input the fixed-length vector representation of the password to be evaluated into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated.
[0074] This application first collects a sample set of commercial passwords, including passwords with and without vulnerabilities, and each password is equipped with a password strength and vulnerability type label. This step solves the limitations of traditional evaluation methods that rely on professional evaluators and time sensitivity, and ensures the diversity and integrity of evaluation data. Secondly, a password conversion method based on a hash function is used to perform consistency processing on commercial passwords to generate a fixed-length vector representation. Such processing improves the security and consistency of password data, reduces the risk of directly exposing the original password, and provides a unified input format for subsequent model training. Subsequently, these fixed-length vector representations are trained using a preset neural network model, the input is the vector representation of the password, and the output is the evaluation results of the strength of the password, whether there is a vulnerability, and the specific vulnerability type. This method solves the problems of insufficient accuracy and inefficiency in traditional evaluation methods, and improves the accuracy and speed of evaluation through deep learning technology. Finally, the password to be evaluated is processed for consistency using the password position encoding method, and its fixed-length vector representation is generated and input into the commercial password evaluation model. The model outputs the security evaluation results of the password to be evaluated, thereby effectively responding to the security challenges of commercial passwords in a digital environment and improving the comprehensiveness and real-time nature of password security evaluation.
[0075] In step S101, the commercial password sample set includes a vulnerable password set, a non-vulnerable password set, the password strengths corresponding to the vulnerable password set and the non-vulnerable password set, and the vulnerability types corresponding to the vulnerable password set. The vulnerable password set includes a number of commercial passwords known to have security vulnerabilities, and the password strengths and vulnerability types corresponding to all commercial passwords in the vulnerable password set are recorded. The non-vulnerable password set includes a number of commercial passwords known to have no security vulnerabilities, and the password strengths corresponding to all commercial passwords in the non-vulnerable password set are recorded. For example, a commercial password with a security vulnerability has a password strength score of 15 points, which is a weak password and has a security vulnerability in which the password has been leaked. A commercial password without a security vulnerability has a password strength score of 60 points, which is a medium password and has no security vulnerability. In implementation, the strength of all commercial passwords in the vulnerable password set and the non-vulnerable password set is evaluated by an open source password strength assessment tool to obtain the corresponding password strength scores and their corresponding strengths, such as assessment tools such as zxcvbn.
[0076] Optionally, the commercial password sample set can be obtained through a public commercial password database and security report, or through research materials on commercial passwords. This application does not limit the method of obtaining the commercial password sample set.
[0077] In addition, as a preferred embodiment, a pre-built distributed storage database is used to store and manage the commercial password sample set, the vulnerable password set and the non-vulnerable password set are stored and managed separately, and the open source password strength assessment tool is integrated into the distributed storage database, so as to realize the automatic assessment operation of password strength. In addition, the distributed storage database regularly obtains new commercial password sample sets through automated scripts to update the commercial password sample sets.
[0078] Reference Figure 2 , is a flow chart of using a password conversion method based on a hash function to perform consistency processing on a set of vulnerable passwords and a set of non-vulnerable passwords in an embodiment of the present application, the method comprising at least the following steps:
[0079] Step S1021, setting a fixed length.
[0080] The fixed length will be used as the length of the vector representation finally generated. Optionally, the fixed length is generally 16 characters, and can also be selected as 32 characters. This application does not impose any restrictions on the fixed length.
[0081] Step S1022: Convert the commercial password into a hash value through a hash function.
[0082] In the implementation, all commercial passwords in the vulnerable password set and the non-vulnerable password set are hashed and converted into hash values using the SHA-256 hash function. The SHA-256 hash function is as follows:
[0083] in, represents a commercial password, Indicates the converted hash value, usually 64 characters.
[0084] Optionally, the present application selects SHA-256 as the hash function, and other types of hash functions, such as SHA-1 or MD5, etc., may also be selected. The present application does not limit the specific type of hash function.
[0085] Step S1023: Use the following transformation formula to transform the hash value:
[0086] in, Represents a bitwise exclusive OR operation, Indicates that Shift right two places, Indicates taking The bitwise XOR operation is a commonly used bit operation that can introduce a certain degree of randomness and obfuscation while maintaining the integrity of the data structure. This helps to enhance the security of cryptographic data, making it difficult to easily infer the content of the original data through simple observation. Shifting the hash value right by two bits can slightly change the information on each bit. This operation can increase the complexity of the hash value, making it difficult to reversely infer the characteristics of the original data from the transformed value. The bitwise inversion operation can change each bit of the hash value from 0 to 1, or from 1 to 0. The above operation introduces a clear obfuscation effect, making it more difficult to establish a direct connection between the transformed hash value and the original data. Through these operations, the generated It is not just a simple hash value, but the result after complex transformation, which increases the security of password data, making it difficult for attackers to infer the original password information even if the transformed value is leaked. In addition, the transformation operation introduces nonlinearity and randomness, which improves the expressiveness of the data, which is important for machine learning models because it can make the input data more diverse and complex, thereby improving the generalization ability of the model and the accuracy of security assessment. The design of the transformation formula takes into account the needs of security enhancement, improved data expression ability and input consistency. Through such a design, hash values can be effectively processed and vector representations with uniform length and high security can be generated, which is more suitable for password security assessment and other related applications.
[0087] Step S1024: truncate the hash value after the transformation operation into a vector representation of a fixed length.
[0088] It is worth noting that, since the fixed length is set to 16 characters and the hash value is set to 64 characters in the present application, there will be no padding operation on the vector of the hash value after the transformation operation.
[0089] Step S1025: normalize the vector representation.
[0090] In practice, by normalizing the truncated vector representation, the value range of all vector representations can be kept within a certain range as much as possible. Normalization helps prevent the influence of too large or too small value range on subsequent model training, and enhances the stability and consistency of the data.
[0091] Reference Figure 3, is an example diagram of using a hash function-based padded password conversion method to perform consistency processing on a vulnerable password set and a non-vulnerable password set in an embodiment of the present application, and the figure shows the processing process of vulnerable passwords and non-vulnerable passwords respectively. In step S102, since the subsequent model training is involved, all commercial passwords in the vulnerable password set and the non-vulnerable password set are converted into a fixed-length vector representation, so that the input data of the subsequent model has the same dimension and length. The uniform length of data not only makes the data processing of each batch more efficient, because there is no need for dynamic adjustment within the batch. In addition, fixed-length data can make full use of vectorization and parallel computing technology to improve the speed of training and reasoning, thereby reducing the waste of computing resources.
[0092] In step S103, the commercial password evaluation model generated by training the preset neural network model with the commercial password sample set is trained dynamically and in real time. Since the commercial password sample set is updated regularly, the commercial password evaluation model is re-acquired and trained with a new commercial password sample set at regular intervals, so as to ensure the training intensity and evaluation accuracy of the model as much as possible.
[0093] Optionally, a convolutional neural network is selected as the preset neural network model in this application because convolutional neural networks have good performance in natural language processing tasks. Other types of neural networks can also be used. This application does not limit the specific type of the neural network model.
[0094] In step S104, the password position encoding method is a method of converting the password into a fixed-length vector representation by character-by-character processing, position encoding, flexible padding, and real-time standardization. Figure 4 , is a flow chart of using the password position encoding method to perform consistency processing on the password to be evaluated in an embodiment of the present application, the method includes at least the following steps:
[0095] S1041: If the length of the password to be evaluated is less than the fixed length, a specific padding character or encoding value is used to supplement it. If the length of the password to be evaluated exceeds the fixed length, the fixed-length characters in front of the password to be evaluated are intercepted.
[0096] In implementation, if the length of the password to be evaluated is less than the set fixed length, it is necessary to use specific padding characters or encoding values to supplement it to ensure that the fixed length requirement is met. The padding character can be selected as any character, usually a space or other symbol. The choice of padding character should not affect the subsequent position encoding process, because the position encoding formula mainly depends on the ASCII value and position information of the character. If the length of the password to be evaluated exceeds the set fixed length, it is necessary to intercept the first fixed-length character part of the password to be evaluated. This can ensure to a certain extent that the subsequent position encoding and vector representation generation steps can process data of the same length, avoiding unnecessary complexity and data processing problems.
[0097] S1042. Use a position encoding formula to encode each character position of the password to be evaluated.
[0098] Specifically, the position encoding formula is as follows:
[0099] in Indicates The positional encoding value of the character, Indicates The ASCII value of the character, It is The sine value of the character position, the above position encoding formula is designed in the process, the sine function The introduction of nonlinear features helps introduce a certain amount of variation and randomness in the position encoding, increasing the diversity of vector representations. Indicates the ASCII value of a character, which directly expresses the basic information of the character. The encoded information representing the character position can help the model understand the relative position of the characters in the password.
[0100] S1043. Combine the calculated position encoding values into a vector representation of a fixed length.
[0101] Specifically, the position encoding value of each character Composed of fixed-length vector representations.
[0102] S1044. Standardize the fixed-length vector representation of the password to be evaluated.
[0103] Specifically, the generated fixed-length vector representation is normalized to ensure that all vector values are within the same range as much as possible.
[0104] In step S104, refer to Figure 5, is an example diagram of using the password position encoding method to perform consistency processing on the password to be evaluated in an embodiment of the present application, and the processing process of the password to be evaluated is respectively shown in the figure.
[0105] In addition, as a preferred embodiment, the processing method of step S104 is applicable to single data, each password is processed independently, and the position coding formula generates a unique position coding value for each character. This design retains the specific position information of each character in the password and is not affected by other passwords. This is very critical for the processing of single password data because it ensures that each password has its unique feature representation and will not be confused with the processing of other passwords. The processing method of step S102 is applicable to multiple data, and a large number of commercial passwords can be quickly converted into hash values of fixed length using hash functions. The calculation of hash functions is usually efficient, and the conversion operation can be completed in a reasonable time even when processing a large amount of data. The transformation formula introduces operations such as bitwise XOR, right shift and bitwise inversion, which increases the complexity and randomness of the hash value. This complexity makes it difficult for the generated vector representation to be reversely inferred to the original password information even when processing a large amount of data, thereby enhancing the security of the data.
[0106] In step S105, the vector representation of the password to be evaluated is input into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated. The evaluation result includes the password strength score of the password to be evaluated and its corresponding strength. If there is no vulnerability, it also outputs "no vulnerability", and if there is a vulnerability, it also outputs the specific vulnerability type.
[0107] Reference Figure 6 , is a schematic diagram of the overall process of a commercial password security assessment method based on deep learning provided by an embodiment of the present application. In this embodiment, in addition to the aforementioned steps S101 to S105, the commercial password security assessment method also includes:
[0108] Step S106: Filter out the commercial password that is most similar to the password to be evaluated from the vulnerable password set and the non-vulnerable password set based on the vector similarity and the password strength score.
[0109] Specifically, the cosine similarity is first used to calculate the vector similarity between the vector representation of the password to be evaluated and the vector representation of all commercial passwords in the vulnerable password set and the non-vulnerable password set, which is recorded as the first similarity. :
[0110] in, is the vector representation of the sample to be evaluated, is the vector representation of a commercial password in the set of vulnerable passwords and the set of non-vulnerable passwords, and Respectively and The norm of . It should be noted that the vector representations of the two are still in the same fixed length. Then the following formula is used to calculate the absolute value difference between the password strength score of the password to be evaluated and the password strength scores of all commercial passwords in the vulnerable password set and the non-vulnerable password set, which is recorded as the second similarity :
[0111] in is the password strength score of the password to be evaluated, is the password strength score of a commercial password in the vulnerable password set and the non-vulnerable password set. Finally, the following formula is used to calculate the final similarity between the password to be evaluated and all commercial passwords in the vulnerable password set and the non-vulnerable password set. :
[0112] in is a weight parameter between 0 and 1, which is used to balance the effects of cosine similarity and password strength score difference. The above formula takes into account both cosine similarity and password strength score difference. Cosine similarity reflects the geometric similarity between vector representations, while password strength score difference reflects the difference in password security and complexity. This comprehensive consideration can more comprehensively evaluate the similarity between passwords. After calculating the final similarity of all commercial passwords in the vulnerable password set and the non-vulnerable password set with the password to be evaluated by the above calculation method, the commercial password corresponding to the maximum final similarity is the commercial password most similar to the password to be evaluated. It is not reasonable to judge the most similar commercial password only by the similarity of the password structure. Therefore, the password strength score is introduced to make the password strength of the most similar commercial password match the password to be evaluated as much as possible, so that the most similar commercial password found is also more accurate to a certain extent.
[0113] In addition, as a preferred embodiment, the present application calculates the first similarity In addition to the above method, you can also use the following method to achieve better results: first use cosine similarity to calculate the vector similarity between the vector representation of the password to be evaluated and the vector representation of all commercial passwords in the vulnerable password set and the non-vulnerable password set, and then use the Gaussian kernel function to calculate the vector similarity between the vector representation of the password to be evaluated and the vector representation of all commercial passwords in the vulnerable password set and the non-vulnerable password set. The calculation formula is as follows:
[0114] in, is a parameter that controls the decay rate of the kernel function. is the vector representation of the sample to be evaluated, It is the vector representation of a commercial password in the set of vulnerable passwords and the set of non-vulnerable passwords. Finally, the two calculated vector similarities are added and the average is taken as the first similarity. . By combining cosine similarity and kernel function, the value of the first similarity is obtained. Cosine similarity measures the geometric similarity between vectors and is applicable to vectors in Euclidean space. Kernel function can perform nonlinear mapping and map data to a higher-dimensional space to capture more complex relationships. Combining the two, it is possible to consider both geometric features and higher-dimensional features when evaluating similarity. Both cosine similarity and kernel function can be mapped to a value range of 0 to 1, which makes their results intuitively interpreted as a measure of similarity, with larger values indicating higher similarity. The properties of cosine similarity and kernel function are that the larger the value, the more similar, that is, when the value is close to 1, the similarity is higher, which is consistent with the intuitive understanding of similarity measurement in practical applications. Using cosine similarity or kernel function alone may show limitations due to different data characteristics. Combining the two can make up for their respective shortcomings and improve the comprehensiveness and accuracy of similarity evaluation. In summary, by first using cosine similarity calculation, then applying kernel function for mapping, and finally averaging, geometric features and higher-dimensional features can be effectively combined to improve the comprehensiveness and accuracy of similarity evaluation.
[0115] Step S107: Obtain the evaluation result of the most similar commercial password and verify the evaluation result of the password to be evaluated output by the model.
[0116] Specifically, when the model outputs the evaluation result of the password to be evaluated as no vulnerability, if the evaluation result of the most similar commercial password is also no vulnerability, then the evaluation result output by the model is the final evaluation result. If the evaluation result of the most similar commercial password is that there is a vulnerability, then the vector representation of the password to be evaluated is re-input into the commercial password evaluation model. If the evaluation result output by the model is still no vulnerability after the preset number of re-inputs, then the evaluation result output by the model for the last time is used as the final evaluation result. If the evaluation result output by the model for the first time after the re-input within the preset number of times has a vulnerability, then it is determined that there is a vulnerability in the evaluation result of the password to be evaluated, and the vulnerability output by the model and the vulnerability in the evaluation result of the most similar commercial password are combined as the final evaluation result.
[0117] When the model outputs the evaluation result of the password to be evaluated as having a vulnerability, if the evaluation result of the most similar commercial password is that there is a vulnerability, then the evaluation result of the password to be evaluated is judged to have a vulnerability, and the vulnerability output by the model and the vulnerability in the evaluation result of the most similar commercial password are merged as the final evaluation result. If the evaluation result of the most similar commercial password is that there is no vulnerability, then the vector representation of the password to be evaluated is re-input into the commercial password evaluation model. If the evaluation result output by the model is still that there is a vulnerability after the preset number of re-inputs, the evaluation result output by the model for the last time is taken as the final evaluation result. If the evaluation result output by the model for two consecutive times after the preset number of re-inputs is that there is no vulnerability, then the evaluation result output by the model for the last time is taken as the final evaluation result.
[0118] Figure 7 This is a structural block diagram of a commercial cryptographic security assessment system based on deep learning provided by an embodiment of the present application. The device includes at least the following modules:
[0119] The sample set acquisition module is used to obtain a commercial password sample set, which includes a vulnerable password set, a non-vulnerable password set, the password strengths corresponding to the vulnerable password set and the non-vulnerable password set, and the vulnerability type corresponding to the vulnerable password set.
[0120] The sample set vector generation module is used to use a password conversion method based on a hash function to perform consistency processing on a vulnerable password set and a non-vulnerable password set, and generate a fixed-length vector representation of the vulnerable password set and the non-vulnerable password set.
[0121] The evaluation model building module is used to train the preset neural network model with fixed-length vector representations of vulnerable password sets and non-vulnerable password sets as input data, and the corresponding password strength, presence or absence of vulnerabilities and specific vulnerability types as outputs to obtain a commercial password evaluation model.
[0122] The password vector generation module is used to obtain the password to be evaluated, use the password position encoding method to perform consistency processing on the password to be evaluated, and generate a fixed-length vector representation of the password to be evaluated.
[0123] The evaluation result output module is used to input the fixed-length vector representation of the password to be evaluated into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated.
[0124] For relevant details, refer to the above method embodiment.
[0125] Figure 8 4 is a block diagram of an electronic device provided by an embodiment of the present application. The device at least includes a processor 401 and a memory 402.
[0126] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0127] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, which is used to be executed by the processor 401 to implement the commercial cryptographic security assessment method based on deep learning provided in the method embodiment of the present application.
[0128] In some embodiments, the electronic device may further optionally include: a peripheral device interface and at least one peripheral device. The processor 401, the memory 402 and the peripheral device interface may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface via a bus, a signal line or a circuit board. Schematically, the peripheral devices include but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply.
[0129] Of course, the electronic device may also include fewer or more components, which is not limited in this embodiment.
[0130] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the commercial cryptographic security assessment method based on deep learning of the above method embodiment.
[0131] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the commercial cryptographic security assessment method based on deep learning of the above method embodiment.
[0132] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0133] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A commercial encryption security assessment method based on deep learning, characterized in that: The method comprises: Obtain a commercial password sample set, the commercial password sample set including a vulnerable password set, a non-vulnerable password set, password strengths corresponding to the vulnerable password set and the non-vulnerable password set, and a vulnerability type corresponding to the vulnerable password set; Using a cryptographic conversion method based on a hash function to perform consistency processing on the vulnerable password set and the non-vulnerable password set, and generating a fixed-length vector representation of the vulnerable password set and the non-vulnerable password set; Using a cryptographic conversion method based on a hash function to perform consistency processing on the vulnerable password set and the non-vulnerable password set, and generating a fixed-length vector representation of the vulnerable password set and the non-vulnerable password set includes: setting a fixed length; converting a commercial password into a hash value through a hash function; using a transformation formula to transform the hash value; truncating the hash value after the transformation operation into a fixed-length vector representation; and standardizing the vector representation; The converting of the commercial password into a hash value by a hash function and the use of a transformation formula to transform the hash value include: using a SHA-256 hash function to convert all commercial passwords into hash values, and the SHA-256 hash function is as follows: in, represents a commercial password, Represents the converted hash value; Use the transformation formula to transform the hash value: in, Represents a bitwise exclusive OR operation, Indicates that Shift right two places, Indicates taking The bitwise inversion of ; The fixed-length vector representations of the vulnerable password set and the non-vulnerable password set are used as input data, and the corresponding password strength, whether there are vulnerabilities, and specific vulnerability types are used as output to train a preset neural network model to obtain a commercial password evaluation model; Obtain a password to be evaluated, perform consistency processing on the password to be evaluated using a password position coding method, and generate a fixed-length vector representation of the password to be evaluated; the obtaining of the password to be evaluated, performing consistency processing on the password to be evaluated using a password position coding method, and generating a fixed-length vector representation of the password to be evaluated includes: if the length of the password to be evaluated is less than the fixed length, using a padding character or a coding value to supplement it; if the length of the password to be evaluated exceeds the fixed length, intercepting the fixed-length characters in front of the password to be evaluated; using a position coding formula to encode each character position of the password to be evaluated, the position coding formula is as follows: in Indicates The positional encoding value of the character, Indicates The ASCII value of the character, It is The sine value of the character position; combining the calculated position code values into a fixed-length vector representation; and normalizing the fixed-length vector representation of the password to be evaluated; The fixed-length vector representation of the password to be evaluated is input into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated.
2. The commercial password security assessment method based on deep learning according to claim 1 is characterized in that: After the fixed-length vector representation of the password to be evaluated is input into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated, the method further includes: Based on the vector similarity and password strength score, the commercial password that is most similar to the password to be evaluated is selected from the vulnerable password set and the non-vulnerable password set; Obtain the evaluation results of the most similar commercial passwords and verify the evaluation results of the password to be evaluated output by the model.
3. The commercial password security assessment method based on deep learning according to claim 2 is characterized in that: The commercial passwords most similar to the password to be evaluated are selected from the vulnerable password set and the non-vulnerable password set based on the vector similarity and the password strength score, including: The cosine similarity is used to calculate the vector similarity between the vector representation of the password to be evaluated and the vector representation of all commercial passwords in the vulnerable password set and the non-vulnerable password set, which is recorded as the first similarity. : in, is the vector representation of the sample to be evaluated, is the vector representation of a commercial password in the set of vulnerable passwords and the set of non-vulnerable passwords, and Respectively and The norm of ; The following formula is used to calculate the password strength score of the password to be evaluated and the absolute value difference between the password strength scores of all commercial passwords in the vulnerable password set and the non-vulnerable password set is recorded as the second similarity. : in is the password strength score of the password to be evaluated, The password strength score of a commercial password in the vulnerable password set and the non-vulnerable password set; The final similarity between the password to be evaluated and all commercial passwords in the vulnerable password set and the non-vulnerable password set is calculated using the following formula: : in is a weight parameter between 0 and 1; After calculating the final similarities between all commercial passwords in the vulnerable password set and the non-vulnerable password set and the password to be evaluated, the commercial password corresponding to the largest final similarity is the commercial password most similar to the password to be evaluated.
4. The commercial password security assessment method based on deep learning according to claim 2 is characterized in that: The obtaining of the evaluation result of the most similar commercial password and verifying the evaluation result of the password to be evaluated output by the model includes: When the model outputs the evaluation result of the password to be evaluated as no vulnerability, if the evaluation result of the most similar commercial password does not have a vulnerability, the evaluation result output by the model is the final evaluation result; if the evaluation result of the most similar commercial password is that there is a vulnerability, the vector representation of the password to be evaluated is re-input into the commercial password evaluation model. If the evaluation result output by the model is still no vulnerability after the preset number of re-inputs, the evaluation result output by the model for the last time is taken as the final evaluation result; if the evaluation result output by the model for the first time after the re-input within the preset number of times has a vulnerability, it is determined that the evaluation result of the password to be evaluated has a vulnerability, and the vulnerability output by the model and the vulnerability in the evaluation result of the most similar commercial password are combined as the final evaluation result; When the model outputs the evaluation result of the password to be evaluated as having a vulnerability, if the evaluation result of the most similar commercial password has a vulnerability, it is determined that the evaluation result of the password to be evaluated has a vulnerability, and the vulnerability output by the model and the vulnerability in the evaluation result of the most similar commercial password are merged as the final evaluation result; if the evaluation result of the most similar commercial password is that there is no vulnerability, the vector representation of the password to be evaluated is re-input into the commercial password evaluation model. If the evaluation result output by the model is still that there is a vulnerability after re-inputting a preset number of times, the evaluation result output by the model for the last time is taken as the final evaluation result; if the evaluation result output by the model for two consecutive times after re-input within the preset number of times is that there is no vulnerability, the evaluation result output by the model for the last time is taken as the final evaluation result.
5. A commercial cryptographic security assessment system based on deep learning, characterized in that: include: A sample set acquisition module, used to acquire a commercial password sample set, wherein the commercial password sample set includes a vulnerable password set, a non-vulnerable password set, the password strengths corresponding to the vulnerable password set and the non-vulnerable password set, and the vulnerability type corresponding to the vulnerable password set; A sample set vector generation module, used for using a cryptographic conversion method based on a hash function to perform consistency processing on the vulnerable password set and the non-vulnerable password set, and generating fixed-length vector representations of the vulnerable password set and the non-vulnerable password set; using the cryptographic conversion method based on a hash function to perform consistency processing on the vulnerable password set and the non-vulnerable password set, and generating fixed-length vector representations of the vulnerable password set and the non-vulnerable password set includes: setting a fixed length; converting a commercial password into a hash value through a hash function; performing a transformation operation on the hash value using a transformation formula; truncating the hash value after the transformation operation into a vector representation of a fixed length; and performing standardization processing on the vector representation; The converting of the commercial password into a hash value by a hash function and the use of a transformation formula to transform the hash value include: using a SHA-256 hash function to convert all commercial passwords into hash values, and the SHA-256 hash function is as follows: in, represents a commercial password, Represents the converted hash value; Use the transformation formula to transform the hash value: in, Represents a bitwise exclusive OR operation, Indicates that Shift right two places, Indicates taking The bitwise inversion of ; An evaluation model building module is used to train a preset neural network model using the fixed-length vector representations of the vulnerable password set and the non-vulnerable password set as input data and the corresponding password strength, the presence or absence of vulnerabilities, and the specific vulnerability types as outputs to obtain a commercial password evaluation model; A password vector generation module is used to obtain a password to be evaluated, perform consistency processing on the password to be evaluated using a password position coding method, and generate a fixed-length vector representation of the password to be evaluated; the obtaining of the password to be evaluated, performing consistency processing on the password to be evaluated using a password position coding method, and generating a fixed-length vector representation of the password to be evaluated includes: if the length of the password to be evaluated is less than the fixed length, using a padding character or a coding value to supplement it; if the length of the password to be evaluated exceeds the fixed length, intercepting the fixed-length characters in front of the password to be evaluated; using a position coding formula to encode each character position of the password to be evaluated, the position coding formula is as follows: in Indicates The positional encoding value of the character, Indicates The ASCII value of the character, It is The sine value of the character position; combining the calculated position code values into a fixed-length vector representation; and normalizing the fixed-length vector representation of the password to be evaluated; An evaluation result output module is used to input the fixed-length vector representation of the password to be evaluated into the commercial password evaluation model, and the commercial password evaluation model outputs the evaluation result of the password to be evaluated.
6. An electronic device, characterized in that: The device includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a commercial cryptographic security assessment method based on deep learning as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The storage medium stores a program, which, when executed by a processor, is used to implement a commercial cryptographic security assessment method based on deep learning as described in any one of claims 1 to 4.
