Computer system encryption method for software development

By using the RSA algorithm to generate and manage asymmetric keys on IoT devices, the problem of insufficient computing and storage resources in lightweight devices during key rotation is solved, enabling secure and efficient data encryption and decryption and improving the data privacy protection capabilities of IoT devices.

CN120910877APending Publication Date: 2025-11-07XINXIANG CENTER HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510707463.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

In the Internet of Things (IoT) environment, lightweight devices face insufficient computing and storage resources when rotating keys, which threatens system security. Existing symmetric encryption algorithms are at increased risk when using the same key for a long time.

Method used

It employs an asymmetric key encryption method based on the RSA algorithm, generates and manages keys through the RSA algorithm, realizes large number storage and four arithmetic operations, generates keys using Eratosthenes sieve and Fermat prime test, and performs modular multiplication operations through the Montgomery algorithm. It supports random key generation and saving as plain text, and supports encryption and decryption of arbitrary files.

Benefits of technology

It enables secure and efficient transmission and storage of asymmetric keys on IoT devices, supports encryption and decryption of arbitrary files, improves data privacy protection capabilities, and reduces the risk of key leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910877A_ABST
    Figure CN120910877A_ABST
Patent Text Reader

Abstract

The invention discloses a computer system encryption method for software development, which comprises the following steps of: 1, realizing the functions of large number storage and basic arithmetic operation based on an RSA (Rivest-Shamir-Adleman) algorithm; step 2, performing power modular operation and multiply modular operation, wherein an operation mode of the multiply modular operation adopts M (A * B); the method comprises the following steps: step 1, carrying out prime number screening and Fermat prime number testing, step 2, carrying out prime number testing on a number which may be a prime number, calculating a secret key, and carrying out encryption operation, step 3, carrying out prime number screening and Fermat prime number testing, and step 4, carrying out prime number testing on the number which may be the prime number. 5, the functions of RSA key generation and encryption and decryption are achieved, and the encryption and decryption processes are standard RSA algorithms; 6, secret key generation testing, system performance analysis and improvement optimization are carried out; compared with the prior art, the method has the advantages that the asymmetric key is applied to encrypt any file, so that the application of the asymmetric key is not limited to the internet, the data after asymmetric encryption is converted into the text, any file can be safely transmitted in almost any mode, and the asymmetric key is generated according to the required digit.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer encryption, and particularly relates to a computer system encryption method for software development. BACKGROUND

[0002] When computer software development is carried out in an Internet of Things (IoT) environment, data security is crucial. Since the Internet of Things involves communication and data exchange between a large number of devices, the use of appropriate data encryption methods is the key to ensuring information security. Since Internet of Things devices can collect a large amount of data, including location, behavior patterns, physiological indicators, etc., which may involve sensitive information of users, there is a risk of being leaked or stolen, so it is crucial to ensure that the privacy of these data is fully protected. At present, the protection of the software being developed usually uses a symmetric encryption algorithm, which can provide efficient data protection by ensuring the secure distribution and management of the key. However, the long-term use of the same key may increase the risk of attack, but in the Internet of Things, especially on lightweight devices, regular key rotation may face challenges because the devices may not have enough computing and storage resources to support frequent key updates. If the key is leaked or has vulnerabilities, the security of the entire system may be threatened, thereby affecting the progress of software development.

[0003] The information disclosed in this BACKGROUND section is only for the purpose of increasing the understanding of the overall background of the present application, and should not be considered as recognition or implicit admission in any form that this information constitutes prior art that is known to those skilled in the art. SUMMARY

[0004] The technical problem to be solved by the present application is to overcome the above technical defects, and to provide a computer system encryption method for software development. The application of asymmetric keys to encrypt any file makes the application of asymmetric keys not limited to the Internet, and the data after asymmetric encryption is converted into text, which can be securely transmitted in almost any way. The asymmetric key is generated according to the required number of bits, and the key can be saved and loaded. The key is saved as plain text, and any file can be encrypted with the RSA algorithm using a specified key. The generated data is in plain text, the encrypted file is loaded, and the original file is restored by decrypting with the specified key.

[0005] To solve the above problems, the technical scheme of the present application is a computer system encryption method for software development, comprising the following steps:

[0006] Step one, based on RSA algorithm, to realize the function of large number storage and basic four arithmetic operations, the large number storage function is provided by flex_unit class, and vlong_value is derived, and four arithmetic operation functions and unsigned forced conversion operator are realized in vlong_value;

[0007] Step two, power module operation and multiplication module operation are carried out, and the multiplication module operation is in the form of M(A*B);

[0008] Step three, find prime number Eratosthenes screening and Fermat prime number test, the function of finding prime number is placed in the class Prime_factory_san, and the member vlong find_prime(vlong & start) of the instance of the class is called to obtain a number as a prime number with the large number start as the starting point;

[0009] Step four, prime number test is carried out on the number that may be a prime number, the secret key is calculated, and the encryption operation is carried out;

[0010] Step five, to realize the function of RSA key generation and encryption and decryption, the encryption and decryption process is the standard RSA algorithm;

[0011] Step six, secret key generation test, system performance analysis and improvement optimization.

[0012] Further, in step one, each large number corresponds to an instance of flex_unit, in the class flex_unit, an unsigned integer pointer unsigned *a points to the starting address of a memory space, which is used to store a large number, when the instance of flex_unit is stored in a larger number than the current stored number, reserve is called to increase the storage space, when the instance of flex_unit is stored in a smaller number than the current stored number, the storage space will not be automatically tightened.

[0013] Further, in step two, the power module operation function is completed through a vlong friend, the power module operation is simplified to multiplication module operation, and Montgomery algorithm is applied to carry out multiplication module operation.

[0014] Further, in step four, the key is generated by random calculation, and the integer is screened in the integer range where the prime number is needed to be found, and all the integers which are determined as the composite number are excluded, and an array b[] is constructed in the program, and b[0] to b[SS] correspond to the large number start to start+SS respectively, and all the elements in b[] are initialized as 1, and if the corresponding large number is determined as the composite number, the corresponding element in b is set as 0, and the large number corresponding to the element 1 in b is compared to determine the prime number.

[0015] Further, in step five, the variable letters used in the source program of the whole class are consistent with the RSA algorithm protocol, and in the constructor of the class RSA_san, the operation of preparing a pair of random keys is executed, and then the RSA encryption and decryption operation of other members of the class can be directly used, and the previously saved key or the random key can be loaded again.

[0016] Further, in step six, the key generation test, the data input and output test, and the encryption and decryption test are included.

[0017] Compared with the prior art, the application has the following advantages:

[0018] 1. The application applies the asymmetric key encryption to any file, and the application of the asymmetric key is not limited to the Internet only, the data after the asymmetric encryption is converted into the text, and any file can be safely transmitted by almost any mode, the asymmetric key can be generated according to the required bit number, the key can be saved and loaded, the key is saved as the pure text, any file can be encrypted by the RSA algorithm with the specified key, the generated data after the encryption is the pure text, the encrypted file is loaded, and the original file is decrypted and restored by the specified key. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 is a flow chart of the computer system encryption method for software development. DETAILED DESCRIPTION

[0020] In order to make the content of the application more easily and clearly understood, the technical solutions in the embodiments of the application will be clearly and completely described below in combination with the drawings in the embodiments of the application.

[0021] As shown in Figure 1 , a computer system encryption method for software development comprises the following steps:

[0022] Step one, based on RSA algorithm, to realize the function of large number storage and basic four arithmetic operations, the large number storage function is provided by flex_unit class, and vlong_value is derived, and four arithmetic operation functions and unsigned forced conversion operator are realized in vlong_value;

[0023] Each large number corresponds to an instance of flex_unit, in the class flex_unit, an unsigned integer pointer unsigned * a points to the starting address of a block of memory space, which is used to store a large number, when the instance of flex_unit is stored in a larger number than the current stored number, reserve is called to increase the storage space, when the instance of flex_unit is stored in a smaller number than the current stored number, the storage space will not be automatically tightened.

[0024] Step two, to perform power module operation and multiplication module operation, the multiplication module operation is in the form of M (A * B), the power module operation function is completed through a vlong friend, the power module operation is simplified to multiplication module operation, and montgomery algorithm is used to perform multiplication module operation.

[0025] Step three, to find prime number by eratosthenes screening and fermat prime number test, the function of finding prime number is placed in the class Prime_factory_san, and the member vlong find_prime (vlong & start) of the instance of the class can be called externally to obtain a number as a prime number, which is taken as the starting point of large number start;

[0026] Step four, to perform prime number test on the number that may be prime number, to calculate the secret key and perform encryption operation;

[0027] The way to generate secret key is random calculation, the integers in the range of integers that need to find prime number are screened, all integers that are definitely composite are excluded, an array b[] is constructed in the program, the size of search range is SS, b[0] to b[SS] correspond to large numbers start to start+SS respectively. All elements in b[] are initialized to 1, if the corresponding large number is determined to be composite, the corresponding element in b is set to 0, the large number corresponding to the element with value 1 in b is compared to determine the exact prime number test, and the probability of the tested number being prime number reaches the preset value, the number is determined to be prime number.

[0028] Step five, the function of RSA key generation and encryption and decryption is realized, and the encryption and decryption process is the standard RSA algorithm; in the source program of the whole class, the variable letters used are consistent with the RSA algorithm protocol, in the constructor of the class RSA_san, the operation of preparing a pair of random keys is executed, then the RSA encryption and decryption operation of other members of the class can be directly used, or the previously saved keys can be loaded or the keys are randomly generated again.

[0029] Step six, key generation test, system performance analysis and improvement and optimization, including key generation test, data input and output test, encryption and decryption test.

[0030] The performance analysis includes the operation of software consumption time, most of which is concentrated in the C++ core class library, that is, various operations related to RSA; and the file input and output consumption time.

[0031] The above describes the present application and its embodiments, which are not limited. In general, if a person skilled in the art is inspired by it, without departing from the purpose of the present application, similar structural modes and embodiments to the technical solution can be designed without creativity, which should belong to the protection scope of the present application.

Claims

1. A computer system encryption method for software development, characterized by, The method comprises the following steps: Step one, based on RSA algorithm, realize the function of large number storage and basic four arithmetic operations, large number storage function is provided by flex_unit class, and vlong_value is derived, four arithmetic operation functions and unsigned forced conversion operator are realized in vlong_value; Step two, carry out power module operation and multiplication module operation, multiplication module operation adopts M(A*B) operation mode; Step three, find prime number Eratosthenes screening and Fermat prime number test, the function of finding prime number is placed in class Prime_factory_san, and the member vlong find_prime(vlong & start) of the instance of the class is called to obtain a number as a prime number with large number start as a starting point; Step four, carry out prime number test on the number possibly as a prime number, calculate secret key, and carry out encryption operation; Step five, realize the function of RSA key generation and encryption and decryption, and the encryption and decryption process is standard RSA algorithm; Step six, secret key generation test, system performance analysis and improvement and optimization.

2. The computer system encryption method for software development of claim 1, wherein: In step one, each large number corresponds to an instance of flex_unit, in class flex_unit, an unsigned integer pointer unsigned * a points to the first address of a memory space, the memory space is used for storing a large number, when the instance of flex_unit is stored with a number larger than the currently stored number, reserve is called to increase the storage space, when the instance of flex_unit is stored with a number smaller than the currently stored number, the storage space will not be automatically tightened.

3. The computer system encryption method for software development of claim 1, wherein: In step two, the power module operation function is completed through a vlong friend, the power module operation is simplified into multiplication module operation, and Montgomery algorithm is applied to carry out multiplication module operation.

4. The computer system encryption method for software development of claim 1, wherein: In step four, the secret key is generated in a random calculation mode, integers in the integer range requiring to find prime numbers are screened, and all integers definitely known as composite numbers are excluded, an array b[] is constructed in the program, b[0] to b[SS] correspond to large numbers start to start+SS respectively, all elements in b[] are initialized as 1, if the corresponding large number is determined as a composite number, the corresponding element in b is set as 0, the large number corresponding to the element 1 in b is compared and subjected to accurate prime number test, the probability that the tested number is a prime number reaches a preset value, and the number is determined as a prime number.

5. The computer system encryption method for software development of claim 1, wherein: In step five, in the source program of the whole class, the variable letters used are consistent with the RSA algorithm protocol, in the constructor of class RSA_san, the operation of preparing a pair of random secret keys is executed, then other members of the class can be directly used for RSA encryption and decryption operation, or the secret keys saved before or the secret keys randomly generated again can be loaded.

6. The computer system encryption method for software development of claim 1, wherein: In step six, secret key generation test, data input and output test, and encryption and decryption test are included.