Method and device for evaluating password application, electronic equipment and readable storage medium
Through automated function call relationship analysis, the password application status of the information system is evaluated, which solves the problem of secret evaluators relying on manual work and source code, and achieves efficient and accurate password application security assessment.
Patent Information
- Application Number
- CN202310374198.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2024-10-15
AI Technical Summary
In the existing technology, secret reviewers highly rely on manual evaluation and source code reading, and are unable to fully understand the password usage of the information system, and it is difficult to implement security assessment of password applications without being able to view the source code.
By obtaining the running information of upper-layer applications, monitoring function call tuples, constructing a directed graph of function call relationships, analyzing function call relationships, and evaluating whether compliant cryptographic algorithms are used based on pre-stored feature values, automated cryptographic application status collection and Review.
It reduces the manual participation in the secret evaluation process, improves the efficiency and accuracy of the evaluation, and can collect and analyze the password usage of the information system without viewing the source code.
Smart Images

Figure CN118779868A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of information security technology, and in particular to a cryptographic application evaluation method, device, electronic device, and readable storage medium. Background Art
[0002] With the rapid development of Internet technology, the network security risks of information systems continue to increase, and the threat challenges are becoming increasingly severe. Cryptographic security is an important foundation for information security and can be used to effectively protect the data security of information systems. With the implementation of cryptographic standard requirements, the standardization and normalization requirements for cryptographic applications have been put forward for cryptographic algorithms, which requires corresponding cryptographic application security assessment and detection methods to determine the compliance and correctness of cryptographic algorithms. Cryptographic application security assessment refers to the activity of evaluating the compliance, correctness and effectiveness of cryptographic applications in networks and information systems that are built with commercial cryptographic technologies, products and services. Cryptographic application security assessment is an assessment of the security of cryptographic applications. It is based on system security, system security and dynamic security, and conducts an overall security assessment of cryptographic algorithms, cryptographic protocols and cryptographic devices.
[0003] In the actual work of cryptographic application security assessment, the reviewers need to consult the system designers, developers, operation and maintenance personnel, etc., and review the system design and development documents. They may even need to read the relevant source code to understand whether passwords are used, which specific cryptographic algorithms are used, and which data are mainly encrypted, etc., so as to analyze and judge the cryptographic compliance and correctness of the cryptographic application through this information. However, the whole process needs to be done manually, which requires the reviewers to have certain communication and code reading skills, and the quality requirements for the reviewers are relatively high. In addition, since the information system is relatively large and complex, the personnel accompanying the review may not understand the system, or only understand part of it, and therefore may not be able to fully understand and judge the cryptographic situation of the information system. At the same time, the description of the system documents and manual consultation may have certain errors from the real system, but the source code of the information system may be relatively sensitive data, and the reviewers may not be able to view the source code of the system under test, which will also affect the evaluation results. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, electronic device and readable storage medium for evaluating password applications to solve the existing problems of high dependence on password reviewers and inability to collect and analyze password usage in information systems when source code cannot be viewed.
[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for evaluating a cryptographic application, comprising:
[0007] Obtaining running information of an upper-layer application, and monitoring a first function in the upper-layer application according to the running information of the upper-layer application; if it is detected that a characteristic value of the first function in the upper-layer application is the same as a characteristic value of a pre-stored first function, recording data of the first function, the data of the first function including: function input data, function output data and function characteristic value; constructing a function call tuple of the upper-layer application according to the data of the first function, and constructing a function call tuple set of all the function call tuples of the upper-layer application;
[0008] Analyze the function call tuple set to obtain a function call relationship set, wherein the function call relationship set includes at least one set of function call relationships formed by the call states of the first function corresponding to the function call tuple;
[0009] Based on the pre-stored feature values and the function call relationship set, it is evaluated whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm.
[0010] Optionally, the application running information includes at least one of the following: operating system type, running environment and application development language.
[0011] Optionally, the function call tuple is composed of data of the first function, and the function call tuple is Among them, input is the input data of the function, x i is the number of input data of the function, Func is the function name or function characteristic value, output is the output data of the function, y i The number of data output by the function.
[0012] Optionally, the analyzing the function call tuple set to obtain a function call relationship set includes:
[0013] Analyze the set of function call tuples, construct at least one function call relationship directed graph based on the relationship between function input data and function output data in the set of function call tuples, and form the at least one function call relationship directed graph into a set of function call relationship directed graphs; wherein each of the function call tuples represents a node in the function call relationship directed graph, and the sequence relationship between two function call tuples is the direction of each directed edge of the function call relationship directed graph.
[0014] Optionally, based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes:
[0015] Reversely search the function call tuple according to the function call relationship directed graph, analyze whether the function output data of the function call tuple contains suspected ciphertext data, and use the function output data containing the suspected ciphertext data as the target function output data;
[0016] All function call tuples related to the output data of the target function are retrieved in the directed graph set of function call relationships, and the function characteristic values of the related function call tuples are analyzed to see whether they are cryptographic algorithms. If the function characteristic values are cryptographic algorithms, the cryptographic algorithms are analyzed to see whether they are compliant.
[0017] Optionally, based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes:
[0018] forwardly searching the function call tuple according to the function call relationship directed graph, analyzing whether the function input data of the function call tuple contains sensitive data suspected to be required to be encrypted, and taking the function input data containing the sensitive data suspected to be required to be encrypted as the target input data;
[0019] All function call tuples related to the input data of the target function are retrieved in the directed graph set of function call relationships, and the function characteristic values of the related function call tuples are analyzed to see whether they are cryptographic algorithms. If the function characteristic values are cryptographic algorithms, the cryptographic algorithms are analyzed to see whether they are compliant.
[0020] Optionally, based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes:
[0021] Searching for all function call tuples in the function call relationship directed graph set, analyzing whether the function characteristic value of the function call tuple is an encryption algorithm, and taking the function call tuple whose function characteristic value is the encryption algorithm as the target function characteristic value;
[0022] All function call tuples related to the target function characteristic value are retrieved in the function call relationship directed graph set, and the function characteristic value in the related function call tuple is analyzed whether it is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, whether the cryptographic algorithm is compliant is analyzed.
[0023] In a second aspect, an embodiment of the present invention provides a cryptographic application evaluation device, comprising:
[0024] A function call analysis module, used to obtain the operation information of the upper-layer application, and monitor the first function in the upper-layer application according to the operation information of the upper-layer application; if it is detected that the characteristic value of the first function in the upper-layer application is the same as the characteristic value of the first function stored in advance, then record the data of the first function, the data of the first function including: function input data, function output data and function characteristic value; construct a function call tuple of the upper-layer application according to the data of the first function, and construct a function call tuple set of all the function call tuples of the upper-layer application;
[0025] a function call relationship analysis module, configured to analyze the function call tuple set to obtain a function call relationship set, wherein the function call relationship set includes at least one set of function call relationships formed by the call states of the first function corresponding to the function call tuple;
[0026] The evaluation module is used to evaluate whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm based on the pre-stored feature value and the function call relationship set.
[0027] Optionally, the application running information includes at least one of the following: operating system type, running environment and application development language.
[0028] Optionally, the function call tuple is composed of data of the first function, and the function call tuple is Among them, input is the input data of the function, x i is the number of input data of the function, Func is the function name or function characteristic value, output is the output data of the function, y i The number of data output by the function.
[0029] Optionally, the function call relationship analysis module includes:
[0030] The function call relationship analysis submodule is used to analyze a set of function call tuples, construct at least one function call relationship directed graph based on the relationship between function input data and function output data in the function call tuple set, and form a set of function call relationship directed graphs with the at least one function call relationship directed graph; wherein each of the function call tuples represents a node in the function call relationship directed graph, and the sequence relationship between two function call tuples is the direction of each directed edge of the function call relationship directed graph.
[0031] Optionally, the evaluation module includes:
[0032] A first processing submodule is used to reversely search the function call tuple according to the function call relationship directed graph, and analyze whether the function output data of the function call tuple contains suspected ciphertext data, and use the function output data containing the suspected ciphertext data as the target function output data;
[0033] The second processing sub-module is used to retrieve all function call tuples related to the output data of the target function in the function call relationship directed graph set, and analyze whether the function characteristic value of the related function call tuple is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, then analyze whether the cryptographic algorithm is compliant.
[0034] Optionally, the evaluation module includes:
[0035] A third processing submodule is used to forward search the function call tuple according to the function call relationship directed graph, and analyze whether the function input data of the function call tuple contains sensitive data suspected to be required to be encrypted, and use the function input data containing the sensitive data suspected to be required to be encrypted as the target input data;
[0036] The fourth processing sub-module is used to retrieve all function call tuples related to the input data of the target function in the directed graph set of the function call relationship, and analyze whether the function characteristic value of the related function call tuple is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, then analyze whether the cryptographic algorithm is compliant.
[0037] Optionally, the evaluation module includes:
[0038] a fifth processing submodule, configured to search for all function call tuples in the function call relationship directed graph set, analyze whether the function characteristic value of the function call tuple is an encryption algorithm, and use the function call tuple whose function characteristic value is an encryption algorithm as the target function characteristic value;
[0039] The sixth processing sub-module is used to retrieve all function call tuples related to the target function characteristic value in the function call relationship directed graph set, and analyze whether the function characteristic value in the related function call tuple is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, then analyze whether the cryptographic algorithm is compliant.
[0040] In a third aspect, an embodiment of the present invention provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps in the method for evaluating cryptographic applications as described in any one of the first aspects.
[0041] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps in the method for evaluating cryptographic applications as described in any one of the first aspects are implemented.
[0042] In the present invention, the password application status of software applications running on the operating system is automatically collected, data is analyzed and evaluated, which reduces the high dependence on the reviewers in the review process, reduces manual participation, and does not require source code. Even when the source code cannot be viewed, the password usage of the information system can be collected and analyzed, thereby improving the efficiency and accuracy of the review. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0044] Figure 1 is a flow chart of an evaluation module method provided by an embodiment of the present invention;
[0045] Figure 2 It is a directed graph of function call relations of an evaluation module method provided by an embodiment of the present invention;
[0046] Figure 3 It is a structural schematic diagram of an evaluation module device in a device provided by an embodiment of the present invention;
[0047] Figure 4 is a structural schematic diagram of an evaluation module device provided by an embodiment of the present invention;
[0048] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Please refer to Figure 1 , an embodiment of the present invention provides a cryptographic application evaluation method, comprising:
[0051] Step 11: Obtaining the operation information of the upper-layer application, and monitoring the first function in the upper-layer application according to the operation information of the upper-layer application; if it is detected that the characteristic value of the first function in the upper-layer application is the same as the characteristic value of the first function stored in advance, recording the data of the first function, the data of the first function including: function input data, function output data and function characteristic value; constructing a function call tuple of the upper-layer application according to the data of the first function, and constructing a function call tuple set of all the function call tuples of the upper-layer application;
[0052] In the embodiment of the present invention, optionally, the function call tuple is composed of data of the first function, and the function call tuple is Among them, input is the input data of the function, x i is the number of input data of the function, Func is the function name or function characteristic value, output is the output data of the function, y i The number of data output by the function.
[0053] In an embodiment of the present invention, an upper-layer application (such as a web application, a server application, a desktop application, etc.) is installed and run on a device having a cryptographic application evaluation device installed thereon, and is used normally and performs related business operations; the application operation information includes at least one of the following: an operating system type, an operating environment, and an application development language; a function call analysis module is used to perform function-level code insertion and dynamic monitoring on the upper-layer application or the runtime environment according to the operation information and corresponding rules, and a pre-stored feature value of a first function is stored in a knowledge base module, and the knowledge base module stores function-level feature values for various languages and runtime environments; when the function call analysis module detects that there is a pre-stored feature value of the first function, the first function is dynamically intercepted and the call status and data of the first function are recorded, thereby obtaining the function call tuple of the application in operation; by automatically collecting the cryptographic application status of the running application, the high dependence on the cryptographic reviewer during the cryptographic review process is reduced, and the runtime status of the application software is dynamically monitored without the need for source code. In the case where the source code cannot be viewed, the collection and analysis of the cryptographic usage of the information system can be achieved.
[0054] Step 12: Analyze the function call tuple set to obtain a function call relationship set, wherein the function call relationship set includes at least one set of function call relationships formed by the call states of the first function corresponding to the function call tuple;
[0055] In the embodiment of the present invention, the function call relationship analysis module performs association analysis based on the information collection result of the function call analysis module to form a function call relationship. The function call relationship can be analyzed in the form of a function call directed graph, but is not limited to it. Figure 2 , analyzing the function call tuple set, constructing at least one function call relationship directed graph according to the relationship between the function input data and the function output data in the function call tuple set, and forming a function call relationship directed graph set from the at least one function call relationship directed graph; according to {I0,...,I i ,...,I n}'s input and output relationship, constructor call relationship directed graph G j , wherein each of the function call tuples represents a node in the function call relationship directed graph, and the order of two function call tuples is the direction of each directed edge of the function call relationship directed graph. There may be multiple function call relationship directed graphs, which are summarized into a function call relationship directed graph set {G0,...,G i ,...,G m}.
[0056] Step 13: Based on the pre-stored feature values and the function call relationship set, evaluate whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm.
[0057] In an embodiment of the present invention, the evaluation and analysis module analyzes whether the generation path of the suspected ciphertext data uses a compliant cryptographic algorithm through function output data based on pre-stored feature values and the directed graph set of function call relationships; analyzes whether the usage path of sensitive data uses a compliant cryptographic algorithm through function input data based on pre-stored feature values and the directed graph set of function call relationships; and analyzes whether all cryptographic algorithms are used in compliance and whether compliant cryptographic algorithms are used in accordance with document requirements through cryptographic algorithm call analysis based on pre-stored feature values and the directed graph set of function call relationships, thereby greatly reducing the manual workload of cipher review and improving the efficiency and accuracy of cipher review.
[0058] In the embodiments of the present invention, the password application status collection, data analysis and evaluation of software applications running on the operating system are automated, thereby reducing the high dependence on reviewers during the review process and reducing manual participation. Without the need for source code, even when the source code cannot be viewed, the password usage of the information system can be collected and analyzed, thereby improving the efficiency and accuracy of the review.
[0059] Please refer to Figure 3In an embodiment of the present invention, the cryptographic application evaluation method uses a cryptographic security evaluation container (Cipher Security Evaluation Container, CSEC), that is, a cryptographic application evaluation device. The cryptographic application evaluation device is embedded in a software container module in an operating system, and by monitoring the runtime environment of the application, cryptographic application status collection, data analysis and evaluation of software applications running on the operating system are realized. The cryptographic application evaluation device includes a knowledge base module, a function call analysis module, a function call relationship analysis module and an evaluation analysis module.
[0060] Among them, the knowledge base module stores function-level feature values for various languages and runtime environments (such as: java, php, python, c / c++, etc.), mainly including at least one of the following: cryptographic algorithm-related function feature values, such as system-level cryptographic algorithm functions, third-party cryptographic library-related functions, cryptographic machine interface functions, and cloud cryptographic interface functions; data input function feature values, such as user input, interface reading, data import, database reading, network reception, and file reading; data output function feature values, such as data display, data export, database writing, network sending, and file writing.
[0061] The function call analysis module can perform function-level code insertion and interception on the upper-layer application according to the type of operating system, runtime environment and upper-layer application development language and corresponding rules, and obtain relevant call data.
[0062] The function call relationship analysis module performs association analysis based on the information collection results of the function call analysis module to form a function call directed graph set.
[0063] The evaluation and analysis module performs comprehensive analysis and evaluation based on the characteristic values stored in the knowledge base module, the collected and analyzed data, and the sensitive and encrypted data to be analyzed.
[0064] In the embodiment of the present invention, optionally, based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes:
[0065] Reversely search the function call tuple according to the function call relationship directed graph, analyze whether the function output data of the function call tuple contains suspected ciphertext data, and use the function output data containing the suspected ciphertext data as the target function output data;
[0066] All function call tuples related to the output data of the target function are retrieved in the directed graph set of function call relationships, and the function characteristic values of the related function call tuples are analyzed to see whether they are cryptographic algorithms. If the function characteristic values are cryptographic algorithms, the cryptographic algorithms are analyzed to see whether they are compliant.
[0067] In the embodiment of the present invention, for all function call relationship directed graphs G in the function call relationship directed graph set i ∈{G0,...,G m}, according to the function call relationship directed graph, reverse search the function call tuple, that is, search its terminal function call tuple node set {I0,...,I k}, for example, there are k terminal function call tuple nodes in total; for all terminal function call tuples I in the set j ∈{I0,...,I k}, analyze its function output data (output1,...,output yj ) whether it contains data suspected to be ciphertext, if not, analyze the next terminal function call tuple;
[0068] If there is, then in the directed graph G i In the reverse search based on the input function data and output function data, find all related function call tuples {I0,...,I l}, analyze each node I l ∈{I0,...,I l}'s function eigenvalue Func l Whether it is a cryptographic algorithm, and then evaluate whether the corresponding cryptographic algorithm is used in compliance according to the input data and output data of the function, for example: whether a cryptographic algorithm with relatively low security is used, whether a key with relatively low security is used, etc. If for all I l ∈{I0,...,I l}If no cryptographic algorithm is detected, it means that a custom password or encoding algorithm may be used. Save the relevant information and submit it for manual analysis.
[0069] In the embodiment of the present invention, optionally, based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes:
[0070] forwardly searching the function call tuple according to the function call relationship directed graph, analyzing whether the function input data of the function call tuple contains sensitive data suspected to be required to be encrypted, and taking the function input data containing the sensitive data suspected to be required to be encrypted as the target input data;
[0071] All function call tuples related to the input data of the target function are retrieved in the directed graph set of function call relationships, and the function characteristic values of the related function call tuples are analyzed to see whether they are cryptographic algorithms. If the function characteristic values are cryptographic algorithms, the cryptographic algorithms are analyzed to see whether they are compliant.
[0072] In the embodiment of the present invention, for all function call relationship directed graphs G in the function call relationship directed graph set i ∈{G0,...,G m}, forward search the function call tuple according to the function call relationship directed graph, that is, search its starting end function call tuple node set {I0,...,I k}, for example, there are k starting function call tuple nodes; for all the terminal function call tuples I in the set j ∈{I0,...,I k}, analyze its function output data Whether it contains sensitive data that is suspected to need to be encrypted, such as ID card number, mobile phone number, etc. If not, analyze the next starting end function call tuple;
[0073] If there is, then in the directed graph G i According to the input function data and output function data, forward search is performed to find all relevant function call tuples {I0,...,I l}, analyze each node I l ∈{I0,...,I l} l Whether it is a cryptographic algorithm, and then evaluate whether the corresponding cryptographic algorithm is used in compliance according to the input data and output data of the function, for example: whether a cryptographic algorithm with relatively low security is used, whether a key with relatively low security is used, etc. If for all I l ∈{I0,...,I l}If no cryptographic algorithm is detected, it means that a custom password or encoding algorithm may be used. Save the relevant information and submit it for manual analysis.
[0074] In the embodiment of the present invention, optionally, based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes:
[0075] Searching for all function call tuples in the function call relationship directed graph set, analyzing whether the function characteristic value of the function call tuple is an encryption algorithm, and taking the function call tuple whose function characteristic value is the encryption algorithm as the target function characteristic value;
[0076] Retrieve all function call tuples related to the target function feature value in the function call relationship directed graph set, and analyze the function feature value Func in the related function call tuple l Whether it is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, analyze whether the cryptographic algorithm is compliant.
[0077] In the embodiment of the present invention, for all function call relationship directed graphs G in the function call relationship directed graph set i ∈{G0,...,G m}, list all its function call tuple node sets {I0,...,I k}, for example, there are k starting function call tuple nodes; for all function call tuples I in the set j ∈{I0,...,I k}, analyze whether its function eigenvalue Funcl is an encryption algorithm, and then evaluate whether the corresponding cryptographic algorithm is used in compliance according to the input data and output data of the function, for example: determine whether a cryptographic algorithm with relatively low security is used, whether a key with relatively low security is used, etc. If for all I l ∈{I0,...,I l}If no cryptographic algorithm is detected, it means that a custom password or encoding algorithm may be used. Save the relevant information and submit it for manual analysis.
[0078] Or, based on the documents provided by the party being tested, search in the directed graph collection to find the possible corresponding function call relationship directed graph G i ∈{G0,...,G m}, analyze the corresponding function call relationship directed graph G i ∈{G0,...,G m Each node I in j ∈{I0,...,I k} l Whether it is an encryption algorithm, and then evaluate whether the encryption algorithm is used in accordance with the document requirements, and whether the encryption algorithm used is compliant.
[0079] Please refer to Figure 4 The embodiment of the present invention provides a cryptographic application evaluation device, comprising:
[0080] The function call analysis module 41 is used to obtain the operation information of the upper layer application, and monitor the first function in the upper layer application according to the operation information of the upper layer application; if it is detected that the characteristic value of the first function in the upper layer application is the same as the characteristic value of the first function stored in advance, then record the data of the first function, the data of the first function including: function input data, function output data and function characteristic value; construct the function call tuple of the upper layer application according to the data of the first function, and construct all the function call tuples of the upper layer application into a function call tuple set;
[0081] A function call relationship analysis module 42, configured to analyze the function call tuple set to obtain a function call relationship set, wherein the function call relationship set includes at least one set of function call relationships formed by the call states of the first function corresponding to the function call tuple;
[0082] The evaluation module 43 is used to evaluate whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm based on the pre-stored feature value and the function call relationship set.
[0083] In the embodiment of the present invention, optionally, the running information of the application includes at least one of the following: operating system type, running environment and application development language.
[0084] In the embodiment of the present invention, optionally, the function call tuple is composed of data of the first function, and the function call tuple is Among them, input is the input data of the function, x i is the number of input data of the function, Func is the function name or function characteristic value, output is the output data of the function, y i The number of data output by the function.
[0085] In the embodiment of the present invention, optionally, the function call relationship analysis module includes:
[0086] The function call relationship analysis submodule is used to analyze a set of function call tuples, construct at least one function call relationship directed graph based on the relationship between function input data and function output data in the function call tuple set, and form a set of function call relationship directed graphs with the at least one function call relationship directed graph; wherein each of the function call tuples represents a node in the function call relationship directed graph, and the sequence relationship between two function call tuples is the direction of each directed edge of the function call relationship directed graph.
[0087] In the embodiment of the present invention, optionally, the evaluation module includes:
[0088] A first processing submodule is used to reversely search the function call tuple according to the function call relationship directed graph, and analyze whether the function output data of the function call tuple contains suspected ciphertext data, and use the function output data containing the suspected ciphertext data as the target function output data;
[0089] The second processing sub-module is used to retrieve all function call tuples related to the output data of the target function in the function call relationship directed graph set, and analyze whether the function characteristic value of the related function call tuple is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, then analyze whether the cryptographic algorithm is compliant.
[0090] In the embodiment of the present invention, optionally, the evaluation module includes:
[0091] A third processing submodule is used to forward search the function call tuple according to the function call relationship directed graph, and analyze whether the function input data of the function call tuple contains sensitive data suspected to be required to be encrypted, and use the function input data containing the sensitive data suspected to be required to be encrypted as the target input data;
[0092] The fourth processing sub-module is used to retrieve all function call tuples related to the input data of the target function in the directed graph set of the function call relationship, and analyze whether the function characteristic value of the related function call tuple is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, then analyze whether the cryptographic algorithm is compliant.
[0093] In the embodiment of the present invention, optionally, the evaluation module includes:
[0094] a fifth processing submodule, configured to search for all function call tuples in the function call relationship directed graph set, analyze whether the function characteristic value of the function call tuple is an encryption algorithm, and use the function call tuple whose function characteristic value is an encryption algorithm as the target function characteristic value;
[0095] The sixth processing sub-module is used to retrieve all function call tuples related to the target function characteristic value in the function call relationship directed graph set, and analyze whether the function characteristic value in the related function call tuple is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, then analyze whether the cryptographic algorithm is compliant.
[0096] The cryptographic application evaluation device provided by the embodiment of the present invention can achieve Figure 1 The various processes implemented by the method embodiment and achieving the same technical effect are not described here to avoid repetition.
[0097] An embodiment of the present invention provides an electronic device 50, see Figure 5 As shown, Figure 5 This is a principle block diagram of an electronic device 50 according to an embodiment of the present invention, which includes a processor 51, a memory 52, and a program or instruction stored in the memory 52 and executable on the processor 51. When the program or instruction is executed by the processor, the steps in any cryptographic application evaluation method of the present invention are implemented.
[0098] An embodiment of the present invention provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of an embodiment of a method for evaluating a cryptographic application as described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0099] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0100] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0101] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a service classification device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0103] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for evaluating a cryptographic application, characterized in that: include: Acquire operation information of an upper-layer application, and monitor a first function in the upper-layer application according to the operation information of the upper-layer application; If it is detected that the characteristic value of the first function in the upper layer application is the same as the characteristic value of the first function stored in advance, then the data of the first function is recorded, the data of the first function including: function input data, function output data and function characteristic value; according to the data of the first function, a function call tuple of the upper layer application is formed, and all the function call tuples of the upper layer application are formed into a function call tuple set; Analyze the function call tuple set to obtain a function call relationship set, wherein the function call relationship set includes at least one set of function call relationships formed by the call states of the first function corresponding to the function call tuple; Based on the pre-stored feature values and the function call relationship set, it is evaluated whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm.
2. The method for evaluating cryptographic applications according to claim 1, characterized in that: The application running information includes at least one of the following: operating system type, running environment and application development language.
3. The method for evaluating cryptographic applications according to claim 1, characterized in that: The function call tuple is composed of the data of the first function, and the function call tuple is Among them, input is the input data of the function, x i is the number of input data of the function, Func is the function name or function characteristic value, output is the output data of the function, y i The number of data output by the function.
4. The method for evaluating cryptographic applications according to claim 3, characterized in that: The function call tuple set is analyzed to obtain a function call relationship set, including: Analyze the set of function call tuples, construct at least one function call relationship directed graph based on the relationship between function input data and function output data in the set of function call tuples, and form the at least one function call relationship directed graph into a set of function call relationship directed graphs; wherein each of the function call tuples represents a node in the function call relationship directed graph, and the sequence relationship between two function call tuples is the direction of each directed edge of the function call relationship directed graph.
5. The method for evaluating cryptographic applications according to claim 4, characterized in that: Based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes: Reversely search the function call tuple according to the function call relationship directed graph, analyze whether the function output data of the function call tuple contains suspected ciphertext data, and use the function output data containing the suspected ciphertext data as the target function output data; All function call tuples related to the output data of the target function are retrieved in the directed graph set of function call relationships, and the function characteristic values of the related function call tuples are analyzed to see whether they are cryptographic algorithms. If the function characteristic values are cryptographic algorithms, the cryptographic algorithms are analyzed to see whether they are compliant.
6. The method for evaluating cryptographic applications according to claim 4, characterized in that: Based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes: forwardly searching the function call tuple according to the function call relationship directed graph, analyzing whether the function input data of the function call tuple contains sensitive data suspected to be required to be encrypted, and taking the function input data containing the sensitive data suspected to be required to be encrypted as the target input data; All function call tuples related to the input data of the target function are retrieved in the directed graph set of function call relationships, and the function characteristic values of the related function call tuples are analyzed to see whether they are cryptographic algorithms. If the function characteristic values are cryptographic algorithms, the cryptographic algorithms are analyzed to see whether they are compliant.
7. The method for evaluating cryptographic applications according to claim 4, characterized in that: Based on the pre-stored feature value and the function call relationship set, evaluating whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm includes: Searching for all function call tuples in the function call relationship directed graph set, analyzing whether the function characteristic value of the function call tuple is an encryption algorithm, and taking the function call tuple whose function characteristic value is the encryption algorithm as the target function characteristic value; All function call tuples related to the target function characteristic value are retrieved in the function call relationship directed graph set, and the function characteristic value in the related function call tuple is analyzed whether it is a cryptographic algorithm. If the function characteristic value is a cryptographic algorithm, whether the cryptographic algorithm is compliant is analyzed.
8. A cryptographic application evaluation device, characterized in that: include: A function call analysis module, used to obtain operation information of an upper layer application, and monitor a first function in the upper layer application according to the operation information of the upper layer application; If it is detected that the characteristic value of the first function in the upper layer application is the same as the characteristic value of the first function stored in advance, then the data of the first function is recorded, the data of the first function including: function input data, function output data and function characteristic value; according to the data of the first function, a function call tuple of the upper layer application is formed, and all the function call tuples of the upper layer application are formed into a function call tuple set; a function call relationship analysis module, configured to analyze the function call tuple set to obtain a function call relationship set, wherein the function call relationship set includes at least one set of function call relationships formed by the call states of the first function corresponding to the function call tuple; The evaluation module is used to evaluate whether the function call tuple in the function call relationship set uses a compliant cryptographic algorithm based on the pre-stored feature value and the function call relationship set.
9. An electronic device, characterized in that: The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps in the method for evaluating cryptographic applications as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps in the method for evaluating a cryptographic application as claimed in any one of claims 1 to 7 are implemented.
