Encryption method and system based on dynamic adjustment of number of iterations
By calculating the performance of equipment and network delay weights in real time, the number of encryption iterations is dynamically adjusted, and the problem that the fixed iteration encryption method cannot balance computing efficiency and encryption security in different devices and network environments is solved, achieving a more efficient and secure encryption process.
Patent Information
- Application Number
- CN202510326161.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Among the existing encryption methods, the encryption method with fixed iterations cannot balance computing efficiency and encryption security on devices with different computing capabilities, especially for low-power devices and environments with large network latency.
By calculating device performance weights and network latency weights in real time, the number of encryption iterations is dynamically adjusted to generate a key using the updated number of iterations in the encryption algorithm.
It achieves balancing computing efficiency and encryption security in different devices and network environments, improves encryption speed and encryption levels, and avoids performance delays caused by network delay.
Smart Images

Figure CN119853908A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to an encryption method and system based on dynamic adjustment of the number of iterations. Background Art
[0002] There are differences in the computing power of different types of devices. Especially for devices with low power operation requirements and limited computing resources, the high computing power requirements of encryption methods with a fixed number of iterations may seriously affect the working performance of these devices, making it difficult for these devices to find a balance between computing efficiency and operational security.
[0003] The PBKDF algorithm, or Password-Based Key Derivation Function, is an algorithm that derives key materials such as encryption keys from passwords or passphrases. It uses a fixed number of iterations to generate encryption keys. The network transmission delay and device computing power of the device running the PBKDF algorithm are usually ignored, specifically: 1. Waste of high-performance equipment resources High-performance devices have abundant computing resources. In scenarios with high security requirements, encryption methods with fixed iterations cannot fully utilize the performance of these devices, and the generated keys are difficult to meet the encryption level requirements. 2. Low-performance devices have excessive delays For low-performance devices, a fixed number of iterations may result in excessively long encryption times, affecting the normal response speed of the device and causing the computing efficiency to fail to meet expectations.
[0004] 3. Network delay affects key generation efficiency In an environment with large network transmission delays, the fixed number of iterations cannot be adjusted according to the real-time network status, which may cause the password generation process to be delayed due to network delays, thereby affecting the overall performance and security of the device. Summary of the invention
[0005] The present invention aims to dynamically adapt to device performance and network environment, find a balance between the computing efficiency and encryption security of the current device by dynamically adjusting the number of encryption iterations, thereby improving the encryption speed and / or encryption level of the encrypted object, and provides an encryption method and system based on dynamic adjustment of the number of iterations.
[0006] To achieve this object, the present invention adopts the following technical solutions: An encryption method based on dynamic adjustment of the number of iterations is provided, comprising the steps of: S1, real-time calculation of device performance weight and network delay weight; S2, update the number of encryption iterations; S3, generating a key with the updated number of encryption iterations in the encryption algorithm to encrypt the encryption object.
[0007] Preferably, the method for calculating the device performance weight in step S1 is expressed by the following formula (1): Performance_Adjustment=Base_Iterations×(1-CPU_Usage)×(1-Memory_Usage)×IO_Speed_Factor(1) In formula (1), Performance_Adjustment represents the performance weight of the device; Base_Iterations indicates the default number of encryption iterations; CPU_Usage and Memory_Usage represent the normalized values of the device’s CPU load and memory usage, respectively; IO_Speed_Factor represents a normalized adjustment factor based on the disk data input and output rate.
[0008] Preferably, the calculation method of IO_Speed_Factor is expressed by the following formula (2): IO_Speed_Factor = min(Current_IO_Speed / Base_IO_Speed) (2) In formula (2), Current_IO_Speed represents the disk data input and output rate detected in real time by the device at the current moment; Base_IO_Speed represents the disk-based data input and output rate preset for the device.
[0009] Preferably, in step S1, the method for calculating the network delay weight is expressed by the following formula (3): Network_Adjustment=Base_Iterations×(1-Network_Latency / Max_Latency) (3) In formula (3), Network_Adjustment represents the network delay weight; Base_Iterations indicates the default number of encryption iterations; Network_Latency indicates the device network latency currently detected in real time; Max_Latency indicates the maximum acceptable network latency.
[0010] Preferably, in step S2, the method for updating the number of encryption iterations is: taking the minimum value of the device performance weight and the network delay weight as the updated number of encryption iterations.
[0011] The present invention also provides an encryption system based on dynamic adjustment of the number of iterations, which can implement the encryption method based on dynamic adjustment of the number of iterations, including: Equipment performance weight calculation module, used to calculate equipment performance weight in real time; A network delay weight calculation module is used to calculate the network delay weight of the device in real time; An encryption iteration number updating module, connected to the device performance weight calculation module and the network delay weight calculation module, for updating the encryption iteration number according to the device performance weight and the network delay weight; The encryption module is connected to the encryption iteration number update module and is used to generate a key with the updated encryption iteration number in the encryption algorithm to encrypt the encrypted file.
[0012] Preferably, the device performance weight calculation module calculates the device performance weight through the following formula (1): Performance_Adjustment=Base_Iterations×(1-CPU_Usage)×(1-Memory_Usage)×IO_Speed_Factor(1) In formula (1), Performance_Adjustment represents the performance weight of the device; Base_Iterations indicates the default number of encryption iterations; CPU_Usage and Memory_Usage represent the normalized values of the device’s CPU load and memory usage, respectively; IO_Speed_Factor represents a normalized adjustment factor based on the disk data input and output rate.
[0013] Preferably, the calculation method of IO_Speed_Factor is expressed by the following formula (2): IO_Speed_Factor = min(Current_IO_Speed / Base_IO_Speed) (2) In formula (2), Current_IO_Speed represents the disk data input and output rate detected in real time by the device at the current moment; Base_IO_Speed represents the disk-based data input and output rate preset for the device.
[0014] Preferably, the method for calculating the network delay weight by the network delay weight calculation module is expressed by the following formula (3): Network_Adjustment=Base_Iterations×(1-Network_Latency / Max_Latency) (3) In formula (3), Network_Adjustment represents the network delay weight; Base_Iterations indicates the default number of encryption iterations; Network_Latency indicates the device network latency currently detected in real time; Max_Latency indicates the maximum acceptable network latency.
[0015] Preferably, the method by which the encryption iteration number updating module updates the encryption iteration number is: taking the minimum value of the device performance weight and the network delay weight as the updated encryption iteration number.
[0016] The encryption method and system based on dynamic adjustment of the number of iterations provided by the present invention monitor the device performance and network status in real time, and dynamically and adaptively adjust the number of iterations based on the monitoring data as the basis for updating the number of encryption iterations, thereby finding a balance between device performance and encryption security, which is beneficial to ensuring encryption efficiency while taking encryption security into account. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 It is a diagram of implementation steps of an encryption method based on dynamic adjustment of the number of iterations provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.
[0020] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on this patent; in order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0021] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "inner", "outer", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as a limitation on this patent. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0022] In the description of the present invention, unless otherwise clearly specified and limited, if the term "connection" or the like appears to indicate the connection relationship between components, the term should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two components or the interaction relationship between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0023] The encryption method based on dynamic adjustment of the number of iterations provided in this embodiment has the following technical core: optimizing the password generation process by dynamically adjusting the number of iterations of the encryption algorithm (such as the PBKDF algorithm). This solution uses the performance data and network status data of the device running the encryption algorithm to balance the computational efficiency and encryption level in the password generation process by adaptively adjusting the number of iterations. The main invention points include: 1. Adaptive computing: Dynamically adjust the number of encryption iterations of the encryption algorithm based on the device's performance indicators, such as CPU usage and memory usage, to ensure a balance between resource usage and computing efficiency on devices with different performance.
[0024] 2. Network status optimization: By real-time monitoring of the network transmission delay of the device, the password generation events are adjusted by changing the number of encryption iterations to avoid long waiting due to network delays, thereby improving the response speed of the device.
[0025] 3. Provide a set of dynamic iteration adjustment strategies: Calculate the optimal number of encryption iterations based on the real-time performance indicators of the device and the network status, so that the device performance is always excellent while ensuring encryption security.
[0026] The encryption method based on dynamic adjustment of the number of iterations provided in this embodiment is described below.
[0027] The encryption method based on dynamic adjustment of the number of iterations provided in this embodiment is as follows: Figure 1 As shown, the specific steps include: S1, real-time calculation of device performance weight and network delay weight; The device performance weight is defined by "performance adjustment". The calculation method of the device performance weight is expressed by the following formula (1): Performance_Adjustment=Base_Iterations×(1-CPU_Usage)×(1-Memory_Usage)×IO_Speed_Factor(1) In formula (1), Performance_Adjustment represents the device performance weight; Base_Iterations indicates the default number of encryption iterations; CPU_Usage and Memory_Usage represent the normalized values of the CPU load and memory usage of the device respectively. Taking CPU_Usage as an example, the method for normalizing CPU_Usage or Memory_Usage is as follows: CPU_Usage_normalized = Current_CPU_Usage / Max_CPU_Capacity Parameter definition: CPU_Usage_normalized is the normalized value of CPU_Usage.
[0028] Current_CPU_Usage: Real-time detected CPU usage (for example, 70%).
[0029] Max_CPU_Capacity: The theoretical maximum CPU load of the device (100%).
[0030] Example: If the current CPU usage is 75%, the normalized value is 0.75.
[0031] IO_Speed_Factor represents the normalized adjustment factor based on the disk data input and output rate. The calculation method of IO_Speed_Factor is: IO_Speed_Factor = min(Current_IO_Speed / Base_IO_Speed) (2) In formula (2), Current_IO_Speed represents the disk data input and output rate detected in real time by the device at the current moment; Base_IO_Speed represents the disk-based data input and output rate preset for the device.
[0032] In formula (2), the min function is used to limit the maximum value of IO_Speed_Factor to 1, ensuring that when the I / O performance exceeds the benchmark value, the number of PBKDF iterations will not be increased meaninglessly, thereby avoiding resource waste; at the same time, when the I / O performance is insufficient, the number of iterations is dynamically reduced to balance security and computational efficiency.
[0033] In this embodiment, the performance monitor of the device, such as Windows' performance monitor, is used to obtain the current CPU utilization of the device. The system's memory management tool is called to obtain the memory usage. The I / O test tool is used to monitor the input and output speed (I / O speed) of the disk storage. The network delay weight is defined by "Network_Adjustment". The calculation method of the network delay weight is expressed by the following formula (3): Network_Adjustment=Base_Iterations×(1-Network_Latency / Max_Latency) (3) In formula (3), Network_Adjustment represents the network delay weight; Base_Iterations indicates the default number of encryption iterations; Network_Latency indicates the device network latency currently detected in real time; Max_Latency indicates the maximum acceptable network latency.
[0034] Network delay detection is performed in the following ways: For example, the local loopback test uses the ping command to measure the response time of the network stack for the local loopback address 127.0.0.1. This method does not require an external network connection and can quickly and easily detect the network delay of the device itself.
[0035] After obtaining the real-time device performance weight and network delay weight through the calculation in step S1, as shown in the figure, the encryption method based on dynamic adjustment of the number of iterations provided in this embodiment proceeds to the steps: S2, update the number of encryption iterations, the updating method is: take the minimum value of the device performance weight and the network delay weight calculated in real time in step S1 as the updated number of encryption iterations, that is: Let Iterations = min(Performance_Factor, Network_Factor). Iterations represents the number of encryption iterations after the update.
[0036] S3, in the encryption algorithm, a key is generated with the updated number of encryption iterations to encrypt the encryption object. For example, in the PBKDF algorithm, a key is generated with the updated number of encryption iterations, and then the encryption object such as a file is encrypted.
[0037] In summary, the encryption method based on dynamic adjustment of the number of iterations provided in this embodiment finds a balance between device performance and encryption security by monitoring device performance and network conditions in real time, and adaptively and dynamically adjusting the number of iterations based on the monitoring data as the basis for updating the number of encryption iterations. This is beneficial for ensuring encryption efficiency while taking into account encryption security.
[0038] It should be noted that the above specific implementations are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art should understand that various modifications, equivalent substitutions, changes, etc. can be made to the present invention. However, as long as these changes do not deviate from the spirit of the present invention, they should be within the scope of protection of the present invention. In addition, some terms used in the specification and claims of this application are not restrictive, but are only for the convenience of description.
Claims
1. An encryption method based on dynamic adjustment of the number of iterations, characterized in that: Includes steps: S1, real-time calculation of device performance weight and network delay weight; S2, update the number of encryption iterations; S3, generating a key with the updated number of encryption iterations in the encryption algorithm to encrypt the encryption object.
2. The encryption method based on dynamic adjustment of the number of iterations according to claim 1, characterized in that: The method for calculating the device performance weight in step S1 is expressed by the following formula (1): Performance_Adjustment=Base_Iterations×(1-CPU_Usage)×(1-Memory_Usage)×IO_Speed_Factor(1) In formula (1), Performance_Adjustment represents the performance weight of the device; Base_Iterations indicates the default number of encryption iterations; CPU_Usage and Memory_Usage represent the normalized values of the device’s CPU load and memory usage, respectively; IO_Speed_Factor represents a normalized adjustment factor based on the disk data input and output rate.
3. The encryption method based on dynamic adjustment of the number of iterations according to claim 2, characterized in that: The calculation method of IO_Speed_Factor is expressed by the following formula (2): IO_Speed_Factor = min(Current_IO_Speed / Base_IO_Speed) (2) In formula (2), Current_IO_Speed represents the disk data input and output rate detected in real time by the device at the current moment; Base_IO_Speed represents the disk-based data input and output rate preset for the device.
4. The encryption method based on dynamic adjustment of the number of iterations according to claim 1, characterized in that: In step S1, the method for calculating the network delay weight is expressed by the following formula (3): Network_Adjustment=Base_Iterations×(1-Network_Latency / Max_Latency) (3) In formula (3), Network_Adjustment represents the network delay weight; Base_Iterations indicates the default number of encryption iterations; Network_Latency indicates the device network latency currently detected in real time; Max_Latency indicates the maximum acceptable network latency.
5. The encryption method based on dynamic adjustment of the number of iterations according to any one of claims 1 to 4, characterized in that: In step S2, the method for updating the number of encryption iterations is: taking the minimum value of the device performance weight and the network delay weight as the updated number of encryption iterations.
6. An encryption system based on dynamic adjustment of the number of iterations, which can implement the encryption method based on dynamic adjustment of the number of iterations as described in any one of claims 1 to 5, characterized in that: include: Equipment performance weight calculation module, used to calculate equipment performance weight in real time; A network delay weight calculation module is used to calculate the network delay weight of the device in real time; An encryption iteration number updating module, connected to the device performance weight calculation module and the network delay weight calculation module, for updating the encryption iteration number according to the device performance weight and the network delay weight; The encryption module is connected to the encryption iteration number update module and is used to generate a key with the updated encryption iteration number in the encryption algorithm to encrypt the encrypted file.
7. The encryption system based on dynamic adjustment of the number of iterations according to claim 6, characterized in that: The device performance weight calculation module calculates the device performance weight through the following formula (1): Performance_Adjustment=Base_Iterations×(1-CPU_Usage)×(1-Memory_Usage)×IO_Speed_Factor(1) In formula (1), Performance_Adjustment represents the performance weight of the device; Base_Iterations indicates the default number of encryption iterations; CPU_Usage and Memory_Usage represent the normalized values of the device’s CPU load and memory usage, respectively; IO_Speed_Factor represents a normalized adjustment factor based on the disk data input and output rate.
8. The encryption system based on dynamic adjustment of the number of iterations according to claim 7, characterized in that: The calculation method of IO_Speed_Factor is expressed by the following formula (2): IO_Speed_Factor = min(Current_IO_Speed / Base_IO_Speed) (2) In formula (2), Current_IO_Speed represents the disk data input and output rate detected in real time by the device at the current moment; Base_IO_Speed represents the disk-based data input and output rate preset for the device.
9. The encryption system based on dynamic adjustment of the number of iterations according to claim 6, characterized in that: The method for calculating the network delay weight by the network delay weight calculation module is expressed by the following formula (3): Network_Adjustment=Base_Iterations×(1-Network_Latency / Max_Latency) (3) In formula (3), Network_Adjustment represents the network delay weight; Base_Iterations indicates the default number of encryption iterations; Network_Latency indicates the device network latency currently detected in real time; Max_Latency indicates the maximum acceptable network latency.
10. The encryption system based on dynamic adjustment of the number of iterations according to any one of claims 6 to 9, characterized in that: The method for the encryption iteration number updating module to update the encryption iteration number is: taking the minimum value of the device performance weight and the network delay weight as the updated encryption iteration number.
Citation Information
Patent Citations
Data sharing method and device based on disk encryption, equipment and storage medium
CN116578505A
Dynamic encryption verification method and device based on time network protocol
CN119299233A
Cited By
Implementation method of anti-quantum hybrid cryptographic optimization algorithm
CN121396434A