Cryptographic Threat Detection Method

By sampling and analyzing the encrypted communication handshake process multiple times, and combining the characteristics of elliptic curve temporary public key points and certificate chains, a two-dimensional observation value is constructed. This solves the problem of mismatch between the security strength of elliptic curve temporary public key points and certificate chains in encrypted communication, and enables accurate identification and differentiation of different attack types.

CN123122947APending Publication Date: 2026-11-17QITIAN ANXIN (TIANJIN) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611379460.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify the mismatch between the subgroup affiliation of elliptic curve temporary public key points and the security strength of certificate chains in encrypted communications, and cannot distinguish between different types of attacks, resulting in high false positives and false negatives.

Method used

By statistically analyzing multiple encrypted communication handshake processes of the same communication subject, the small subgroup pollution rate of elliptic curve temporary public key points and the equivalent security strength of the certificate chain are extracted. Combined with coordinate entropy loss and asymmetric cross-validation measures, a two-dimensional cryptographic consistency observation is constructed, and threat determination is performed using the cumulative sum of log-likelihood ratios and sequential probability ratio tests.

Benefits of technology

It improves the accuracy of identifying abnormal behavior in encrypted communication, distinguishes between swarm attacks, degradation attacks, and composite attacks, reduces the impact of single fluctuations, and provides clearer basis for security response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123122947A_ABST
    Figure CN123122947A_ABST
Patent Text Reader

Abstract

This invention discloses a method for monitoring encrypted communication threats based on cryptographic properties, relating to the fields of network security and cryptographic monitoring; it solves the problem of detecting threats in encrypted communication without decryption. This invention extracts elliptic curve temporary public key points sent by the server, calculates the subgroup contamination rate and coordinate entropy loss to obtain a composite subgroup integrity metric; it extracts the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters, and calculates an asymmetric cross-validation metric; it combines these two into a two-dimensional cryptographic consistency observation, calculates the cumulative sum of log-likelihood ratios based on the normal joint distribution and the attack joint distribution, uses a sequential probability ratio test for threat determination, and updates the joint distribution online. This enables continuous monitoring of encrypted communication threats such as subgroup attacks and degradation attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network security and cryptography monitoring, specifically a method for monitoring encrypted communication threats based on cryptographic characteristics. Background Technology

[0002] With the widespread deployment of transport layer security protocols in internet communication, encrypted communication has become a fundamental means of protecting data confidentiality and integrity. During the establishment of encrypted communication, the client and server negotiate cipher suites, exchange random numbers, transmit certificate chains, and generate key exchange parameters through a handshake process. The cryptographic properties exposed during these handshakes, including the subgroup membership of elliptic curve temporary public key points, the equivalent security strength of each certificate in the certificate chain, and the equivalent security strength of the temporary key exchange parameters, are all publicly observable information of the cryptographic protocol and can be obtained without decrypting the encrypted content.

[0003] For network monitoring, encrypted communication, while protecting legitimate user data, also prevents monitors from directly reading the communication content to determine its security. Attackers can also exploit encrypted communication channels to conceal malicious activities, such as sending anomalous elliptic curve temporary public key points during key exchange, using weak certificate chains, or constructing degradation behaviors that create a security mismatch between long-term identities and temporary sessions. Although these anomalous behaviors are hidden behind encrypted channels, they leave observable traces in the public characteristics of the cryptographic protocol layer.

[0004] Elements in cryptographic protocols, such as elliptic curve temporary public key points, certificate chains, and temporary key exchange parameters, each adhere to strict mathematical structures and security strength requirements. Elliptic curve temporary public key points should belong to a large prime-order subgroup of the elliptic curve they belong to, and their x-coordinates should exhibit a random, uniform distribution over a finite field. The equivalent security strength of each level of the certificate chain should be consistent with the long-term identity claims of the communicating parties. The equivalent security strength of the temporary key exchange parameters should match the long-term trust level established by the certificate chain. Deviations in these cryptographic characteristics often indicate potential abnormal or malicious behavior during communication.

[0005] The following problems exist in the existing technology: Existing methods typically only perform simple curve equation verification on a single elliptic curve temporary public key point, without statistically analyzing the small subgroup contamination rate during multiple encrypted communication handshakes of the same communication subject, and without comprehensively judging the randomness of the distribution of the x-coordinate of the elliptic curve temporary public key point. This makes it difficult to effectively detect hidden small subgroup injection and abnormal random distribution of the x-coordinate of the elliptic curve temporary public key point. Existing methods typically test the security strength of the certificate chain or the security strength of the temporary key exchange parameters independently, without correlating and comparing the weakest equivalent security strength of the certificate chain with the equivalent security strength of the temporary key exchange parameters, thus failing to detect the security strength mismatch between long-term identities and temporary sessions; Existing methods typically rely on a single feature or a fixed threshold for judgment, without combining multiple cryptographic features into joint observations for sequential analysis. This makes them susceptible to fluctuations in the handshake process of a single encrypted communication, resulting in high false positives and false negatives. Existing methods, after determining that the communication subject is a high threat, usually do not further distinguish the threat type, making it difficult to take corresponding measures against different attack types such as subgroup attacks, degradation attacks, and composite attacks. Summary of the Invention

[0006] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a cryptographic threat monitoring method based on cryptographic characteristics to solve the above-mentioned technical problem.

[0007] The first aspect of this invention provides a method for detecting encrypted communication threats based on cryptographic characteristics, comprising the following steps: S1: During the monitoring period, passive sampling is performed on multiple encrypted communication handshake processes of the same communication subject, and the elliptic curve temporary public key points sent by the server in each handshake are extracted; the ratio of the number of temporary public key points that do not belong to the large prime order subgroup to the total number of all elliptic curve temporary public key points is used as the subgroup pollution rate; the coordinate entropy loss is calculated based on the distribution of the abscissas of all elliptic curve temporary public key points; the subgroup pollution rate and the coordinate entropy loss are combined to obtain the composite subgroup integrity measure; S2: During a single encrypted communication handshake, extract the equivalent security strength of each level of the certificate in the certificate chain sent by the server and take the minimum value as the weakest equivalent security strength of the certificate chain; extract the equivalent security strength of the temporary key exchange parameters sent by the server in this handshake; perform symmetric difference normalization on the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters to obtain the asymmetric cross-validation metric. S3: Combine the composite subgroup integrity measure with the asymmetric cross-validation measure into a two-dimensional cryptographic consistency observation value as a joint observation value. Calculate the log-likelihood ratio based on the normal joint distribution and the attack joint distribution during each encrypted communication handshake process. Sum all the log-likelihood ratios to obtain the cumulative sum of the log-likelihood ratios. S4: Compare the cumulative log-likelihood ratio with a preset upper bound and a preset lower bound of the sequential probability ratio test; when the cumulative log-likelihood ratio is greater than or equal to the upper bound of the sequential probability ratio test, the communication subject is determined to be a high threat; when the cumulative log-likelihood ratio is less than or equal to the lower bound of the sequential probability ratio test, the communication subject is determined to be normal; when the cumulative log-likelihood ratio is between the upper bound and the lower bound of the sequential probability ratio test, continue to observe the next encrypted communication handshake process; S5: When the communication subject is determined to be normal, the joint observations of this encrypted communication handshake process are used to update the normal joint distribution; when the communication subject is determined to be a high threat, the joint observations of this encrypted communication handshake process are used to update the attack joint distribution.

[0008] Preferably, in step S1, the ratio of the number of elliptic curve temporary public key points that do not belong to a large prime order subgroup to the total number of all elliptic curve temporary public key points, as the subgroup pollution rate, includes the following steps: For each elliptic curve temporary public key point (ECP), it is verified whether it can be correctly parsed according to the protocol format and whether its affine coordinates are within the valid range of the finite field of the elliptic curve containing the ECP. If the verification fails, the ECP is directly marked as an outlier. If the verification passes, a scalar multiplication operation is performed using the cofactor of the elliptic curve, and it is determined whether the result of the scalar multiplication operation is equal to the point at infinity on the elliptic curve. For ECPs whose result is equal to the point at infinity, the order of the ECP is calculated, and it is determined whether the order is equal to the order of the large prime order subgroup of the elliptic curve. ECPs whose scalar multiplication result is not equal to the point at infinity and whose order is not equal to the order of the large prime order subgroup are all marked as outliers. The number of encrypted communication handshake processes corresponding to the ECPs marked as outliers is counted, and this number is taken as the number of small subgroup-pollinated sessions. The ratio of the number of small subgroup-pollinated sessions to the total number of all ECPs is taken as the small subgroup-pollution rate.

[0009] Preferably, in step S1, the step of calculating the coordinate entropy loss based on the distribution of the abscissas of all elliptic curve temporary public key points, and combining the subgroup pollution rate with the coordinate entropy loss to obtain the composite subgroup integrity measure, includes the following steps: Divide the range of x-coordinates of all elliptic curve temporary public key points into B equal-width intervals; count the number of x-coordinates in each equal-width interval, and denote the number of x-coordinates in the j-th equal-width interval as . Calculate the empirical entropy of the x-coordinates based on the number of x-coordinates within each equal-width interval. The calculation formula is: Among them, when When =0, The value is 0; Theoretical maximum entropy The value is log2(B). Will and The absolute value of the ratio deviates as the coordinate entropy loss. ; Combining the contamination rate of small subgroups with the coordinate entropy deficit yields a measure of the integrity of composite subgroups. The calculation formula is: in, Let represent the number of subgroup pollution sessions, and k represent the total number of elliptic curve ephemeral public key points.

[0010] Preferably, in step S2, extracting the equivalent security strength of each level of the certificate in the certificate chain sent by the server and taking the minimum value as the weakest equivalent security strength of the certificate chain includes the following steps: For each certificate in the certificate chain, extract the public key length, signature algorithm, and hash function. Determine the strength of the certificate's main public key algorithm and signature algorithm, where the main public key algorithm strength is calculated based on the complexity model of the best known attack corresponding to the algorithm type and key length of the main public key. The signature algorithm strength is determined based on the lower of the public key algorithm strength and the hash function strength. The lower of the main public key algorithm strength and the signature algorithm strength is taken as the equivalent security strength of the certificate. For two adjacent certificates in a certificate chain, calculate the difference between the equivalent security strength of the latter certificate and the equivalent security strength of the former certificate; count the number of adjacent level pairs whose absolute value of the difference exceeds a preset strength jump threshold; when the number does not exceed a preset jump tolerance number, take the minimum value among the equivalent security strengths of all certificate levels as the weakest equivalent security strength of the certificate chain; when the number exceeds the preset jump tolerance number, take the minimum value among the equivalent security strengths of all certificate levels, multiply the minimum value by a preset loss factor, and take the lost value as the weakest equivalent security strength of the certificate chain.

[0011] Preferably, in step S2, the step of extracting the equivalent security strength of the temporary key exchange parameters sent by the server in this handshake, and performing symmetric difference normalization processing on the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters to obtain an asymmetric cross-validation metric includes the following steps: Based on the type of key exchange algorithm used in the temporary key exchange parameters, the complexity model of the optimal known attack faced by the key exchange algorithm is determined. The temporary key exchange parameters are then substituted into this complexity model to calculate the equivalent security strength of the temporary key exchange parameters. ; Calculate asymmetric cross-validation metrics The calculation formula is: in This represents the weakest equivalent security strength of the certificate chain.

[0012] Preferably, step S3 includes the following steps: The composite subgroup integrity measure and the asymmetric cross-validation measure are combined into a two-dimensional cryptographic consistency observation, which serves as the joint observation for this encrypted communication handshake process. ; The normal joint distribution is constructed from joint observations of a predetermined number of encrypted communication handshake processes by the same communicating entity, while the attack joint distribution is constructed from joint observation samples that have been marked as attacks. During each encrypted communication handshake process, the log-likelihood ratio of that handshake process is calculated. The calculation formula is: in, To attack the joint distribution in joint observations The probability density value at that location, The normal joint distribution is in the joint observations The probability density value at that location; The log-likelihood ratio of this encrypted communication handshake process The cumulative sum of the log-likelihood ratios after the previous encrypted communication handshake process. The cumulative sum of the log-likelihood ratios after this encrypted communication handshake process is obtained. The log-likelihood ratio is greater than the cumulative sum and the initial value. =0.

[0013] Preferably, step S4 includes the following steps: Based on the preset false alarm rate and the preset false negative rate Calculate the upper bound A and lower bound B of the sequential probability ratio test according to the threshold calculation formula, i.e. , ; The log-likelihood ratio is accumulated and summed. Compare with the upper bound A of the sequential probability ratio test and the lower bound B of the sequential probability ratio test; when At that time, the communication subject is determined to be a high threat, and... Reset to 0; obtain the integrity measure of the composite subgroup during the most recent encrypted communication handshake. With the aforementioned asymmetric cross-validation metric Preset subgroup integrity threshold and cross-validation threshold ;Will and The situation corresponds to a subgroup attack, which will and The situation corresponds to a downgrade attack, which will and The situation corresponds to a combined attack, which will and This situation corresponds to an unknown attack; when When the communication subject is determined to be normal, and... Reset to 0; when Then, continue to observe the next encrypted communication handshake process.

[0014] Preferably, step S5 includes the following steps: When the communication subject is determined to be normal, the joint observations from this encrypted communication handshake process are used. The mean vector of the normal joint distribution before the update. Covariance Matrix Calculate the updated mean vector of the normal joint distribution. Covariance Matrix The calculation formula is: in, The preset update step size, Representing vectors Transpose of; When the communication subject is determined to be a high threat, the joint observations from this encrypted communication handshake process will be used. The mean vector of the joint distribution of the attacks before the update. Covariance Matrix The mean vector and covariance matrix of the updated attack joint distribution are calculated in the same manner as those for updating the normal joint distribution.

[0015] Compared with the prior art, the beneficial effects of the present invention are: This invention obtains a composite subgroup integrity measure by statistically analyzing the subgroup contamination rate during multiple encrypted communication handshakes of the same communication subject and combining it with the coordinate entropy loss of the x-coordinate of the elliptic curve temporary public key point. This measure can comprehensively reflect the degree of anomaly of the elliptic curve temporary public key point from two dimensions: subgroup membership and randomness. This invention performs symmetric difference normalization on the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters to obtain an asymmetric cross-validation metric, which can effectively identify degradation behavior due to the mismatch in security strength between long-term identities and temporary sessions. This invention combines the integrity measure of the composite subgroup with the asymmetric cross-validation measure into a two-dimensional cryptographic consistency observation. It calculates the cumulative sum of log-likelihood ratios based on the normal joint distribution and the attack joint distribution, and uses the sequential probability ratio test for judgment. It can accumulate evidence by using multiple encrypted communication handshake processes and reduce the impact of single fluctuations on the judgment result. After determining that the communication subject is a high threat, this invention distinguishes between subgroup attacks, degradation attacks, composite attacks, and unknown attacks based on the comparison results of composite subgroup integrity metrics and asymmetric cross-validation metrics with corresponding thresholds, providing a clearer basis for subsequent security responses. Simultaneously, to support the effective differentiation of threat types, the construction of the joint attack distribution does not force all attack samples to fit a single distribution. Instead, it maintains independent sub-joint distributions for subgroup attacks, degradation attacks, and composite attacks, and takes the maximum value of the probability density of each sub-distribution as the attacker's probability density when calculating the log-likelihood ratio. This preserves the clustering characteristics of different attack modes in the two-dimensional cryptographic feature space, avoiding the problem of blurred decision boundaries caused by excessive smoothing and fusion of different attack features by a single Gaussian distribution, further improving the accuracy of threat identification and the coverage of different attack modes. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0017] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0018] Please see Figure 1 This invention relates to a method for detecting encrypted communication threats based on cryptographic properties, comprising the following steps: S1: During the monitoring period, passive sampling is performed on multiple encrypted communication handshake processes of the same communication subject, and the elliptic curve temporary public key points sent by the server in each handshake are extracted; the ratio of the number of temporary public key points that do not belong to the large prime order subgroup to the total number of all elliptic curve temporary public key points is used as the subgroup pollution rate; the coordinate entropy loss is calculated based on the distribution of the abscissas of all elliptic curve temporary public key points; the subgroup pollution rate and the coordinate entropy loss are combined to obtain the composite subgroup integrity measure; S2: During a single encrypted communication handshake, extract the equivalent security strength of each level of the certificate in the certificate chain sent by the server and take the minimum value as the weakest equivalent security strength of the certificate chain; extract the equivalent security strength of the temporary key exchange parameters sent by the server in this handshake; perform symmetric difference normalization on the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters to obtain the asymmetric cross-validation metric. S3: Combine the composite subgroup integrity measure with the asymmetric cross-validation measure into a two-dimensional cryptographic consistency observation value as a joint observation value. Calculate the log-likelihood ratio based on the normal joint distribution and the attack joint distribution during each encrypted communication handshake process. Sum all the log-likelihood ratios to obtain the cumulative sum of the log-likelihood ratios. S4: Compare the cumulative log-likelihood ratio with a preset upper bound and a preset lower bound of the sequential probability ratio test; when the cumulative log-likelihood ratio is greater than or equal to the upper bound of the sequential probability ratio test, the communication subject is determined to be a high threat; when the cumulative log-likelihood ratio is less than or equal to the lower bound of the sequential probability ratio test, the communication subject is determined to be normal; when the cumulative log-likelihood ratio is between the upper bound and the lower bound of the sequential probability ratio test, continue to observe the next encrypted communication handshake process; S5: When the communication subject is determined to be normal, the joint observations of this encrypted communication handshake process are used to update the normal joint distribution; when the communication subject is determined to be a high threat, the joint observations of this encrypted communication handshake process are used to update the attack joint distribution.

[0019] Specifically, during the monitoring period, passive sampling is performed on multiple encrypted communication handshake processes of the same communication subject. Elliptic curve temporary public key points (ECPs) sent by the server in each handshake are extracted. The ratio of the number of ECPs not belonging to a large prime order subgroup to the total number of ECPs is used as the subgroup pollution rate. The coordinate entropy loss is calculated based on the distribution of the x-coordinates of all ECPs. The subgroup pollution rate and coordinate entropy loss are combined to obtain the composite subgroup integrity measure. In a single encrypted communication handshake process, the equivalent security strength of each level of the certificate chain sent by the server is extracted, and the minimum value is taken as the weakest equivalent security strength of the certificate chain. The equivalent security strength of the temporary key exchange parameters sent by the server in this handshake is also extracted. The weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters are subjected to symmetric difference normalization to obtain an asymmetric cross-validation measure. The composite subgroup integrity measure is then combined with the... The asymmetric cross-validation metric combination is a two-dimensional cryptographic consistency observation. As a joint observation, the log-likelihood ratio is calculated based on the normal joint distribution and the attack joint distribution during each encrypted communication handshake. All log-likelihood ratios are accumulated to obtain the cumulative log-likelihood ratio. The cumulative log-likelihood ratio is compared with the preset upper and lower bounds of the sequential probability ratio test. When the cumulative log-likelihood ratio is greater than or equal to the upper bound of the sequential probability ratio test, the communication subject is determined to be high-threat. When the cumulative log-likelihood ratio is less than or equal to the lower bound of the sequential probability ratio test, the communication subject is determined to be normal. When the cumulative log-likelihood ratio is between the upper and lower bounds of the sequential probability ratio test, the next encrypted communication handshake process continues to be observed. When the communication subject is determined to be normal, the joint observation of this encrypted communication handshake process is used to update the normal joint distribution. When the communication subject is determined to be high-threat, the joint observation of this encrypted communication handshake process is used to update the attack joint distribution.

[0020] In one embodiment of the present invention, step S1, which involves using the ratio of the number of elliptic curve temporary public key points that do not belong to a large prime order subgroup to the total number of all elliptic curve temporary public key points as the small subgroup pollution rate, includes the following steps: For each elliptic curve temporary public key point (ECP), it is verified whether it can be correctly parsed according to the protocol format and whether its affine coordinates are within the valid range of the finite field of the elliptic curve containing the ECP. If the verification fails, the ECP is directly marked as an outlier. If the verification passes, a scalar multiplication operation is performed using the cofactor of the elliptic curve, and it is determined whether the result of the scalar multiplication operation is equal to the point at infinity on the elliptic curve. For ECPs whose result is equal to the point at infinity, the order of the ECP is calculated, and it is determined whether the order is equal to the order of the large prime order subgroup of the elliptic curve. ECPs whose scalar multiplication result is not equal to the point at infinity and whose order is not equal to the order of the large prime order subgroup are all marked as outliers. The number of encrypted communication handshake processes corresponding to the ECPs marked as outliers is counted, and this number is taken as the number of small subgroup-pollinated sessions. The ratio of the number of small subgroup-pollinated sessions to the total number of all ECPs is taken as the small subgroup-pollution rate.

[0021] Specifically, the monitoring period refers to the time interval for continuous observation of the same communication entity, which is preset by the security policy. In this embodiment, the monitoring period is 24 hours. During the monitoring period, encrypted communication handshake messages between the communication entity and the client are continuously acquired via bypass. The communication entity is the monitored server-side entity, uniquely identified by the Server Name Indication (SNI), IP address, or certificate fingerprint. The same communication entity may correspond to multiple different client connections during the monitoring period, and the encrypted communication handshake processes of these connections are all within the observation scope of the communication entity.

[0022] The encrypted communication handshake process is a negotiation process between the client and the server before establishing an encrypted communication session. During this process, the client and server exchange random numbers, cipher suites, certificate chains, and key exchange parameters. In this embodiment, the encrypted communication handshake process is based on transport layer security protocols, including TLS 1.2, TLS 1.3, and compatible encrypted communication protocols. The server is the party that provides the certificate chain and sends server-side key exchange parameters during the encrypted communication handshake process. The elliptic curve temporary public key point sent by the server originates from the temporary public key parameter carried by the server in the handshake message containing the server-side key exchange parameters. The elliptic curve temporary public key point is a newly generated elliptic curve public key point by the server during this encrypted communication handshake process, used only for this key exchange, and is different from the long-term public key in the server certificate.

[0023] Passive sampling involves the monitor acquiring handshake messages at a bypass point in the network path during the encrypted communication handshake process. The monitor does not modify any handshake messages, inject any messages into the client or server, participate in key exchange calculations, or decrypt the communication content. The sampling object of passive sampling is the handshake message carrying the server-side key exchange parameters during each encrypted communication handshake process involving the communication entity within the monitoring period, specifically the handshake message that includes the elliptic curve temporary public key point sent by the server. Encrypted communication handshake processes that do not include the elliptic curve temporary public key point sent by the server, such as handshakes using only a pre-shared key, are not included in the statistics.

[0024] During the monitoring period, the same communication entity conducted k encrypted communication handshake processes, each involving an elliptic curve temporary public key point sent by the server. k is an integer not less than 10; in this embodiment, k is 20. The elliptic curve temporary public key point sent by the server is extracted during the i-th encrypted communication handshake process. , where i ranges from 1 to k. Each elliptic curve temporary public key point... In affine coordinates, it is represented by two finite field elements: the x-coordinate and the y-coordinate.

[0025] For TLS 1.3, the elliptic curve ephemeral public key point (ECP) sent by the server is located in the `key_share` extension of the `ServerHello` message. For TLS 1.2 and earlier versions, the ECP is located in the `ServerKeyExchange` message. During extraction, the curve parameters are determined based on the elliptic curve identifier negotiated during the handshake. The elliptic curve identifier is the identifier for a named curve group in the TLS protocol. Elliptic curve parameters include finite field characteristics, curve equation coefficients, base points, the order of the large prime-order subgroup, and cofactors. The monitor parses the ECP according to the TLS handshake message format to obtain the x and y coordinates in affine coordinates.

[0026] For each elliptic curve temporary public key point Execute the exception handling process. First, check... Perform validity verification and check. Whether the affine coordinates can be correctly parsed according to the TLS handshake message format, and whether both the x and y coordinates are within the finite field characteristic range of the elliptic curve where the epochal public key point is located. If it cannot be correctly resolved, or its affine coordinates exceed the feature range of the finite field, then... This is directly recorded as an anomaly, and the anomaly detection process ends. No further scalar multiplication operations will be performed.

[0027] like Through validity verification, determine Is it equal to the point O at infinity? If so... Then This is recorded as an anomaly, and the anomaly detection process ends. If... If it is not equal to 0, then use Perform scalar multiplication on the cofactor h of the elliptic curve to calculate Scalar multiplication is a dot product operation on elliptic curves, where... Multiplying by the integer h yields another point on the elliptic curve. (Judgment) Is it equal to the point O at infinity on the elliptic curve? If If it is not equal to 0, then it means Not belonging to the subgroup of large prime order, Record this as an outlier. If If the result is 0, proceed to the next step of the judgment.

[0028] To satisfy and For elliptic curve temporary public key points that are not equal to 0, verify whether the order of this point is equal to the order of the large prime-order subgroup of the elliptic curve. The order of the large prime-order subgroup of the elliptic curve is n. Calculate... Scalar multiplication with an integer n . judge Is it equal to the point O at infinity? If so... If it is not equal to 0, then it means The order is not n, Record this as an outlier. If ,but It belongs to the subgroup of large prime order and is not considered an outlier.

[0029] When the cofactor h equals 1, for example, the NIST P-256 curve, , It will be automatically established; only verification is required at this point. Whether it equals 0 can be used to determine Is it abnormal? When h is greater than 1, for example, in the Curve25519 curve, h is 8, and it passes verification. Whether it equals 0 can quickly eliminate most outliers that are not in subgroups of large prime order, through further verification. Whether it equals 0 can be confirmed. Is the order of a subgroup of large prime numbers equal to the order of the subgroup of large prime numbers?

[0030] The number of anomalies recorded during the anomaly detection process is counted. Since an elliptic curve temporary public key point is extracted during each encrypted communication handshake process, the number of encrypted communication handshake processes corresponding to the elliptic curve temporary public key points recorded as anomalies is the number of abnormal sessions. This number is used as the number of small subgroup pollution sessions. , The value of is an integer between 0 and k. When all elliptic curve temporary public key points belong to a large prime order subgroup... The value equals 0. This occurs when all elliptic curve temporary public key points are abnormal. Equal to k. The subgroup pollution rate is obtained by comparing it with the total number of elliptic curve temporary public key points k. ,in The value range is a closed interval between 0 and 1.

[0031] For example, within the monitoring period, the same communication entity conducted 20 encrypted communication handshake processes, each involving an elliptic curve temporary public key point sent by the server (k=20). Of the elliptic curve temporary public key points sent by the server, those from the 1st to the 18th were normal, while those from the 19th and 20th were abnormal. The 19th handshake used the Curve25519 curve, with a cofactor h=8, and the order n of the large prime order subgroup was a publicly available value from the standard parameter table of the curve. The temporary public key points sent by the server... satisfy ,therefore This was directly recorded as an anomaly. The 20th handshake used the NIST P-384 curve, h=1, where n is the public order of the curve. The temporary public key point sent by the server... satisfy ,but ,therefore These were recorded as outliers. The final count yielded the number of sessions contaminated by the small subgroup. =2, small subgroup contamination rate =0.1.

[0032] In one embodiment of the present invention, step S1, which involves calculating the coordinate entropy loss based on the distribution of the abscissas of all elliptic curve temporary public key points and combining the subgroup contamination rate with the coordinate entropy loss to obtain a composite subgroup integrity measure, includes the following steps: Divide the range of x-coordinates of all elliptic curve temporary public key points into B equal-width intervals; count the number of x-coordinates in each equal-width interval, and denote the number of x-coordinates in the j-th equal-width interval as . Calculate the empirical entropy of the x-coordinates based on the number of x-coordinates within each equal-width interval. The calculation formula is: Among them, when When =0, The value is 0; Theoretical maximum entropy The value is log2(B). Will and The absolute value of the ratio deviates as the coordinate entropy loss. ; Combining the contamination rate of small subgroups with the coordinate entropy deficit yields a measure of the integrity of composite subgroups. The calculation formula is: in, Let represent the number of subgroup pollution sessions, and k represent the total number of elliptic curve ephemeral public key points.

[0033] Specifically, all elliptic curve temporary public key points The corresponding x-coordinate is, where It is the i-th elliptic curve temporary public key point. The x-coordinate of the vector, i, ranges from 1 to k. All x-coordinates form a set. The horizontal axis is an element in a finite field. In this embodiment, the element of the finite field is directly used as the numerical representation of the horizontal axis.

[0034] Determine the number B of equal-width intervals, where B is the smallest integer not less than the square root of the total number of elliptic curve temporary public key points k. In this embodiment, k=20, therefore B is 5.

[0035] In a finite field, the range of values ​​for the x-axis is the entire element space of the finite field. For the Curve25519 curve used in this embodiment, its finite field characteristics are as follows: -19, the x-axis ranges from 0 to... All integers -20. For the NIST P-384 curve, its finite field characteristics are the values ​​in the published standard parameter table, and the range of the x-axis is all elements of the finite field. The range of the x-axis is uniformly divided into B equal-width intervals, and the width of each equal-width interval is the total number of elements in the finite field divided by B and rounded up. In this embodiment, B=5, and the space of the finite field elements is uniformly divided into 5 equal-width intervals. The first equal-width interval corresponds to the minimum end of the finite field element space, and the fifth equal-width interval corresponds to the maximum end of the finite field element space.

[0036] Determine each x-coordinate sequentially The number of x-coordinates within the j-th equal-width interval is denoted as [equation missing]. , where j ranges from 1 to B. The sum of the number of x-coordinates in all equal-width intervals satisfies .

[0037] Calculate the empirical entropy of the x-coordinates based on the number of x-coordinates within each equal-width interval. Where the number of x-coordinates within a certain equal-width interval... When it is 0, it is agreed Take 0.

[0038] Theoretical maximum entropy , This represents the entropy value achievable when all horizontal coordinates are perfectly uniformly distributed across B equally wide intervals. In this embodiment, B=5. It is approximately equal to 2.322 bits.

[0039] Will and The absolute value of the ratio deviates from the coordinate entropy loss, i.e., the coordinate entropy loss is... .when equal At that time, the coordinate entropy deficit is 0. Significantly smaller than When the coordinate entropy loss is greater than 0, the greater the deviation, the greater the coordinate entropy loss.

[0040] Combining the contamination rate of small subgroups with the coordinate entropy deficit yields a measure of the integrity of composite subgroups. . The value of is a closed interval from 0 to 1. ... =1 and When it is 0, =1.

[0041] For example, within the monitoring period, the same communication entity conducted 20 encrypted communication handshake processes, each involving an elliptic curve temporary public key point sent by the server, i.e., k=20, and the number of equal-width intervals B=5. ≈2.322 bits. The 20 x-coordinates falling into 5 equal-width intervals are as follows: 4 x-coordinates in the first interval, 5 x-coordinates in the second interval, 4 x-coordinates in the third interval, 4 x-coordinates in the fourth interval, and 3 x-coordinates in the fifth interval. That is... =4, =5, =4, =4, =3. (Result) ≈2.304 bits. The coordinate entropy deficit is... =0.008. Number of sessions contaminated by small subgroups. =2, the contamination rate of the small subgroup is 0.1. Finally, we obtain... ≈0.893. Therefore, the composite subgroup integrity metric of this communication entity during this monitoring period is approximately 0.893, which is significantly less than 1, indicating that the communication entity exhibits anomalies in subgroup integrity and randomness of elliptic curve temporary public key points.

[0042] In one embodiment of the present invention, step S2, which involves extracting the equivalent security strength of each level of the certificate in the certificate chain sent by the server and taking the minimum value as the weakest equivalent security strength of the certificate chain, includes the following steps: For each certificate in the certificate chain, extract the public key length, signature algorithm, and hash function. Determine the strength of the certificate's main public key algorithm and signature algorithm, where the main public key algorithm strength is calculated based on the complexity model of the best known attack corresponding to the algorithm type and key length of the main public key. The signature algorithm strength is determined based on the lower of the public key algorithm strength and the hash function strength. The lower of the main public key algorithm strength and the signature algorithm strength is taken as the equivalent security strength of the certificate. For two adjacent certificates in a certificate chain, calculate the difference between the equivalent security strength of the latter certificate and the equivalent security strength of the former certificate; count the number of adjacent level pairs whose absolute value of the difference exceeds a preset strength jump threshold; when the number does not exceed a preset jump tolerance number, take the minimum value among the equivalent security strengths of all certificate levels as the weakest equivalent security strength of the certificate chain; when the number exceeds the preset jump tolerance number, take the minimum value among the equivalent security strengths of all certificate levels, multiply the minimum value by a preset loss factor, and take the lost value as the weakest equivalent security strength of the certificate chain.

[0043] Specifically, during a single encrypted communication handshake, the certificate chain sent by the server is extracted from the handshake message obtained through passive sampling. A certificate refers to a digital certificate, specifically an X.509 format digital certificate in this embodiment. A certificate chain is a sequence of certificates starting from the server's leaf certificate, passing through intermediate certificates at each level, and ending at the trust anchor. The certificate chain is carried in the Certificate message of the TLS 1.2 and TLS 1.3 protocols. The certificate chain sent by the server includes all certificates from the server's leaf certificate along the trust path to the intermediate certificate closest to the root certificate, excluding the unsent root certificate. In this embodiment, the certificate chain extracted by the monitor contains... Level certificate It is an integer not less than 1.

[0044] Each certificate in the certificate chain is numbered sequentially from the leaf certificate to the root certificate, with the first level being the leaf certificate, the second level being the root certificate, and so on. The level is the certificate closest to the root certificate.

[0045] Extract the public key length, signature algorithm, and hash function of the p-th level certificate, where p ranges from 1 to... The public key length is the bit length of the main public key in the certificate. For RSA public keys, this is the bit length of the modulus; for elliptic curve public keys, it is the length of the public key point determined by the identifier of the corresponding named curve. The signature algorithm is the identifier of the signature algorithm used by the certificate issuer when signing the certificate. This identifier includes both the public key algorithm type and the hash function type. The hash function is the hash function used in the certificate's signature algorithm.

[0046] The complexity model of the best known attack against a certificate is determined based on the cryptographic primitive type of the p-th certificate. The cryptographic primitive type includes the algorithm type of the certificate's public key and the hash function type in the certificate's signature algorithm. The complexity model of the best known attack refers to the quantitative relationship between the computational complexity of the most efficient attack algorithm currently known against this cryptographic primitive and the key parameters.

[0047] For example, when the public key algorithm type is RSA, the best known attack is the general number field sieve, whose computational complexity has a sub-exponential growth relationship with the RSA modulus length. A common form is... , where N is the RSA modulus, c is a constant related to the specific implementation, and o(1) represents the term that approaches 0 as N approaches infinity. When the main public key algorithm type is elliptic curve, the best known attack is the Pollard rho algorithm, whose computational complexity has a square root-like growth relationship with the order of the large prime order subgroup, and its common form is , where n is the order of the large prime subgroup of the elliptic curve. When the hash function is SHA-1, the output bit length is 160 bits, which is substituted into the birthday attack complexity model. The resulting hash function has a strength of 80 bits, where l is the hash output bit length. When the hash function is SHA-384, the output bit length is 384 bits. Substituting this into the birthday attack complexity model... The resulting hash function has a strength of 192 bits.

[0048] Based on the algorithm type and key length of the public key of the p-th level certificate, the algorithm type and key length of the public key are substituted into the complexity model of the optimal known attack. The resulting computational complexity is then divided by the logarithm to base 2 to obtain the algorithm strength of the public key. When the algorithm type of the public key is RSA and the modulus is 1024 bits, the algorithm strength of the public key obtained after substituting it into the general number field sieve complexity model is 80 bits. When the algorithm type of the public key is RSA and the modulus is 3072 bits, the algorithm strength of the public key is 128 bits.

[0049] For public-key algorithm types not directly enumerated in the above examples, their public-key algorithm strength is determined as follows: If the algorithm is included in a cryptographic algorithm recommendation standard published by a national or international standards organization (such as NIST SP800-57), and the standard clearly specifies the equivalent security strength of the algorithm at a specific key length, then the standard value is directly used as the public-key algorithm strength. If the algorithm uses a fixed-parameter elliptic curve, and the order n of the large prime-order subgroup of the curve is known, then n is substituted into the Pollard-Rho algorithm complexity model. The computational complexity obtained is taken as the logarithm of base 2 and used as the strength of the main public key algorithm. If the algorithm has neither a standard recommended value nor a fixed parameter elliptic curve, then the computational complexity is taken as the logarithm of base 2 based on the known optimal attack method for the algorithm and used as the strength of the main public key algorithm.

[0050] Based on the public key algorithm type and key length in the signature algorithm of the p-th level certificate, the public key algorithm strength is determined using the same calculation method as the main public key algorithm strength. Based on the hash function type in the signature algorithm of the p-th level certificate, the hash function strength is determined using the hash function strength calculation method described above. The lower value between the signature algorithm public key algorithm strength and the hash function strength is taken as the signature algorithm strength. The lower value between the main public key algorithm strength and the signature algorithm strength is taken as the equivalent security strength of the p-th level certificate. .

[0051] For all in the certificate chain After completing the above operations, the equivalent security strength of each certificate level is obtained. .

[0052] Strength jump statistics are performed on adjacent pairs of certificates in the certificate chain. For each pair of adjacent certificates, the difference between the equivalent security strength of the subsequent certificate and the equivalent security strength of the preceding certificate is calculated, and the absolute value of this difference is taken as the difference between the adjacent certificate pairs. The subsequent certificate refers to the certificate numbered m+1, and the preceding certificate refers to the certificate numbered m, where m ranges from 1 to... -1. The difference between adjacent level pairs. .

[0053] Will It is compared with a preset intensity jump threshold τ. τ is a positive number; in this embodiment, τ is 40 bits. When When the value is greater than τ, the adjacent level pair is recorded as an intensity jump.

[0054] Count the total number of intensity jumps between all adjacent levels. , From 0 to An integer between -1 and 1. A preset jump tolerance number θ is set; in this embodiment, θ is 1, and θ is a non-negative integer.

[0055] when When the value does not exceed θ, the equivalent security strength of all certificate levels is taken. minimum value and will Directly used as the weakest equivalent security strength of the certificate chain ,Right now .

[0056] when When the value exceeds θ, take the minimum value among the equivalent security strengths of all certificate levels. and will Multiply by the preset loss factor The reduced value is used as the weakest equivalent security strength of the certificate chain. ,in In this embodiment, it is a positive number less than 1. Take 0.9.

[0057] For example, the certificate chain sent by the server contains three levels of certificates, namely... =3. The Level 1 leaf certificate is an RSA 1024-bit public key with a SHA-1 signature algorithm. The equivalent security strength is obtained by mapping according to the NIST SP 800-57 standard. =80 bits. The second-level intermediate certificate is an RSA 3072-bit public key, and the signature algorithm is SHA-384, resulting in... =128 bits. The third-level intermediate certificate is an RSA 1024-bit public key, and the signature algorithm is SHA-1, resulting in... =80 bits. The differences between adjacent level pairs are respectively =48, =48. Intensity jump threshold τ=40. =48 exceeds 40, =48 exceeds 40, therefore =2. Jump tolerance number θ=1, Exceeding θ. The minimum equivalent security strength across all certificate levels is 80 bits, i.e. =80. Depreciation coefficient. =0.9, therefore the weakest equivalent security strength of the certificate chain is... =80 × 0.9 = 72 bits.

[0058] In one embodiment of the present invention, step S2, which involves extracting the equivalent security strength of the temporary key exchange parameters sent by the server in this handshake, and performing symmetric difference normalization processing on the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters to obtain an asymmetric cross-validation metric, includes the following steps: Based on the type of key exchange algorithm used in the temporary key exchange parameters, the complexity model of the optimal known attack faced by the key exchange algorithm is determined. The temporary key exchange parameters are then substituted into this complexity model to calculate the equivalent security strength of the temporary key exchange parameters. ; Calculate asymmetric cross-validation metrics The calculation formula is: in This represents the weakest equivalent security strength of the certificate chain.

[0059] Specifically, during a single encrypted communication handshake, the temporary key exchange parameters sent by the server in this handshake are extracted from the handshake message obtained through passive sampling. These temporary key exchange parameters are temporary cryptographic parameters sent by the server during this encrypted communication handshake to complete the key exchange. In this step, the sampled elliptic curve temporary public key points and their corresponding elliptic curve identifiers are used as the temporary key exchange parameters.

[0060] The type of key exchange algorithm used in the temporary key exchange parameters is determined based on the elliptic curve identifier carried in the temporary key exchange parameters. In this embodiment, the key exchange algorithm type is an elliptic curve-based temporary key exchange algorithm, and the elliptic curve identifier is taken from the identifier of the named curve group in the TLS protocol.

[0061] Based on the key exchange algorithm type, determine the complexity model of the optimal known attack faced by that algorithm. For elliptic curve-based temporary key exchange algorithms, the optimal known attack is the Pollard rho algorithm, whose computational complexity grows in a square root order with respect to the order of a large prime subgroup. A common form is... ,in Let π be the order of the large prime-order subgroup of the elliptic curve corresponding to the temporary key exchange parameters, and π be the mathematical constant pi. Substituting the temporary key exchange parameters into the complexity model, and taking the logarithm of the resulting computational complexity to base 2, yields the equivalent security strength of the temporary key exchange parameters. .

[0062] When the elliptic curve identifier corresponding to the temporary key exchange parameters is Curve25519, the order of the large prime-order subgroup of this curve is the value in the publicly available standard parameter table. Substituting this into the Pollard rho algorithm complexity model yields an equivalent security strength of 128 bits. When the elliptic curve identifier corresponding to the temporary key exchange parameters is NIST P-384, the order of the large prime-order subgroup of this curve is the value in the publicly available standard parameter table. Substituting this into the Pollard rho algorithm complexity model yields an equivalent security strength of 192 bits. The equivalent security strength corresponding to other elliptic curve identifiers is determined in the same way. Curve25519 and NIST P-384 are only used as examples here. This method is also applicable to the temporary key exchange handshake process of other elliptic curve parameters (such as the Chinese national cryptographic SM2 curve), and the calculation method of their equivalent security strength is the same as in the example.

[0063] The weakest equivalent security strength of the certificate chain Equivalent security strength with temporary key exchange parameters Symmetric difference normalization is performed to obtain the asymmetric cross-validation metric. . The range of values ​​for is a closed interval from 0 to 1. When and When they are completely equal, the numerator is zero. It equals 1. When there is a difference between the two, Less than 1, and the greater the difference, The smaller.

[0064] For example, the certificate chain sent by the server during this encrypted communication handshake process contains three levels of certificates. The first level leaf certificate is a 1024-bit RSA public key with a SHA-1 signature algorithm and an equivalent security strength of 80 bits. The second level intermediate certificate is a 3072-bit RSA public key with a SHA-384 signature algorithm and an equivalent security strength of 128 bits. The third level intermediate certificate is a 1024-bit RSA public key with a SHA-1 signature algorithm and an equivalent security strength of 80 bits. The difference between adjacent level pairs is 48 bits, and the strength jump threshold τ is 40 bits. The value is 2, exceeding the jump tolerance number θ=1. The minimum equivalent security strength among all certificate levels is 80 bits, i.e. =80. Depreciation coefficient. The strength is 0.9, therefore the weakest equivalent security strength of the certificate chain. =80 × 0.9 = 72 bits. The elliptic curve identifier corresponding to the temporary key exchange parameters sent by the server during this encrypted communication handshake process is Curve25519. Substituting this into the Pollard-Rho algorithm complexity model yields the equivalent security strength of the temporary key exchange parameters. =128 bits. The final result is... The asymmetric cross-validation metric for this encrypted communication handshake process is approximately 0.721, which is significantly less than 1. This indicates a clear mismatch in security strength between the server's long-term identity and the temporary session during this encrypted communication handshake process.

[0065] In one embodiment of the present invention, step S3 includes the following steps: The composite subgroup integrity measure and the asymmetric cross-validation measure are combined into a two-dimensional cryptographic consistency observation, which serves as the joint observation for this encrypted communication handshake process. ; The normal joint distribution is constructed from joint observations of a predetermined number of encrypted communication handshake processes by the same communicating entity, while the attack joint distribution is constructed from joint observation samples that have been marked as attacks. During each encrypted communication handshake process, the log-likelihood ratio of that handshake process is calculated. The calculation formula is: in, To attack the joint distribution in joint observations The probability density value at that location, The normal joint distribution is in the joint observations The probability density value at that location; The log-likelihood ratio of this encrypted communication handshake process The cumulative sum of the log-likelihood ratios after the previous encrypted communication handshake process. The cumulative sum of the log-likelihood ratios after this encrypted communication handshake process is obtained. The log-likelihood ratio is greater than the cumulative sum and the initial value. =0.

[0066] Specifically, after the monitor has completed passive sampling of multiple encrypted communication handshake processes of the same communication subject, it has obtained the asymmetric cross-validation metric for each encrypted communication handshake process. Furthermore, a composite subgroup integrity measure for the same communication subject has been obtained. . This is the value calculated for all elliptic curve temporary public key points within the most recently completed monitoring window for the same communicating entity. During the current encrypted communication handshake, this calculated composite subgroup integrity metric is taken as the first component of the joint observation. As the monitoring window slides... It will be recalculated and updated, therefore the handshake processes used in different encrypted communications will be different. They can be different. This is a value calculated in real time during this encrypted communication handshake process. As the first component, As the second component, these components are combined into a two-dimensional vector, which represents the joint observation of this encrypted communication handshake process. , where t indicates that this encrypted communication handshake process is the t-th encrypted communication handshake process within the monitoring period, and t is an integer starting from 1.

[0067] The first component reflects the integrity and randomness of the subgroup of elliptic curve temporary public key points, while the second component reflects the degree of matching in security strength between long-term identities and temporary sessions. Therefore... This represents a two-dimensional cryptographic consistency observation.

[0068] Normal joint distribution consists of the first part of the same communication subject Joint observation construction for the secondary encrypted communication handshake process. This embodiment... Take 50. During the monitoring period, continuously record the joint observations of each encrypted communication handshake process for the same communication entity. When the number of joint observations for the same communication entity reaches... At this time, take advantage of this A normal joint distribution is constructed from the joint observations. This normal joint distribution adopts a bivariate normal distribution, which is determined by the mean vector and covariance matrix. The joint observations are as follows: Calculate the mean vector of the normal joint distribution. , Given a two-dimensional vector, its first component for The arithmetic mean of the first component in the joint observations, i.e. Its second component for The arithmetic mean of the second component in the joint observations, i.e. ;in The first component of the r-th joint observation, i.e., the integrity measure of the composite subgroup in the r-th joint observation. ; The second component of the r-th joint observation, i.e., the asymmetric cross-validation metric in the r-th joint observation. .

[0069] Calculate the covariance matrix of the normal joint distribution. , It is a second-order matrix. The formulas for calculating each element are: , , ,in The sample variance of the first component of the joint observations. The sample variance of the second component of the joint observations. and This is the sample covariance between the two components of the joint observation.

[0070] The joint attack distribution is constructed from joint observation samples already labeled as attacks. These labeled joint observation samples originate from historical attack data or labels added by security analysts to existing monitoring data. These samples are also two-dimensional vectors, each containing two components: a composite subgroup integrity measure and an asymmetric cross-validation measure. The total number of labeled joint observation samples is [number missing]. indivual, It is an integer not less than 2.

[0071] Due to the different types of cyber threats (including subgroup attacks, degradation attacks, and composite attacks) in joint observations The attack samples exhibit significantly different clustering distributions in the two-dimensional feature space. If a single binary normal distribution is used to fit all attack samples, the covariance matrix will be overstretched, weakening the detection capability. Therefore, in this embodiment, the joint attack distribution is constructed in the form of a multi-branch sub-distribution set. The joint observation samples marked as attacks are divided into three subsets according to type: subgroup attack sample set, downgraded attack sample set, and composite attack sample set. The mean vector and covariance matrix of each subset are calculated to obtain the subgroup attack sub-joint distribution. Degradation attack sub-distribution Joint distribution with composite attackers Each sub-joint distribution adopts a bivariate normal distribution, and its mean vector and covariance matrix are calculated in the same way as the normal joint distribution μ0 and Σ0, only the calculation objects are replaced with the corresponding type of attack sample subset. For unknown attacks, since their sample numbers are usually scarce, they are temporarily classified into the composite attack subset for unified processing in this embodiment; after a sufficient number of unknown attack samples are accumulated, a separate unknown attack sub-joint distribution can be constructed.

[0072] After the normal joint distribution and the attack joint distribution are constructed, from the... The +1 encrypted communication handshake process begins, and the log-likelihood ratio is calculated during each encrypted communication handshake. In this embodiment... =50, therefore the log-likelihood ratio is calculated starting from the 51st encrypted communication handshake process.

[0073] This encrypted communication handshake process is the t-th encrypted communication handshake process, where t starts from... +1 to begin. This will be the joint observation of the current encrypted communication handshake process. Substituting into the normal joint distribution respectively The probability density function and the joint distribution of attacks The probability density function is obtained. Joint attack distribution probability density value Take three sub-joint distributions in The maximum value among the probability density values ​​at that point, i.e. The probability density function of each sub-joint distribution is a bivariate normal distribution, determined by its respective mean vector and covariance matrix; its calculation method is the same as that of the normal joint distribution. The calculation method is the same, except that the mean vector and covariance matrix are replaced with the parameters of the corresponding sub-joint distribution. Among them, for The determinant, for The inverse matrix, Representing a two-dimensional vector The transpose of .

[0074] Then the log-likelihood ratio of the t-th encrypted communication handshake process .when Greater than hour, A value greater than 0 indicates that the joint observations more closely match the joint distribution of the attack. When Less than hour, A value less than 0 indicates that the joint observations are more consistent with the normal joint distribution.

[0075] The log-likelihood ratio of the t-th encrypted communication handshake process The cumulative sum of the log-likelihood ratios after the previous encrypted communication handshake process. The cumulative sum of the log-likelihood ratios after this encrypted communication handshake process is obtained. The log-likelihood ratio is greater than the cumulative sum and the initial value. =0, This represents the initial state before any log-likelihood ratio accumulation has begun.

[0076] For example, a normal joint distribution is constructed from joint observations of the first 50 encrypted handshake processes of the same communicating entity, i.e. =50. Mean vector of the normal joint distribution. The covariance matrix is ​​(0.95, 0.96). The joint distribution of attacks is constructed from 20 joint observation samples already labeled as attacks, including 8 subgroup attack samples, 7 degradation attack samples, and 5 composite attack samples. The mean vector of the subgroup attack sub-joint distribution is calculated to be (0.55, 0.90), and the covariance matrix is ​​calculated to be... The mean vector of the joint distribution of the downgrade attack sub-distributions is (0.90, 0.55), and the covariance matrix is... The mean vector of the joint distribution of the composite attackers is (0.60, 0.60), and the covariance matrix is... The log-likelihood ratio is calculated starting from the 51st encrypted handshake process. The joint observation value of the 51st encrypted handshake process is... =(0.72,0.68). (The rest of the text appears to be incomplete and requires further context.) Substitution Calculations yielded ≈0.021. Substituting the three attackers into their joint distribution, we can calculate the results. The log-likelihood ratio of the 51st encrypted handshake process. ≈2.72. The log-likelihood ratio of the 51st encrypted communication handshake process. A value greater than 0 indicates that the joint observations more closely match the joint distribution of the attack. The cumulative sum of the log-likelihood ratios after the 51st encrypted communication handshake is... =2.72.

[0077] In one embodiment of the present invention, step S4 includes the following steps: Based on the preset false alarm rate and the preset false negative rate Calculate the upper bound A and lower bound B of the sequential probability ratio test according to the threshold calculation formula, i.e. , ; The log-likelihood ratio is accumulated and summed. Compare with the upper bound A of the sequential probability ratio test and the lower bound B of the sequential probability ratio test; when At that time, the communication subject is determined to be a high threat, and... Reset to 0; obtain the integrity measure of the composite subgroup during the most recent encrypted communication handshake. With the aforementioned asymmetric cross-validation metric Preset subgroup integrity threshold and cross-validation threshold ;Will and The situation corresponds to a subgroup attack, which will and The situation corresponds to a downgrade attack, which will and The situation corresponds to a combined attack, which will and This situation corresponds to an unknown attack; when When the communication subject is determined to be normal, and... Reset to 0; when Then, continue to observe the next encrypted communication handshake process.

[0078] Specifically, the preset false alarm rate and the preset false negative rate The security policy is set before monitoring begins. This represents the upper limit of the probability of misjudging a normal communication entity as a high threat. This represents the upper limit of the probability of misclassifying a high-threat communication entity as normal. In this embodiment... Take 0.01, The value is set at 0.05. In encrypted communication threat monitoring, false alarms can lead security operations personnel to perform unnecessary investigations of normal communication entities, while false negatives can cause real attacks to be missed. In large-scale monitoring scenarios, the number of normal communication entities far exceeds the number of high-threat communication entities. Therefore, the false alarm rate needs to be controlled more strictly than the false negative rate to avoid overwhelming the alarm system with false alarms from a large number of normal communication entities. A value of 0.01 indicates that, on average, at most one out of every 100 normal communication entities will be mistakenly identified as a high threat. A value of 0.05 indicates that, on average, a maximum of 5 out of every 100 high-threat communication entities will be missed as normal. The two values ​​above represent typical configurations selected based on the balance between the number of alarms and detection latency in the sequential probability ratio test. When the security policy requires even lower false alarms, [the value will be adjusted accordingly]. Lowering the threshold increases the sequential probability compared to the upper bound A, requiring stronger accumulated evidence to classify a threat as high, thus increasing detection latency. When security policies demand lower false negative rates, [the threshold is lowered]. When the value is lowered, the sequential probability decreases compared to the lower bound B of the test, resulting in stronger cumulative evidence required to determine that the condition is normal.

[0079] according to and Calculate the upper bound of the sequential probability ratio test. The lower bound of the test of the probability ratio with the sequence ,Will =0.01 and Substituting 0.05 into the formula, we get A≈4.554 and B≈−2.986.

[0080] The cumulative sum of the log-likelihood ratios after the t-th encrypted communication handshake process Compare with A and B.

[0081] when At that time, the communication subject was determined to be a high threat. At this point, reset to 0, and enter the threat type determination process. The threat type determination process is: obtain the composite subgroup integrity metric in the most recent encrypted communication handshake process and the asymmetric cross-validation metric values. The preset subgroup integrity threshold is , and the cross-validation threshold is ; and are determined according to the joint observation value distribution of normal communication subjects, which are taken as =0.85, =0.85 in this embodiment. Compare with , and compare with . When and , the threat type is determined as a subgroup attack. When and , the threat type is determined as a downgrade attack. When and , the threat type is determined as a composite attack. When and , the threat type is determined as an unknown attack.

[0082] When , the communication subject is determined to be normal, is reset to 0, no alarm is triggered, and this determination is ended.

[0083] When , no determination is made on the communication subject, and the next encrypted communication handshake process is continuously observed. At this time, the current cumulative sum of log-likelihood ratios is maintained unchanged, waiting for the end of the next encrypted communication handshake process to update and perform the comparison again.

[0084] For example, the monitor continuously monitors the same communication subject. The cumulative sum of log-likelihood ratios after the 51st encrypted communication handshake process =2.72. The sequential probability ratio test upper bound A≈4.554, and the sequential probability ratio test lower bound B≈−2.986. Since B< <A, continue to observe the next encrypted communication handshake process, and keep unchanged.

[0085] After the 52nd encrypted communication handshake process, the log-likelihood ratio calculated according to the joint observation value of this time is 2.10, and the cumulative sum of log-likelihood ratios is updated =4.82. Compare with A and B, since ≥A, the communication subject is determined to be a high threat, and will Reset to 0 and proceed with the threat type determination process.

[0086] The composite subgroup integrity metric during the 52nd encrypted communication handshake was 0.72, and the asymmetric cross-validation metric was... The value is 0.68. Subgroup integrity threshold. =0.85, cross-validation threshold =0.85. Because Furthermore, the threat type was identified as a complex attack.

[0087] In one embodiment of the present invention, step S5 includes the following steps: When the communication subject is determined to be normal, the joint observations from this encrypted communication handshake process are used. The mean vector of the normal joint distribution before the update. Covariance Matrix Calculate the updated mean vector of the normal joint distribution. Covariance Matrix The calculation formula is: in, The preset update step size, Representing vectors Transpose of; When the communication subject is determined to be a high threat, the joint observations from this encrypted communication handshake process will be used. The mean vector of the joint distribution of the attacks before the update. Covariance Matrix The mean vector and covariance matrix of the updated attack joint distribution are calculated in the same manner as those for updating the normal joint distribution.

[0088] Specifically, when the determination result of this encrypted communication handshake process is "continue observation", the joint observation value of this encrypted communication handshake process is... This step is not used to update any joint distribution. This step ends and we await the next encrypted communication handshake process.

[0089] When the determination result is normal, the joint observation of this encrypted communication handshake process Used to update the normal joint distribution. The normal joint distribution before the update consists of the mean vector. Covariance Matrix Characterization. The updated normal joint distribution is represented by the mean vector. Covariance Matrix To depict. It is a two-dimensional vector, whose first component corresponds to the mean of the integrity measure of the composite subgroup in the joint observations, and the second component corresponds to the mean of the asymmetric cross-validation measure in the joint observations. It is a second-order matrix, whose diagonal elements are the variances of the two components, and whose off-diagonal elements are the covariances between the two components.

[0090] The calculation formula is ,in The preset update step size has a value range of 0 < <1. In this embodiment Taking 0.1, when the behavior of a normal communicating entity undergoes a slow drift, A value of 0.1 allows the joint distribution to gradually adapt to new behavioral patterns within approximately 10 encrypted communication handshakes, while the impact of a single outlier on the joint distribution does not exceed 10%. When security policies require even faster adaptation, [the value will be adjusted accordingly]. Increasing the value to between 0.2 and 0.3 allows the joint distribution to adapt to the new behavior pattern within approximately 3 to 5 encrypted communication handshake processes, thus increasing the impact of a single outlier on the joint distribution. When higher stability is required by the security strategy, [the value will be adjusted accordingly]. When the value is reduced to between 0.02 and 0.05, the joint distribution requires approximately 20 to 50 encrypted communication handshakes to adapt to the new behavioral pattern, significantly reducing the impact of a single outlier on the joint distribution. This formula represents the convex combination of the original mean vector and the current joint observations to obtain the updated mean vector.

[0091] The calculation formula is ,in, Representing a two-dimensional vector transpose, It is a second-order matrix whose elements are composed of vectors. The components are multiplied pairwise to obtain the updated covariance matrix. This formula represents the convex combination of the outer product matrix of the covariance matrix before the update and the deviation of the current observation from the mean, resulting in the updated covariance matrix.

[0092] When the assessment result is high threat, the joint observation Zt of this encrypted communication handshake process is used to update the joint attack distribution. Since the joint attack distribution consists of multiple sub-joint distributions, during the update, only the corresponding sub-joint distribution needs to be updated according to the attack type to which this high threat belongs, while the parameters of the remaining unupdated sub-joint distributions remain unchanged.

[0093] If the high threat is a subgroup attack, then update the joint distribution of subgroup attacks. The original joint distribution of subgroup attacks is determined by the mean vector. Covariance Matrix Characterization, the updated mean vector is obtained through calculation formula. and the updated covariance matrix .

[0094] If the current high-threat attack is a downgrade attack, then update the joint distribution of the downgrade attack subgroups. The previous joint distribution of the subgroup attack subgroups was determined by the mean vector. Covariance Matrix The updated mean vector is obtained using the same calculation formula as the joint distribution of the updated subgroup attackers. and the updated covariance matrix .

[0095] If the current high-threat attack is a composite attack (including unknown attacks classified into a subset of composite attacks), then update the joint distribution of the composite attack subgroups. Similarly, the joint distribution of the subgroup attacks before the update is determined by the mean vector. Covariance Matrix The updated mean vector is obtained using the same calculation formula as the joint distribution of the updated subgroup attackers. and the updated covariance matrix .

[0096] If the current decision is to continue observation, no updates to the joint distribution of attacking sub-distributions will be made. Updates to each joint distribution are independent and do not affect each other. The update step size here... Used when updating the normal joint distribution They have the same value.

[0097] Through the above updates, the normal joint distribution or the attack joint distribution absorbs the joint observations of this encrypted communication handshake process, enabling the corresponding joint distribution to gradually adjust as the behavior of the communication subjects changes.

[0098] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A method for detecting encrypted communication threats based on cryptographic properties, characterized in that, Includes the following steps: S1: During the monitoring period, passive sampling is performed on multiple encrypted communication handshake processes of the same communication subject, and the elliptic curve temporary public key points sent by the server in each handshake are extracted; the ratio of the number of temporary public key points that do not belong to the large prime order subgroup to the total number of all elliptic curve temporary public key points is used as the subgroup pollution rate; the coordinate entropy loss is calculated based on the distribution of the abscissas of all elliptic curve temporary public key points; the subgroup pollution rate and the coordinate entropy loss are combined to obtain the composite subgroup integrity measure; S2: During a single encrypted communication handshake, extract the equivalent security strength of each level of the certificate in the certificate chain sent by the server and take the minimum value as the weakest equivalent security strength of the certificate chain; extract the equivalent security strength of the temporary key exchange parameters sent by the server in this handshake; perform symmetric difference normalization on the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters to obtain the asymmetric cross-validation metric. S3: Combine the composite subgroup integrity measure with the asymmetric cross-validation measure into a two-dimensional cryptographic consistency observation value as a joint observation value. Calculate the log-likelihood ratio based on the normal joint distribution and the attack joint distribution during each encrypted communication handshake process. Sum all the log-likelihood ratios to obtain the cumulative sum of the log-likelihood ratios. S4: Compare the cumulative log-likelihood ratio with a preset upper bound and a preset lower bound of the sequential probability ratio test; when the cumulative log-likelihood ratio is greater than or equal to the upper bound of the sequential probability ratio test, the communication subject is determined to be a high threat; when the cumulative log-likelihood ratio is less than or equal to the lower bound of the sequential probability ratio test, the communication subject is determined to be normal; when the cumulative log-likelihood ratio is between the upper bound and the lower bound of the sequential probability ratio test, continue to observe the next encrypted communication handshake process; S5: When the communication subject is determined to be normal, the joint observations of this encrypted communication handshake process are used to update the normal joint distribution; when the communication subject is determined to be a high threat, the joint observations of this encrypted communication handshake process are used to update the attack joint distribution.

2. The method for detecting encrypted communication threats based on cryptographic characteristics according to claim 1, characterized in that, In step S1, the step of using the ratio of the number of elliptic curve temporary public key points that do not belong to the large prime order subgroup to the total number of all elliptic curve temporary public key points as the small subgroup pollution rate includes the following steps: For each elliptic curve temporary public key point (ECP), it is verified whether it can be correctly parsed according to the protocol format and whether its affine coordinates are within the valid range of the finite field of the elliptic curve containing the ECP. If the verification fails, the ECP is directly marked as an outlier. If the verification passes, a scalar multiplication operation is performed using the cofactor of the elliptic curve, and it is determined whether the result of the scalar multiplication operation is equal to the point at infinity on the elliptic curve. For ECPs whose result is equal to the point at infinity, the order of the ECP is calculated, and it is determined whether the order is equal to the order of the large prime order subgroup of the elliptic curve. ECPs whose scalar multiplication result is not equal to the point at infinity and whose order is not equal to the order of the large prime order subgroup are all marked as outliers. The number of encrypted communication handshake processes corresponding to the ECPs marked as outliers is counted, and this number is taken as the number of small subgroup-pollinated sessions. The ratio of the number of small subgroup-pollinated sessions to the total number of all ECPs is taken as the small subgroup-pollution rate.

3. The method for detecting encrypted communication threats based on cryptographic characteristics according to claim 2, characterized in that, In step S1, the calculation of coordinate entropy loss based on the distribution of the abscissas of all elliptic curve temporary public key points, and the combination of the subgroup pollution rate and coordinate entropy loss to obtain the composite subgroup integrity measure, includes the following steps: Divide the range of x-coordinates of all elliptic curve temporary public key points into B equal-width intervals; count the number of x-coordinates in each equal-width interval, and denote the number of x-coordinates in the j-th equal-width interval as . Calculate the empirical entropy of the x-coordinates based on the number of x-coordinates within each equal-width interval. The calculation formula is: Among them, when When =0, The value is 0; Theoretical maximum entropy The value is log2(B). Will and The absolute value of the ratio deviates as the coordinate entropy loss. ; Combining the contamination rate of small subgroups with the coordinate entropy deficit yields a measure of the integrity of composite subgroups. The calculation formula is: in, Let represent the number of subgroup pollution sessions, and k represent the total number of elliptic curve ephemeral public key points.

4. The method for detecting encrypted communication threats based on cryptographic characteristics according to claim 1, characterized in that, In step S2, extracting the equivalent security strength of each level of the certificate in the certificate chain sent by the server and taking the minimum value as the weakest equivalent security strength of the certificate chain includes the following steps: For each certificate in the certificate chain, extract the public key length, signature algorithm, and hash function. Determine the strength of the certificate's main public key algorithm and signature algorithm, where the main public key algorithm strength is calculated based on the complexity model of the best known attack corresponding to the algorithm type and key length of the main public key. The signature algorithm strength is determined based on the lower of the public key algorithm strength and the hash function strength. The lower of the main public key algorithm strength and the signature algorithm strength is taken as the equivalent security strength of the certificate. For two adjacent certificates in a certificate chain, calculate the difference between the equivalent security strength of the latter certificate and the equivalent security strength of the former certificate; count the number of adjacent level pairs whose absolute value of the difference exceeds a preset strength jump threshold; when the number does not exceed a preset jump tolerance number, take the minimum value among the equivalent security strengths of all certificate levels as the weakest equivalent security strength of the certificate chain; when the number exceeds the preset jump tolerance number, take the minimum value among the equivalent security strengths of all certificate levels, multiply the minimum value by a preset loss factor, and take the lost value as the weakest equivalent security strength of the certificate chain.

5. The method for detecting encrypted communication threats based on cryptographic characteristics according to claim 1, characterized in that, In step S2, extracting the equivalent security strength of the temporary key exchange parameters sent by the server in this handshake, and performing symmetric difference normalization processing on the weakest equivalent security strength of the certificate chain and the equivalent security strength of the temporary key exchange parameters to obtain the asymmetric cross-validation metric, includes the following steps: Based on the type of key exchange algorithm used in the temporary key exchange parameters, the complexity model of the optimal known attack faced by the key exchange algorithm is determined. The temporary key exchange parameters are then substituted into this complexity model to calculate the equivalent security strength of the temporary key exchange parameters. ; Calculate asymmetric cross-validation metrics The calculation formula is: in This represents the weakest equivalent security strength of the certificate chain.

6. The method for detecting encrypted communication threats based on cryptographic characteristics according to claim 1, characterized in that, S3 includes the following steps: The composite subgroup integrity measure and the asymmetric cross-validation measure are combined into a two-dimensional cryptographic consistency observation, which serves as the joint observation for this encrypted communication handshake process. ; The normal joint distribution is constructed from joint observations of a predetermined number of encrypted communication handshake processes by the same communicating entity, while the attack joint distribution is constructed from joint observation samples that have been marked as attacks. During each encrypted communication handshake process, the log-likelihood ratio of that handshake process is calculated. The calculation formula is: in, To attack the joint distribution in joint observations The probability density value at that location, The normal joint distribution is in the joint observations The probability density value at that location; The log-likelihood ratio of this encrypted communication handshake process The cumulative sum of the log-likelihood ratios after the previous encrypted communication handshake process. The cumulative sum of the log-likelihood ratios after this encrypted communication handshake process is obtained. The log-likelihood ratio is greater than the cumulative sum and the initial value. =0.

7. The method for detecting encrypted communication threats based on cryptographic characteristics according to claim 1, characterized in that, S4 includes the following steps: Based on the preset false alarm rate and the preset false negative rate Calculate the upper bound A and lower bound B of the sequential probability ratio test according to the threshold calculation formula, i.e. , ; The log-likelihood ratio is accumulated and summed. Compare with the upper bound A of the sequential probability ratio test and the lower bound B of the sequential probability ratio test; At that time, the communication subject was determined to be a high threat and its value was reset to 0; the integrity measure of the composite subgroup during the most recent encrypted communication handshake was obtained. With the aforementioned asymmetric cross-validation metric Preset subgroup integrity threshold and cross-validation threshold ;Will and The situation corresponds to a subgroup attack, which will and The situation corresponds to a downgrade attack, which will and The situation corresponds to a combined attack, which will and This situation corresponds to an unknown attack; when When the communication subject is determined to be normal, and... Reset to 0; when Then, continue to observe the next encrypted communication handshake process.

8. The method for detecting encrypted communication threats based on cryptographic characteristics according to claim 1, characterized in that, S5 includes the following steps: When the communication subject is determined to be normal, the joint observations from this encrypted communication handshake process are used. The mean vector of the normal joint distribution before the update. Covariance Matrix Calculate the updated mean vector of the normal joint distribution. Covariance Matrix The calculation formula is: When the communication subject is determined to be a high threat, the joint observations from this encrypted communication handshake process will be used. The mean vector of the joint distribution of the attacks before the update. Covariance Matrix The mean vector and covariance matrix of the updated attack joint distribution are calculated in the same manner as those for updating the normal joint distribution.