File security management method and system, electronic equipment, medium and program product
Through the AI security model, the network traffic and user behavior data are processed, and the work keys are dynamically updated, which solves the security risks of static keys in file transfer and improves the security and adaptability of file transfer.
Patent Information
- Application Number
- CN202411103027.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-12
AI Technical Summary
In the prior art, the use of static keys during file transmission poses a security risk, and once it is cracked, it loses its protection ability, resulting in a reduction in file transmission security.
By obtaining network traffic data and user behavior data, input it into the pre-trained AI security model, generate exception detection parameters and risk scores, determine dynamic key generation factors, dynamically update work keys, and use them for file encryption to ensure the key Dynamic and security.
It realizes dynamic key management during file transfer, avoids security threats after static keys are cracked, and improves the security and adaptability of file transfer.
Smart Images

Figure CN119011244A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a file security management method, system, electronic equipment and computer storage medium. Background Art
[0002] At present, to ensure the security of file transmission, the main method is to obfuscate and compress files (such as JS (JavaScript, scripting language) files) to prevent the source code from being easily read and understood, and some public JS obfuscation and compression tools are used, such as UglifyJS (a JS code compression tool) and Terser (a JS code compressor). However, there are certain defects in using these tools. For example, after the key is generated by the JS obfuscation and compression tool, the key will remain unchanged for a long time and is a static key. Once an attack occurs, the static key will be cracked, which will lead to the leakage of JS files, making the security of file transmission lower. Summary of the invention
[0003] The main purpose of the present invention is to provide a front-end application access method, system, electronic device and computer storage medium, aiming to solve the technical problem of how to improve the security of files during file transmission.
[0004] To achieve the above objectives, the present application provides a file security management method, which is applied to a key management system, including:
[0005] Obtain network traffic data and user behavior data sent by website servers;
[0006] Input the network traffic data and user behavior data into a pre-trained artificial intelligence (AI) security model to obtain anomaly detection parameters and risk scores;
[0007] determining a dynamic key generation factor based on the anomaly detection parameter and the risk score;
[0008] Generate a working key based on the dynamic key generation factor and a preset master key;
[0009] The working key is sent to the website server, wherein the website server uses the working key as the latest working key, encrypts the target file corresponding to the file request to obtain an encrypted file, and sends the encrypted file to the user end.
[0010] In one embodiment, the step of determining a dynamic key generation factor according to the anomaly detection parameter and the risk score comprises:
[0011] The abnormality detection parameter, the risk score, the preset environmental parameter and the random noise are processed in a nonlinear combination to generate a dynamic key generation factor.
[0012] In one embodiment, before the step of determining the dynamic key generation factor according to the anomaly detection parameter and the risk score, the method includes:
[0013] Detecting whether the network traffic data and the user behavior data meet a preset update condition, wherein the preset update condition includes at least one of the network traffic data and the user behavior data matching preset abnormal traffic data;
[0014] If the preset update condition is met, the step of determining the dynamic key generation factor based on the anomaly detection parameter and the risk score is performed;
[0015] If the preset update condition is not met, continue to execute the step of obtaining the network traffic data and user behavior data sent by the website server.
[0016] In one embodiment, the method further includes:
[0017] Determining training data, wherein the training data includes training samples and sample labels, the training samples include historical network traffic data and historical user behavior data, and the sample labels include historical anomaly detection parameters and historical risk scores;
[0018] Input the training sample into a preset AI security model for model training, output a prediction result, and determine a loss function value based on the sample label, the prediction result and the loss function corresponding to the AI security model;
[0019] The model parameters of the AI security model are updated according to the loss function value until the trained AI security model meets the preset training end condition, thereby obtaining a pre-trained AI security model, wherein the model parameter update includes the fine-tuning layer parameter update in the AI security model.
[0020] In addition, to achieve the above-mentioned purpose, the embodiment of the present application also provides a file security management method, which is applied to a website server, and the method includes:
[0021] Real-time monitoring of network traffic data and user behavior data;
[0022] Sending the network traffic data and user behavior data to a key management system, wherein the key management system processes the network traffic data and user behavior data according to an AI security model to obtain anomaly detection parameters and risk scores, and generates a working key based on a dynamic key generation factor determined by the anomaly detection parameters and risk scores and a preset master key, and sends the working key to the website server;
[0023] Obtaining a working key sent by the key management system, and using the working key as the latest working key to encrypt a target file corresponding to a file request to obtain an encrypted file, wherein the user terminal sends a file request to the website server;
[0024] The encrypted file is sent to the client, wherein the client decrypts the encrypted file.
[0025] In one embodiment, after the step of sending the network traffic data and the user behavior data to the key management system, the following steps are included:
[0026] If no working key sent by the key management system is received within a preset time period, all stored historical working keys are obtained;
[0027] Determine the storage time corresponding to each of the historical working keys, and determine the historical working key corresponding to the storage time closest to the current time as the latest working key, encrypt the file corresponding to the file request according to the latest working key, and send the encrypted file to the user end.
[0028] In addition, to achieve the above purpose, the embodiment of the present application provides a file security management system, which includes a key management system and a website server.
[0029] The website server is used to monitor network traffic data and user behavior data in real time, and send the network traffic data and user behavior data to the key management system;
[0030] The key management system is used to obtain network traffic data and user behavior data sent by the website server; input the network traffic data and user behavior data into a pre-trained AI security model to obtain anomaly detection parameters and risk scores; determine a dynamic key generation factor based on the anomaly detection parameters and risk scores; generate a working key based on the dynamic key generation factor and a preset master key; and send the working key to the website server;
[0031] The website server is used to obtain the working key sent by the key management system, use the working key as the latest working key to encrypt the target file corresponding to the file request to obtain an encrypted file; send the encrypted file to the user end, wherein the user end that sends the file request decrypts the encrypted file.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which includes: a memory, a processor, and a file security management program stored on the above-mentioned memory and executable on the above-mentioned processor, and when the above-mentioned file security management program is executed by the above-mentioned processor, the steps of the above-mentioned file security management method are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a medium, which is a computer-readable storage medium, and a file security management program is stored on the above-mentioned computer storage medium. When the above-mentioned file security management program is executed by the processor, the steps of the above-mentioned file security management method are implemented.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a program product, which includes a computer program product, and the above-mentioned computer program product includes a file security management program. When the above-mentioned file security management program is executed by a processor, the steps of the above-mentioned file security management method are implemented.
[0035] The embodiment of the present application obtains the network traffic data and user behavior data sent by the website server in the key management system, and then inputs the network traffic data and user behavior data into the AI security model to obtain the anomaly detection parameters and risk scores, thereby realizing the intelligent monitoring of network traffic data and user behavior data through the AI security model in the key management system, and accurately assessing potential risks. In addition, the dynamic key generation factor is determined according to the anomaly detection parameters and risk scores, and the working key is generated according to the dynamic key generation factor and the master key, and the working key is sent to the website server, thereby realizing the real-time update and generation of new working keys according to the network traffic data and user behavior data. It avoids the phenomenon that the existing technology uses static keys and loses the protection ability once cracked, so that the key is a dynamic working key. The website server uses the working key as the latest working key to encrypt the target file corresponding to the file request, and sends the encrypted file to the user end, so that the target file can be encrypted using a dynamic working key, which ensures the security of the file and improves the security of the file during file transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a flowchart of the first embodiment of the method for secure management of application documents;
[0037] Figure 2This is a flow chart of the second embodiment of the method for secure management of application documents;
[0038] Figure 3 A schematic diagram of the training and application process of the AI security model in the security management method of this application document;
[0039] Figure 4 This is a flowchart of the fourth embodiment of the method for secure file management of this application;
[0040] Figure 5 System workflow diagram in the application document security management method;
[0041] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the security management method of this application document.
[0042] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0044] Since the current key management is performed in a static manner, there are certain security risks. Therefore, in this embodiment, a dynamic key generation and update mechanism of an AI security model (such as an AI security vertical model based on the Llama2 large model (a large language model)) can be adopted, which can be updated in real time according to network behavior and user behavior, and dynamically generate and update keys. Network behavior and user behavior can be determined based on network traffic data and user behavior data.
[0045] Optionally, this embodiment can perform intelligent anomaly detection based on the AI security model, can intelligently detect abnormal network and user behaviors, and accurately assess potential risks. And compared with the use of static keys, which lose their protection capabilities once cracked, this embodiment uses dynamic key management to enhance security. It can dynamically update keys based on the dynamic key generation and update mechanism of the AI security model according to the detected threats, thereby improving the security and adaptability of the key management system. And the dynamic key generation and update mechanism needs to generate key generation factors according to the AI security model, and the key generation factor is a fusion of multiple complex factors such as risk assessment, abnormal patterns, environmental context, model parameters, and random noise. It is generated through a learnable nonlinear combination, has sufficient complexity and dynamics, and is difficult to be predicted and copied by attackers.
[0046] This embodiment can perform intelligent security access detection based on the AI security model. By deploying the AI security vertical large model fine-tuned by the Llama2 large model, it monitors network traffic and user behavior data in real time, identifies abnormal behavior and potential attacks through machine learning algorithms, and realizes intelligent risk assessment. And it can also realize dynamic key generation and management mechanism. Through the AI security model, according to the abnormal situation detected in real time, the key generation factor is output, and the key generation factor is combined with other parameters to generate a new key, that is, a working key. And it is stored in an encrypted database and distributed to the required system components. The front-end JS file encryption uses the new key to realize the dynamic update of the key. This embodiment can ensure the confidentiality and integrity of the front-end JS file, prevent it from being stolen, tampered with and reverse cracked, thereby protecting the security of Web (World Wide Web, Global Wide Area Network) applications. At the same time, the dynamic key management mechanism can respond to security threats in a timely manner and improve the flexibility and adaptability of the system.
[0047] Reference Figure 1 The present application provides a file security management method, which is applied to a key management system. In a first embodiment of the file security management method, the file security management method includes steps S10-S50.
[0048] Step S10, obtaining network traffic data and user behavior data sent by the website server;
[0049] Optionally, the network traffic data and user behavior data may be the network traffic data and user behavior data monitored in real time by the website server and sent to the key management system, which may include IP address (Internet Protocol Address), port number, data packet size, request header, request parameter, event type, event frequency, user ID (IDentity) and device fingerprint, etc. Optionally, the network traffic data may be IP address, port number, data packet size, etc. The user behavior data may be user ID and device fingerprint, etc.
[0050] Optionally, the key management system and the website server may be integrated in the same terminal, or may be deployed in different terminals respectively, which is not limited here.
[0051] Step S20, inputting network traffic data and user behavior data into a pre-trained AI security model to obtain anomaly detection parameters and risk scores;
[0052] Optionally, the anomaly detection parameter may include at least one of an anomaly detection probability and an anomaly pattern. The label result corresponding to the anomaly detection probability may be 0 or 1. If it is 0, it means that there is no anomaly, and if it is 1, it means that there is an anomaly. When it is determined that there is an anomaly, the anomaly pattern may be determined based on network traffic data and user behavior data. The risk score may be generated by evaluating the current security risk level according to the anomaly pattern when it is determined that there is an anomaly. It may also be generated by performing risk scoring based on abnormal behavior characteristics.
[0053] Optionally, a trained AI security model can be deployed in the key management system. The AI security model can be an AI security vertical model based on Llama2. The model uses LoRA technology (Low-Rank Adaptation of Large Language Models) to perform fine-tuning on the basis of Llama2, and is specifically used to detect abnormal access behavior and assess security risks.
[0054] Optionally, after obtaining the network traffic data and user behavior data, data preprocessing can be performed on the network traffic data and user behavior data, including data cleaning, normalization processing, and feature extraction, to obtain an input feature vector. The input feature vector is input into a pre-trained AI security model for model training.
[0055] Optionally, there are two branch tasks in the AI security model, namely, anomaly detection task and risk assessment task. For the anomaly detection task, the model output result is the anomaly detection probability, and the corresponding loss function is the cross entropy function. For the risk assessment task, the model output result is the risk score, and the corresponding loss function is the mean square error function.
[0056] Optionally, the risk assessment task can be performed through the AI security model to generate a corresponding risk score. Optionally, the risk score can be used to quantify the security risk level of the current environment. In the AI security model, LightGBM (Light Gradient Boosting Machine) can be used as a machine learning model to train a risk assessor. LightGBM is a decision tree-based gradient boosting framework with the advantages of fast training speed, low memory usage, and high accuracy. It is very suitable for processing high-dimensional heterogeneous features.
[0057] Optionally, the abnormal behavior characteristics may be determined first, such as extracting the abnormal behavior characteristics from historical security event logs, and then assigning corresponding risk scores according to the severity of the events.
[0058] Optionally, abnormal behavior characteristics may include but are not limited to:
[0059] Failed logins: The number of failed logins in the past hour, day, week, etc.
[0060] Abnormal login time: The number of login times that fall during non-regular working hours (such as 3 a.m.).
[0061] Abnormal login location: The degree of deviation of the login location from the usual location, which can be measured by geographical distance or IP location.
[0062] Abnormal traffic: The abnormal degree of access traffic in different time windows such as the past hour, day, and week.
[0063] Number of sensitive operations: the number of addition, deletion, and modification operations on key resources (such as management backend, database, etc.).
[0064] Abnormal access path: the number of times non-conventional functional modules or pages are accessed, such as accessing the debug page of the management backend.
[0065] Known attack signatures: The number of times the access request contains known attack signatures (such as SQL (Structured Query Language) injection, etc.).
[0066] Optionally, the risk score may be a real number between 0 and 1, indicating the security risk level of the current environment. Different risk scores corresponding to different risk levels may be shown in Table 1 below.
[0067] Risk Scoring Risk Level describe [0.0,0.2) Low Acceptable risk, no action required [0.2,0.4) middle Medium risk, action needs to be taken at the right time [0.4,0.7) high High risk, action needed as soon as possible [0.7,1.0] key Key risks requiring immediate action
[0068] Table 1
[0069] Optionally, during the model training phase, the LightGBM model in the AI security model can be trained according to Table 1 above, abnormal behavior features can be input, risk scores can be output, and regression loss functions such as mean square error and cross entropy can be used, as well as sample weights can be introduced to train the model to improve the model's sensitivity to high-risk events. During the model application phase, the feature vectors corresponding to the network traffic data and user behavior data can be directly input into the LightGBM model in the AI security model, and the corresponding risk scores can be output.
[0070] Optionally, when the AI security model receives feature vectors corresponding to network traffic data and user behavior data and performs anomaly detection tasks, the feature vectors can be analyzed from three feature attributes: statistical features, frequency features, and timing features, so as to determine the network traffic characteristics and user behavior characteristics.
[0071] Optionally, network traffic features may include the frequency, entropy, and TF-IDF (TermFrequency_Inverse Document Frequency, a statistical method) of source / destination IP addresses; the frequency, entropy, and TF-IDF of source / destination port numbers; the mean, variance, and quantile of traffic size; and the mean, variance, and quantile of traffic duration. User behavior features may include the frequency, entropy, and TF-IDF of operation types (login / logout / query / modify); the trend, cycle, and autocorrelation of operation timestamps; the frequency, entropy, and TF-IDF of operation objects (files / databases / systems); the frequency, sequence pattern, and the like of user IDs; and the frequency and sequence pattern of device fingerprints (browsers / operating systems / versions).
[0072] Optionally, different abnormal patterns can be compactly encoded, the center point of each abnormal cluster (ie, the sample that best represents the characteristics of the cluster) is extracted, and mapped into a fixed-length binary string using a hash function, namely, the abnormal pattern encoding.
[0073] Optionally, the mean of the sample feature vector of each abnormal cluster can be calculated as the center point vector of the cluster, and the center point vector can be normalized to scale each element to the interval [0, 1]. A secure hash function is used to map the normalized center point vector to a binary string of fixed length. Optionally, if there are multiple abnormal clusters, the binary strings of each cluster are concatenated to form the final abnormal pattern part.
[0074] For example, if there are three abnormal clusters, their center point vectors are cluster 1: [0.2, 0.5, 0.1, 0.8]; cluster 2: [0.9, 0.3, 0.6, 0.4]; cluster 3: [0.1, 0.7, 0.2, 0.3]. Each center point vector can be normalized and then hashed using a secure hash function to obtain each hash value. That is:
[0075] Cluster 1: Hash([0.2, 0.5, 0.1, 0.8]) = "a4b7c8..."; Cluster 2: Hash([0.9, 0.3, 0.6, 0.4]) = "1d2e3f..."; Cluster 3: Hash([0.1, 0.7, 0.2, 0.3]) = "a1b2c3...".
[0076] Therefore, the final exception pattern part is "a4b7c8...1d2e3f...a1b2c3...". This allows the exception pattern to be compressed into a compact binary representation, which is convenient for subsequent storage, comparison, and analysis.
[0077] Optionally, if the AI security model determines that there is an abnormal pattern, the corresponding abnormal detection probability is determined to be 1, and the specific abnormal pattern can refer to the above description. If the AI security model determines that there is no abnormal pattern, the corresponding abnormal probability is determined to be 0.
[0078] Step S30, determining a dynamic key generation factor based on anomaly detection parameters and risk scores;
[0079] Optionally, after the anomaly detection parameters and risk scores are determined through the AI security model, the corresponding dynamic key generation factor can be generated in the AI security model through the LoRA fine-tuning technology of the Llama2 model.
[0080] Optionally, a dynamic key generation factor may be generated through a key generation function according to the anomaly detection probability, risk score, current timestamp and environmental parameters in the anomaly detection parameters. Optionally, the key generation function may use a secure hash algorithm, such as SHA-256 (Secure Hash Algorithm 256-bit), and introduce a random salt value in the hash algorithm to enhance unpredictability.
[0081] In a feasible embodiment, step S30, the step of determining a dynamic key generation factor based on anomaly detection parameters and risk scores, includes step a10.
[0082] Step a10, performing nonlinear combination processing on the anomaly detection parameter, risk score, preset environmental parameter and random noise to generate a dynamic key generation factor.
[0083] Optionally, the dynamic key generation factor Kf may be composed of a risk score part, an abnormal pattern part, an environmental context embedding parameter, a model parameter and random noise. Optionally, the risk score part includes a risk score, the abnormal pattern part includes an abnormality detection parameter, and the environmental parameter includes an environmental context embedding parameter.
[0084] Optionally, for the environmental context embedding parameters, the current environmental context information of the system (such as time, geographic location, and network topology, etc.) can be embedded into a continuous vector space. Optionally, environmental context data such as timestamp, IP prefix, and AS number (Autonomous System Number) can be collected. The Word2Vec model (word vector model) is used to train discrete environmental features (obtained by feature extraction of environmental context data) to obtain its embedding vector in the continuous vector space, and then spliced to obtain the environmental context embedding parameters.
[0085] Optionally, random noise can enhance the unpredictability of the dynamic key generation factor. A random vector can be generated using a preset true random number and used as random noise. A random vector can be generated using a preset pseudo-random number generator and used as random noise.
[0086] Optionally, in a scenario embodiment, the dynamic key generation factor Kf may be calculated and determined according to the following formula, namely:
[0087] Kf = σ(W1*risk score part + W2*abnormal pattern part + W3*environmental context embedding parameter + W4*model parameter + W5*random noise + b). Among them, W1, W2, W3, W4, W5 and b are learnable parameters. The risk score part, abnormal pattern part, environmental context embedding, model parameters and random noise can be combined in a weighted summation manner, and the final dynamic key generation factor Kf is output through the nonlinear activation function σ.
[0088] Optionally, during the model training phase, initial values can be set for W1, W2, W3, W4, W5, and b. For example, assuming that the dimension of Kf is d, the shape of Wi is (d, di), where di is the dimension of the i-th component. The shape of b is (d). Randomly sample the initial value of Wi from the uniform distribution U(-sqrt(6 / (d+di)), sqrt(6 / (d+di))), and randomly sample the initial value of b from the uniform distribution U(-sqrt(6 / d), sqrt(6 / d)). In the forward propagation phase, Kf is calculated based on the current Wi and b. Multiply Risk_Score (risk score part), Anomaly_Pattern (abnormal pattern part), Context_Embedding (environmental context embedding), Model_Params (model parameters), and Randomness (random noise) with the corresponding Wi to obtain 5 d-dimensional vectors. Then add them together and add the bias term b to get the unactivated value of Kf. The unactivated value is activated through the nonlinear activation function σ to get the final Kf. In order to measure the difference between the currently generated Kf and the expected Kf, a loss function is designed. Using the MSE loss function, assuming that the expected Kf is Kf_true, the loss function is: loss = (Kf-Kf_true)^2.
[0089] Optionally, based on the value of the loss function, the gradient of the loss function with respect to Wi and b is calculated by back propagation. That is, the gradient with respect to Wi is: Gradient with respect to b: in, and It can be obtained by the chain rule: represents the derivative of the activation function σ.
[0090] Optionally, the parameters are updated according to the gradient until the preset number of iterations is reached or the early stopping condition is met (such as the verification set error no longer decreases). In each iteration, a batch of training samples are randomly sampled, the loss function and gradient are calculated, and the parameters are updated. A set of optimized Wi and b is obtained so that the generated Kf can meet the needs of dynamic key generation to the greatest extent. In practical applications, Risk_Score, Anomaly_Pattern, Context_Embedding and Randomness are input into the trained model to generate the required key generation factor Kf in real time.
[0091] In this embodiment, a dynamic key generation factor is generated by performing nonlinear combination processing on anomaly detection parameters, risk scores, environmental parameters and random noise, which can provide a basis for generating dynamic working keys and ensure the validity of the dynamic key generation factor.
[0092] Step S40, generating a working key based on a dynamic key generation factor and a preset master key;
[0093] Optionally, the master key may be set in advance, and each working key has a corresponding master key.
[0094] Optionally, a key derivation function can be used to generate a working key for encryption in combination with a master key (updated regularly) and a dynamic key generation factor, such as using a working key to encrypt a front-end JS file. Optionally, the key derivation function can be HKDF (HMAC-based Extract-and-Expand Key Derivation Function, based on HMAC (Hash-based Message Authentication Code, hash-based message authentication code) Extraction and expansion key derivation function), PBKDF2 (Password-Based Key Derivation Function 2, password-based key derivation function 2), Scrypt (a cryptographic hash function), etc., and the key derivation function can be salted.
[0095] Step S50, sending the working key to the website server.
[0096] It should be noted that the website server uses the working key as the latest working key, encrypts the target file corresponding to the file request, obtains the encrypted file, and sends the encrypted file to the user end.
[0097] Optionally, the key management system can send the working key to a front-end component, such as a website server, through a secure channel. Optionally, the private key corresponding to the working key can also be sent to the user end, and the public key corresponding to the working key can be sent to the website server. The website server encrypts the file according to the public key.
[0098] Optionally, when encrypting files, the website server may use an asymmetric encryption algorithm to encrypt the target file to obtain an encrypted file, such as using RSA (Rivest-Shamir-Adleman, RSA encryption algorithm) to encrypt the front-end JS (JavaScript) file. When encrypting, the public key PubKey may be determined according to the working key, and then the target file may be encrypted according to the public key PubKey.
[0099] Optionally, the encryption process may be: $JSFile_{enc}=RSA_{enc}(PubKey,JSFile)$;
[0100] Optionally, the website server sends the encrypted file to the client. If the client has a private key PrivKey corresponding to the public key PubKey, the encrypted file can be decrypted and displayed according to the private key PrivKey, thereby preventing the JS file from being stolen and tampered with during network transmission.
[0101] Optionally, the decryption process can be: $JSFile=RSA_{dec}(PrivKey, JSFile_{enc})$.
[0102] In addition, to assist in understanding the overall process in this embodiment, an example is given below.
[0103] For example, if the website server is a Web server. The user end can send a JS file request through a browser, and the reverse proxy server receives the JS file request and obtains the encrypted JS file from the Web server. The Web server obtains the latest working key from the key management system to encrypt the original JS file, obtains the encrypted JS file, and returns it to the reverse proxy server. At the same time, the Web server sends network traffic data and user behavior data (such as request logs and user behavior) to the data processing module in the key management system. The data processing module performs data preprocessing on the network traffic data and user behavior data, including data cleaning, feature extraction and other operations, obtains feature vectors, and inputs the feature vectors into the AI security model. The AI security model performs anomaly detection and risk assessment on the feature vectors to generate anomaly detection probability and risk score. The key generation module in the key management system calls the key generation function based on the anomaly detection probability and risk score, as well as other inputs, such as environmental parameters, to generate a dynamic key generation factor. The key management module in the key management system can combine the dynamic key generation factor and the master key through the key derivation function to generate a working key, and send the working key to each component of the front end, such as the Web server, through a secure channel. The web server re-encrypts the JS file with the updated working key and sends it to the reverse proxy server and CDN (Content Delivery Network). The browser on the user side obtains the encrypted JS file from the reverse proxy server or CDN, obtains the corresponding private key through authentication and other mechanisms, decrypts and executes it.
[0104] In this embodiment, after the key management system obtains the network traffic data and user behavior data sent by the website server, the network traffic data and user behavior data are input into the AI security model to obtain the anomaly detection parameters and risk scores, so that the AI security model in the key management system can be used to intelligently monitor the network traffic data and user behavior data and accurately assess potential risks. In addition, the dynamic key generation factor is determined according to the anomaly detection parameter and the risk score, and the working key is generated according to the dynamic key generation factor and the master key, and the working key is sent to the website server, so that the new working key can be updated in real time according to the network traffic data and the user behavior data. The phenomenon that the existing technology uses static keys and loses its protection ability once it is cracked is avoided, so that the key is a dynamic working key. The website server uses the working key as the latest working key to encrypt the target file corresponding to the file request, and sends the encrypted file to the user end, so that the target file can be encrypted using a dynamic working key, which ensures the security of the file and improves the security of the file during file transmission.
[0105] Further, based on the first embodiment of the present application, a second embodiment of the file security management method of the present application is proposed. In this embodiment, referring to Figure 2 , the above step S30, before the step of determining the dynamic key generation factor based on the anomaly detection parameter and the risk score, includes steps b10-b30.
[0106] Step b10, detecting whether the network traffic data and the user behavior data meet a preset update condition, wherein the preset update condition includes at least one of the network traffic data and the user behavior data matching the preset abnormal traffic data;
[0107] Step b20, if the preset update condition is met, then the step of determining the dynamic key generation factor based on the anomaly detection parameter and the risk score is executed;
[0108] Step b30: If the preset update condition is not met, continue to execute the step of obtaining the network traffic data and user behavior data sent by the website server.
[0109] Optionally, the key management system can detect real-time input network traffic data and user behavior data through an AI security model, perform abnormal access detection and risk assessment, and output dynamic key generation factors.
[0110] Optionally, the AI security model monitors and analyzes network traffic data and user behavior data in real time, including IP addresses, port numbers, packet sizes, timestamps, login times, operation frequencies, devices used, detected attack behaviors, etc. Through random forest and ATT&CK (Adversarial Tactics, Techniques, and Common Knowledge) model data, the model can identify abnormal network behaviors and user behavior patterns, such as multiple failed login attempts, large amounts of abnormal traffic, high-frequency operations, known attack behaviors, etc., to assess the current security risk level.
[0111] Optionally, the AI security model can output dynamic key generation factors through LoRA fine-tuning technology based on the analysis of network and user behavior data and security risk assessment results. Optionally, the dynamic key generation factor can integrate various information such as abnormal behavior patterns and risk assessment analyzed by the model.
[0112] Optionally, the AI security model can simultaneously detect attack behaviors and generate key generation factors through intelligent analysis of both anomaly detection and risk assessment, enabling the entire system to respond to security threats in real time and dynamically update keys, thereby achieving the purpose of continuous reinforcement of protection.
[0113] Optionally, the preset update condition may include at least one of network traffic data and user behavior data, which matches the preset abnormal traffic data. Optionally, the abnormal traffic data may include a threshold of the number of failed logins, abnormal traffic, and attack behavior data. For example, when it is determined that at least one of the number of failed logins exceeds a threshold, abnormal traffic is detected, and attack behavior is discovered, it is determined that the preset update condition is met.
[0114] Optionally, after the AI security model receives the network traffic data and user behavior data, it can detect whether the network traffic data and user behavior data meet the preset update conditions. When the update conditions are met, a new working key is regenerated and sent to each service end, such as a website server and a user end. When the website server receives the file request instruction sent by the user end, it encrypts the target file corresponding to the file request instruction according to the new working key and sends it to the user end, which decrypts it.
[0115] Optionally, when the update condition is not met, no new working key is generated, and the website server will use the latest working key generated previously to encrypt the file. The key management system continues to execute the step of obtaining the network traffic data and user behavior data sent by the website server. Optionally, if the network traffic data and user behavior data meet the preset update condition within a certain time period, then after the time period, the step of determining the dynamic key generation factor based on the anomaly detection parameter and the risk score is executed to update the working key.
[0116] In this embodiment, when the network traffic data and user behavior data meet the preset update conditions, a new working key is generated. When the network traffic data and user behavior data do not meet the preset update conditions, the original working key continues to be retained, thereby achieving dynamic update of the working key and ensuring the security of the file.
[0117] Furthermore, based on the above-mentioned first embodiment or second embodiment of the present application, a third embodiment of the file security management method of the present application is proposed. In this embodiment, the file security management method includes steps c10-c30.
[0118] Step c10, determining training data, wherein the training data includes training samples and sample labels, the training samples include historical network traffic data and historical user behavior data, and the sample labels include historical anomaly detection parameters and historical risk scores;
[0119] Step c20: input the training sample into the preset AI security model for model training, output the prediction result, and determine the loss function value based on the sample label, the prediction result and the loss function corresponding to the AI security model;
[0120] Step c30, updating the model parameters of the AI security model according to the loss function value until the trained AI security model meets the preset training end conditions, thereby obtaining a pre-trained AI security model, wherein the model parameter update includes updating the fine-tuning layer parameters in the AI security model.
[0121] Optionally, all models included in the AI security model need to be trained to obtain a pre-trained AI security model, such as performing model training on the Llama2 model.
[0122] Optionally, the training data may be determined based on historical data, such as obtaining network traffic data from historical network traffic logs and obtaining historical user behavior data from historical user behavior logs, and labeling the training samples in the training data based on known attack samples.
[0123] Input the training samples, i.e., historical user behavior data and historical network traffic data, into the preset AI security model for model training, and output the predicted historical anomaly detection parameters and historical risk scores. Input the predicted historical anomaly detection parameters and historical risk scores into the loss function corresponding to the AI security model, and input the sample labels in the training data into the loss function to calculate the corresponding loss function value. Perform back propagation based on the loss function value, calculate the corresponding gradient value, and update the model parameters in the AI security model based on the gradient value, such as updating the parameters of the fine-tuning layer. Perform iterative training until the trained AI security model meets the preset training end conditions to obtain a pre-trained AI security model. The preset training end conditions include reaching the preset number of iterations or meeting the early stopping condition (such as the verification set error no longer decreases).
[0124] Optionally, if the AI security model is an AI security vertical model based on Llama2, the Llama2 model may be fine-tuned. Optionally, training data may be determined, and the training data may include logs and events in various network security scenarios, as well as corresponding risk assessment labels.
[0125] In the Llama2 model, you can set fine-tuning layers, such as the LoRA fine-tuning layer. In each Transformer block of the Llama2 model, add a LoRA fine-tuning layer for the Query matrix, Key matrix, Value matrix, and the weight matrix of the FeedForward layer. The form of the LoRA fine-tuning layer is:
[0126] W'=W+AB;
[0127] Among them, W is the original weight matrix in the Llama2 model, A and B are two low-rank matrices, and the rank r is much smaller than the rank of W. A and B are the parameters actually learned during the LoRA fine-tuning process. Through this parameterization, the number of trainable parameters in the fine-tuning process can be greatly reduced, and the training efficiency can be improved.
[0128] Optionally, when training the AI security model, it is necessary to update the fine-tuning layer parameters of the AI security model. The fine-tuning layer parameters may include:
[0129] Rank r is used to control the parameter scale of the fine-tuning layer, which can be 8, 16, 32, etc. The larger the rank r, the more parameters are fine-tuned and the stronger the expressive power.
[0130] Learning rate: A smaller learning rate can be used, such as le-4 to le-3.
[0131] Batch: Select an appropriate batch size, such as 16 or 32, based on the video memory limit and model convergence speed.
[0132] Number of training rounds: The fine-tuning process usually takes several epochs to converge, depending on the amount of data and the size of the model.
[0133] Weight decay can be achieved by adding a penalty term to the loss function. Appropriate weight decay can prevent overfitting.
[0134] Optionally, the parameters of the LoRA fine-tuning layer can be trained according to the training data by gradient descent or other methods. A batch can be sampled from the training data and input into the Llama2 model. Forward propagation is performed to calculate the output and loss function of the Llama2 model. The loss function can be in the form of mean square error, cross entropy, etc., to measure the difference between the output key generation factor and the expected value. Then back propagation is performed to calculate the gradient of the loss function to the fine-tuning layer parameters, update the fine-tuning layer parameters according to the gradient, and repeat the model training until all training data are traversed and an epoch is completed. Then decide whether to continue training based on the performance of the validation set until the preset number of epochs or performance indicators are reached.
[0135] After fine-tuning is completed, the trained fine-tuning layer is used to infer the real-time network security event data, generate the corresponding anomaly detection parameters and risk scores, and then use the anomaly detection parameters and risk scores to generate dynamic key generation factors. Specifically, the event data is input into the Llama2 model, forward propagated to the fine-tuning layer, the output of the fine-tuning layer is extracted, and the dynamic key generation factor is determined based on the extracted output. The dynamic key generation factor is usually a high-dimensional vector, which can be further converted into the required format through hashing, discretization and other methods. For example, the key generation module calls the key generation function to process the anomaly detection parameters and risk scores to generate a dynamic key generation factor.
[0136] Dynamically update the dynamic key generation factor. As new security event data is continuously generated, it is necessary to continuously use the fine-tuned model to generate dynamic key generation factors. You can set a sliding window to regularly input the latest event data into the model to update the dynamic key generation factor. At the same time, you can also set a longer time interval to use the accumulated new data to incrementally train the fine-tuning layer to adapt to changes in the environment.
[0137] Furthermore, in one scenario embodiment, the training and actual application process of the AI security model can be as follows: Figure 3 As shown, including:
[0138] Step S01, determine the training data, which can be determined based on historical data. Historical data can be obtained from network traffic logs, user behavior logs and known attack samples. Perform data preprocessing on the training data, including data cleaning and feature extraction. Step S02, input the training data after data preprocessing into the AI model (i.e., AI security model) for model training, including anomaly detection: learning to identify abnormal network / user behavior patterns; risk assessment: assessing the potential security risk level based on abnormal behavior patterns; key factor generation: learning to generate dynamic key generation factors Kf suitable for different risk scenarios. Step S03, perform model training based on model parameters / weights, and when the model training is completed, the model outputs the following results: abnormal pattern representation, risk score and key generation factor. Among them, the key generation factor is determined based on the abnormal pattern representation and risk score. Step S04, apply the trained AI model to the actual production environment. Step S05, user access input data to the AI model. The input data includes network traffic data and user behavior data in the actual operating environment, including IP address, port number, data packet size, login time, operation frequency, device fingerprint, etc. Step S06, detect the input data, that is, the AI security model performs anomaly detection and risk assessment on the input data. Step S07, the model output results, including abnormal pattern detection generation, risk score generation and key factor generation (Kf). Among them, when performing anomaly detection and risk assessment, the abnormal pattern is extracted from the input data according to the trained model, and the current security risk level is evaluated according to the abnormal pattern to generate a risk score. When generating the key factor, the abnormal pattern and risk score results are used to generate a dynamic key generation factor Kf through a training mechanism. Step S08, send the result to the key management module. The key management module generates a new key related to the dynamic key generation factor Kf, that is, a working key. Then store and deploy the working key, and distribute the working key to the required system components, such as sending it to the reverse proxy server.
[0139] Optionally, for the specific process of key management, key issuance and key use, the key factor generation module of the AI security model can output the dynamic key generation factor Kf based on the real-time analysis of network traffic data and user behavior data. The key management module receives the dynamic key generation factor Kf, and in its internal key generation algorithm module, substitutes the dynamic key generation factor Kf, the predefined seed Tp (time period), the current system time Tc, the environment variable Ev and other parameters into a specific key generation algorithm to calculate and generate a new key NewKey, that is, a working key.
[0140] Optionally, the key generation algorithm may be NewKey=H(Kf||Tp||Tc||H(Ev));
[0141] Among them, H is the cryptographic hash function and || is the concatenation operation.
[0142] The newly generated working key is stored in the encrypted key database. The key distribution module obtains the latest generated working key from the key database and distributes the working key to various system components, such as the website server, reverse proxy server, etc. When the website server receives the user's JS file request, it uses the working key to encrypt and send it to the reverse proxy server. When the reverse proxy server receives the user's JS file request, it uses the working key to decrypt and responds to the user browser on the user side. The user browser receives the decrypted JS file and executes the corresponding function.
[0143] In this embodiment, the training data is determined, and the training samples in the training data are input into the AI security model, and the prediction results are output. The loss function value is determined based on the sample label, the prediction result and the loss function, and then the model parameters of the AI security model are updated according to the loss function value to obtain a pre-trained AI security model. The validity of the pre-trained AI security model is then guaranteed, which facilitates the subsequent generation of dynamic working keys according to the AI security model, thereby protecting the security of the file.
[0144] Further, based on the first embodiment, the second embodiment, or the third embodiment of the present application, a fourth embodiment of the file security management method of the present application is proposed. In this embodiment, referring to Figure 4 , a file security management method, applied to a website server, includes steps S100-S400.
[0145] Step S100, real-time monitoring of network traffic data and user behavior data;
[0146] Optionally, when receiving a file request from a client, the website server will use the latest working key to encrypt the target file corresponding to the file request and feed it back to the client. When the website server and the client are connected, the network traffic data and user behavior data between the website server and the client can be monitored in real time.
[0147] Step S200, sending network traffic data and user behavior data to a key management system;
[0148] It should be noted that the key management system processes network traffic data and user behavior data based on the AI security model to obtain anomaly detection parameters and risk scores, and generates a working key based on the dynamic key generation factor and the preset master key determined by the anomaly detection parameters and risk scores, and sends the working key to the website server.
[0149] Optionally, the website server can send the network traffic data and user behavior data monitored in real time to the key management system. After receiving the network traffic data and user behavior data sent by the website server, the steps in the first or second embodiment above can be executed, which will not be elaborated here.
[0150] Step S300, obtaining a working key sent by the key management system, and using the working key as the latest working key to encrypt the target file corresponding to the file request to obtain an encrypted file;
[0151] It should be noted that the client sends a file request to the website server.
[0152] Optionally, the user end may be a terminal held by the user, such as a mobile phone, a tablet computer, etc.
[0153] Optionally, after obtaining the working key sent by the key management system, the website server will store the working key.
[0154] Optionally, a target file corresponding to the file request may be determined. For example, when the file request is a JS file request, the target file is a JS file. Optionally, the latest working key among the stored working keys, i.e., the latest working key, may be obtained, and the target file may be encrypted according to the latest working key to obtain an encrypted file.
[0155] Optionally, the website server will use the latest working key to encrypt the target file, such as encrypting the JS file, to obtain the corresponding ciphertext, and use this ciphertext as the encrypted file. The encrypted file is then transmitted to the CDN or directly sent to the user end, and the browser opened in the user end decrypts it. When the AI security model detects abnormal access or high risk, it will trigger the generation of a new working key. The next time the user end accesses the JS file, the new working key will be used to re-encrypt the JS file, and the old key and ciphertext will gradually become invalid.
[0156] Step S400: sending the encrypted file to the user terminal.
[0157] It should be noted that the user end decrypts the encrypted file.
[0158] Optionally, the website server can directly send the encrypted file to the user end, such as the browser in the user end, and the user end can decrypt the encrypted file according to the latest working key obtained in advance. Alternatively, the encrypted file can be sent to the reverse proxy server, and then sent to the user end through the reverse proxy server for decryption by the user end.
[0159] In this embodiment, after the key management system obtains the network traffic data and user behavior data sent by the website server, the network traffic data and user behavior data are input into the AI security model to obtain the anomaly detection parameters and risk scores, thereby realizing the intelligent monitoring of network traffic data and user behavior data through the AI security model in the key management system, and accurately assessing potential risks. In addition, the dynamic key generation factor is determined according to the anomaly detection parameters and risk scores, and the working key is generated according to the dynamic key generation factor and the master key, and the working key is sent to the website server, thereby realizing the real-time update and generation of new working keys according to the network traffic data and user behavior data. The phenomenon that the existing technology uses static keys and loses its protection ability once it is cracked is avoided, so that the key is a dynamic working key. The website server uses the working key as the latest working key to encrypt the target file corresponding to the file request, sends the encrypted file to the user end, and the user end decrypts it, so that the target file can be encrypted using a dynamic working key, which ensures the security of the file and improves the security of the file during file transmission.
[0160] Furthermore, in a feasible embodiment, after the step of sending the network traffic data and the user behavior data to the key management system in step S200, steps d10-d20 are included.
[0161] Step d10, if the working key sent by the key management system is not received within the preset time period, all stored historical working keys are obtained;
[0162] Step d20, determine the storage time corresponding to each historical working key, and determine the historical working key corresponding to the storage time closest to the current time as the latest working key, encrypt the file corresponding to the file request according to the latest working key, and send the encrypted file to the user end.
[0163] Optionally, the preset time period can be a time period set in advance by the user, such as 1 second. If the website server receives a file request sent by the user end, it detects whether a working key sent by the key management system is received within the preset time period. If no working key is obtained, all historical working keys stored in the website server are determined. Optionally, the historical working key is a working key generated before the current moment.
[0164] The website server determines the time of receiving and storing each historical working key and uses it as the storage time. The storage time corresponding to each historical working key is compared with the current time, and the historical working key corresponding to the storage time closest to the current time is determined to be the latest working key. Then the latest working key is used to encrypt the file corresponding to the file request, and the encrypted file is sent to the user end, which then decrypts it.
[0165] In this embodiment, if the working key sent by the key management system is not received within a preset time period, the latest working key is determined based on the storage time of all historical working keys, and then the file corresponding to the file request is encrypted based on the latest working key, and the encrypted file is sent to the user end, thereby protecting the security of the file and improving the security of file transmission.
[0166] In addition, an example is given of the workflow of a file security management system including a key management system and a website server.
[0167] For example, Figure 5 As shown, the system workflow diagram includes S1 (initialization phase), S2 (user access request phase), S3 (key generation phase), and S4 (key update phase).
[0168] Optionally, the S1 initialization phase may include the following processes: 1. Loading the Llama2 model and LoRA (Low-rank Adaptation) fine-tuning parameters; 2. Initializing the key library for storing generated keys; 3. Initializing the user behavior library for storing historical user behavior data.
[0169] In the S2 user access request phase, the following processes may be included: 1. Collect network traffic data, including IP address, port number, packet size, timestamp, etc. 2. Collect user behavior data including login time, operation frequency, device used, detected attack behavior, etc. 3. Input the collected network traffic data and user behavior data into the AI model (i.e., AI security model) for LoRA fine-tuning, and output the key generation factor Kf, i.e., the dynamic key generation factor.
[0170] In the S3 key generation phase, the following processes may be included: 1. Based on the key generation factor Kf, combined with the predefined key generation seed Tp (generated based on the current timestamp and pseudo-random number generator), the current system data Tc, and the environment variable set Ev, a hash function is used to calculate and generate a new key NewKey, which is also the working key. That is: NewKey = H(Kf||Tp||Tc||H(Ev)). H is a hash function. 2. Store the newly generated key NewKey in an encrypted database. 3. Distribute the key NewKey to system agents, such as reverse proxy servers that need to use the key. 4. Use the key NewKey to encrypt the requested JS file, such as encrypting the key parameters of the JS file. 5. Respond to user requests and transmit the encrypted JS file.
[0171] In the S4 key update phase, the following processes can be included: 1. The AI security model continuously monitors user / network behavior data. 2. Detection is performed according to preset update conditions, such as the number of failed logins exceeding the threshold, abnormal traffic detected, attack behavior discovered, etc. (If no abnormality is found, the seed TP is updated regularly). If the update conditions are met, the "key generation" phase is resent to generate and deploy new keys to replace the old keys. By continuously updating the keys, we can effectively respond to changing security threats and improve the adaptability and defense capabilities of the system.
[0172] In addition, the present application also provides a file security management system, including a key management system and a website server,
[0173] A website server is used to monitor network traffic data and user behavior data in real time, and send the network traffic data and user behavior data to the key management system;
[0174] The key management system is used to obtain network traffic data and user behavior data sent by the website server; input the network traffic data and user behavior data into the pre-trained AI security model to obtain anomaly detection parameters and risk scores; determine the dynamic key generation factor based on the anomaly detection parameters and risk scores; generate a working key based on the dynamic key generation factor and the preset master key; and send the working key to the website server;
[0175] The website server is used to obtain the working key sent by the key management system, use the working key as the latest working key to encrypt the target file corresponding to the file request to obtain an encrypted file; send the encrypted file to the user end, wherein the user end that sends the file request decrypts the encrypted file.
[0176] The specific implementation methods of the file security management system of the present application are basically the same as the various embodiments of the above-mentioned file security management method, and will not be repeated here.
[0177] In addition, the present application also provides an electronic device, which includes a memory, a processor, and a file security management program stored in the memory and executable on the processor. When the file security management program is executed by the processor, the steps of the file security management method described above are implemented.
[0178] Furthermore, in one embodiment, Figure 6 FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 6As shown, at the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services. The processor, network interface and memory can be interconnected through an internal bus, and the internal bus can be an ISA (Industry Standa rd Architecture, Industrial Standard Architecture) bus, a PCI (Peripheral Component Interconnect, Peripheral Component Interconnect Standard) bus or an EISA (Extended Industry Standard Architecture, Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus. The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a shared resource access control device at the logical level. The processor executes the program stored in the memory and is specifically used to execute the steps of the above-mentioned file security management method.
[0179] The specific implementation of the electronic device of the present application is basically the same as the various embodiments of the above-mentioned file security management method, and will not be repeated here.
[0180] In addition, to achieve the above-mentioned purpose, the present application also provides a medium, including a computer-readable storage medium, on which a file security management program is stored, and when the file security management program is executed by a processor, the steps of the file security management method as described above are implemented.
[0181] The specific implementation of the computer-readable storage medium of the present application is basically the same as the various embodiments of the above-mentioned file security management method, and will not be repeated here.
[0182] In addition, to achieve the above-mentioned purpose, the present application also provides a program product, the program product includes a computer program product, the above-mentioned computer program product includes a financial middle-office server control program, and the above-mentioned financial middle-office server control program implements the steps of the above-mentioned financial middle-office server control method when executed by a processor.
[0183] The specific implementation methods of the computer program product of the present application are basically the same as the various embodiments of the above-mentioned financial middle-office server control method, and will not be repeated here.
[0184] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer-readable storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0185] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A file security management method, characterized in that: Applied to a key management system, the method includes: Obtain network traffic data and user behavior data sent by website servers; Input the network traffic data and user behavior data into a pre-trained artificial intelligence (AI) security model to obtain anomaly detection parameters and risk scores; determining a dynamic key generation factor based on the anomaly detection parameter and the risk score; Generate a working key based on the dynamic key generation factor and a preset master key; The working key is sent to the website server, wherein the website server uses the working key as the latest working key, encrypts the target file corresponding to the file request to obtain an encrypted file, and sends the encrypted file to the user end.
2. The method according to claim 1, characterized in that The step of determining a dynamic key generation factor based on the anomaly detection parameter and the risk score comprises: The abnormality detection parameter, the risk score, the preset environmental parameter and the random noise are processed in a nonlinear combination to generate a dynamic key generation factor.
3. The method according to claim 1, characterized in that Before the step of determining the dynamic key generation factor according to the anomaly detection parameter and the risk score, the method includes: Detecting whether the network traffic data and the user behavior data meet a preset update condition, wherein the preset update condition includes at least one of the network traffic data and the user behavior data matching preset abnormal traffic data; If the preset update condition is met, the step of determining the dynamic key generation factor based on the anomaly detection parameter and the risk score is performed; If the preset update condition is not met, continue to execute the step of obtaining the network traffic data and user behavior data sent by the website server.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Determining training data, wherein the training data includes training samples and sample labels, the training samples include historical network traffic data and historical user behavior data, and the sample labels include historical anomaly detection parameters and historical risk scores; Input the training sample into a preset AI security model for model training, output a prediction result, and determine a loss function value based on the sample label, the prediction result and the loss function corresponding to the AI security model; The model parameters of the AI security model are updated according to the loss function value until the trained AI security model meets the preset training end condition, thereby obtaining a pre-trained AI security model, wherein the model parameter update includes the fine-tuning layer parameter update in the AI security model.
5. A file security management method, characterized in that: Applied to a website server, the method includes: Real-time monitoring of network traffic data and user behavior data; Sending the network traffic data and user behavior data to a key management system, wherein the key management system processes the network traffic data and user behavior data according to an AI security model to obtain anomaly detection parameters and risk scores, and generates a working key based on a dynamic key generation factor determined by the anomaly detection parameters and risk scores and a preset master key, and sends the working key to the website server; Obtaining a working key sent by the key management system, and using the working key as the latest working key to encrypt a target file corresponding to a file request to obtain an encrypted file, wherein the user terminal sends a file request to the website server; The encrypted file is sent to the client, wherein the client decrypts the encrypted file.
6. The method according to claim 5, characterized in that After the step of sending the network traffic data and user behavior data to the key management system, the method further includes: If no working key sent by the key management system is received within a preset time period, all stored historical working keys are obtained; Determine the storage time corresponding to each of the historical working keys, and determine the historical working key corresponding to the storage time closest to the current time as the latest working key, encrypt the file corresponding to the file request according to the latest working key, and send the encrypted file to the user end.
7. A file security management system, characterized in that: The file security management system includes a key management system and a website server. The website server is used to monitor network traffic data and user behavior data in real time, and send the network traffic data and user behavior data to the key management system; The key management system is used to obtain network traffic data and user behavior data sent by the website server; input the network traffic data and user behavior data into the pre-trained AI security model to obtain anomaly detection parameters and risk scores; determining a dynamic key generation factor based on the anomaly detection parameter and the risk score; Generate a working key based on the dynamic key generation factor and a preset master key; send the working key to the website server; The website server is used to obtain the working key sent by the key management system, use the working key as the latest working key to encrypt the target file corresponding to the file request to obtain an encrypted file; send the encrypted file to the user end, wherein the user end that sends the file request decrypts the encrypted file.
8. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the file security management method according to any one of claims 1 to 6.
9. A medium, characterized in that The medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the file security management method according to any one of claims 1 to 6 are implemented.
10. A program product, characterized in that The program product is a computer program product, and the computer program product includes a computer program. When the computer program is executed by a processor, the steps of the file security management method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Data transmission method and system based on dynamic key
CN116886276A
Communication information security risk early warning management and control method and system based on big data
CN117955712A
Data security protection method based on artificial intelligence algorithm
CN118114269A
Cryptographic security functions based on anticipated changes in dynamic minutiae
US20120201381A1
Cited By
Key acquisition method and related equipment
CN119324782A
Key acquisition method and related equipment
CN119324782B
Front-end storage encryption method and device
CN119918070A
Server data whole-process monitoring system based on artificial intelligence
CN120455183A
Data security transmission method, device and equipment for RDMA encryption communication
CN120546934A
