Data encryption and decryption teaching method and program

By introducing a visual data interaction interface and load balancing distribution mechanism in the learning of encryption and decryption algorithms, combined with API calls, the problem of lack of practical experience in the existing technology is solved, the combination of theory and practice is achieved, and the cultivation of information security talents is improved. Effect.

CN119155040APending Publication Date: 2024-12-17北京能嘉科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411346816.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The learning methods of existing cryptographic encryption and decryption algorithms mainly rely on abstract concept descriptions, lack of practical experience, resulting in a gap between theoretical knowledge and practical operation, and it is impossible to effectively cultivate information security talents with practical application capabilities.

Method used

Provide a teaching method and program for data encryption and decryption, which receives user-input encryption and decryption algorithm requests through visual data interaction interface, uses access tokens for authentication, and distributes them to a specified interface implementation server through load balancing algorithms, obtains and encapsulates data As a result, the encryption or decryption operation is combined with API calls, providing a practical learning form.

Benefits of technology

It has achieved the combination of theoretical knowledge and practical operations, improved learning efficiency, cultivated information security talents with practical capabilities, provided a new educational method, and enhanced the effectiveness of talent training in the information security industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155040A_ABST
    Figure CN119155040A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption and decryption teaching method and program, and the method specifically comprises the steps: firstly obtaining to-be-processed webpage data, and extracting information, including an encryption mode and filled parameter data, contained in unencrypted data; load balancing is carried out through routing in a network request mode; outputting an API (Application Program Interface) method with text description from the constructed encrypted data; and performing data cleaning on the API method with the text description by using a regular expression, and removing the text description in the API method with the text description to obtain the API method corresponding to the encrypted data fragment. Compared with the prior art, the method provided by the invention can generate the API which is safer, more convenient and more detailed in user operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cryptographic algorithms, and in particular to a data encryption and decryption teaching method and program. Background Art

[0002] In the information age, with the rapid development of computer science and network technology, we have entered the global information age. Both work and life are inseparable from computer networks. Every day, a large amount of information is stored on various media through computers. Therefore, it is very important to ensure information security. Passwords have become an indispensable part of our daily life and work. From using CMOS passwords when starting up the computer to entering user passwords when entering Windows, to setting document passwords when editing Word documents, these passwords provide users with necessary security protection.

[0003] With the widespread use of passwords, people began to realize the importance of encryption and decryption. In order to better protect information security, a group of people who focus on the research of encryption and decryption algorithms came into being.

[0004] However, learning cryptographic encryption and decryption algorithms is a major difficulty. Most algorithm processes are described in abstract concepts, which is quite challenging for beginners. After investigation, it was found that it is extremely rare to explain the concept of cryptographic algorithms in a concrete way. Usually, they are only explained in the form of PPT or documents, and lack practical experience. This has led to unreasonable training conditions, a serious gap between theoretical knowledge and practical operations, and an inability to cultivate talents who can truly stand on their own in the field of information security. Therefore, combining theoretical knowledge with practical operations has become the key to cultivating outstanding talents. Only through practical operations can we better understand and master the principles and processes of cryptographic encryption and decryption algorithms, so that we can use them freely in actual work. Such a comprehensive training model can not only improve learning efficiency, but also cultivate more practical and valuable talents, injecting new vitality into the development of the information security industry.

[0005] In response to the above problems, the purpose of the present invention is to provide a data encryption and decryption interface platform system based on user input, which is used to provide a learning form of encryption and decryption algorithms that can be actually operated and learned, and to provide a new education method for the information security industry for the cultivation of talents. Summary of the invention

[0006] The present invention provides a data encryption and decryption teaching method and program, which encrypts and decrypts data by using remote calling, and is used to provide a learning form of encryption and decryption algorithms that can be actually operated and learned, and is used to provide a new education method for the information security industry and for the cultivation of talents.

[0007] In a first aspect, the present invention provides a data encryption and decryption teaching method, comprising:

[0008] Receive an encryption and decryption algorithm request and an algorithm description corresponding to the algorithm input by a user in a selected manner through an interface on the visual data interaction interface;

[0009] Use the access token to verify the user's identity for compliance, and after confirming compliance, use the load balancing algorithm to distribute the algorithm request to the specified interface implementation server;

[0010] Get the data corresponding to the algorithm request, including the algorithm return value, algorithm parameter value and algorithm call address, encapsulate the data and return the result to the visual data interaction interface for teaching display.

[0011] In combination with the first aspect, in a first possible implementation of the first aspect, the interface is used for users to call in the form of an API, and to filter and integrate the data provided by the user, and pass it to the sub-service for encryption or decryption.

[0012] In combination with the first aspect, in a first possible implementation method of the first aspect, the user identity is verified for compliance using an access token, and after confirming the compliance, before the algorithm request is distributed to the designated interface implementation server using a load balancing algorithm, the user input data is filtered for sensitive words by regular expressions, and a corresponding unique access token is generated.

[0013] Furthermore, the access token is used to confirm the identity of the user, and a unique access token T is generated by a generation algorithm:

[0014]

[0015] Where: T——token information;

[0016] HMAC – integrity algorithm;

[0017] K——key information;

[0018] U——User identity information.

[0019] Further, using a load balancing algorithm to distribute the algorithm request to a designated interface implementation server includes: load balancing uses a weighted round-robin method to distribute interface implementation servers, assuming that the server The weight is , the total weight is , N is the total number of servers, then the i-th request will be assigned to the server that meets the following conditions :

[0020]

[0021] in:

[0022] k——The server currently being judged, used to identify the specific server number;

[0023] ——For the kth server;

[0024] i——the i-th request number;

[0025] j——loop variable, used to iterate over the server numbers and accumulate server weights;

[0026] ——The weight of the kth server;

[0027] ——The weight of the jth server;

[0028] ——The sum of the weights of the first k-1 servers;

[0029] ——The sum of the weights of the first k servers;

[0030] —— The result of taking the modulus of the total weight w for the i-th request, where W is the sum of the weights of all servers, i.e. , Calculate the relative position of request number i in a complete weighted polling cycle.

[0031] In combination with the first aspect, in a first possible implementation method of the first aspect, the use of a load balancing algorithm to distribute the algorithm request to a designated interface implementation server includes, characterized in that the algorithm type is confirmed according to the algorithm request, and a calling address is generated according to the algorithm type, and the calling address is load balanced to stabilize the network transmission layer.

[0032] In combination with the first aspect, in a first possible implementation of the first aspect, after verifying the user identity, the data encryption and decryption teaching method also includes: recording events for self-monitoring and auditing of the system, and converting abnormal situations generated by the data into plain text data for printing.

[0033] In combination with the first aspect, in a first possible implementation manner of the first aspect, before encapsulating the data and returning the result, the data encryption and decryption teaching method further includes:

[0034] Receive parameters entered by the user and select the algorithm based on these parameters. It can perform bit operations, customize obfuscation and key expansion, select cryptographic operation mode, implement integrity authentication, and provide usage guidelines.

[0035] Furthermore, the parameters received from the user and the selected algorithm based on these parameters can be used to perform bit operations, customize obfuscation and key expansion, select cryptographic operation modes, and implement integrity authentication. The implementation process can perform corresponding customized extension processes in the form of algorithm type, key length, and basic parameters of elliptic curves.

[0036] In a second aspect, the present invention provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, any one of the data encryption and decryption teaching methods described above can be executed.

[0037] In a first aspect, the present invention provides a data encryption and decryption teaching method, comprising:

[0038] Receive an encryption and decryption algorithm request and an algorithm description corresponding to the algorithm input by a user in a selected manner through an interface on the visual data interaction interface;

[0039] Use the access token to verify the user's identity for compliance, and after confirming compliance, use the load balancing algorithm to distribute the algorithm request to the specified interface implementation server;

[0040] Get the data corresponding to the algorithm request, including the algorithm return value, algorithm parameter value and algorithm call address, encapsulate the data and return the result to the visual data interaction interface for teaching display.

[0041] In combination with the first aspect, an encryption and decryption algorithm request and an algorithm description corresponding to the algorithm input by a user in a selected manner are received through an interface on the visual data interaction interface, wherein the data input interface can be called by the user to encrypt or decrypt data.

[0042] In combination with the first aspect, the interface is used for users to call in the form of an API, filter and integrate the data provided by the user, and pass it to the sub-service for encryption or decryption.

[0043] In combination with the first aspect, it is characterized in that before using the access token to verify the compliance of the user identity and after confirming the compliance, using the load balancing algorithm to distribute the algorithm request to the designated interface implementation server, the user input data is filtered for sensitive words by regular expression, and a corresponding unique access token is generated.

[0044] Furthermore, the data encryption and decryption teaching method, access token, is used to confirm the identity of the user, and a unique access token T is generated by a generation algorithm:

[0045]

[0046] Where: T——token information;

[0047] HMAC – integrity algorithm;

[0048] K——key information;

[0049] U——User identity information.

[0050] Further, using a load balancing algorithm, distributing the algorithm request to a designated interface implementation server includes: load balancing uses a weighted round-robin method to distribute interface implementation servers, assuming that the server The weight is , the total weight is , N is the total number of servers, then the i-th request will be assigned to the server that meets the following conditions :

[0051]

[0052] in:

[0053] ——For the kth server;

[0054] i——the i-th request number;

[0055] j——is the serial number used to traverse the server;

[0056] ——The weight of the kth server;

[0057] ——The sum of the weights of the first k-1 servers;

[0058] ——The sum of the weights of the first k servers;

[0059] —— The result of taking the modulus of the total weight w for the i-th request, where W is the sum of the weights of all servers, i.e. , Calculate the relative position of request number i in a complete weighted polling cycle

[0060] In combination with the first aspect, the use of a load balancing algorithm to distribute the algorithm request to a designated interface implementation server includes, among other features, confirming the algorithm type according to the algorithm request, generating a calling address according to the algorithm type, and load balancing the calling address to stabilize the network transport layer.

[0061] In combination with the first aspect, it is characterized in that after verifying the user identity, the data encryption and decryption teaching method also includes: recording events for self-monitoring and auditing of the system, and converting abnormal situations generated by the data into plain text data for printing.

[0062] Furthermore, before encapsulating the data and returning the result, the data encryption and decryption teaching method further includes:

[0063] Receive the parameters entered by the user, and based on these parameters correspond to the selected algorithm, perform bit operations, customize obfuscation and key expansion, select the cryptographic operation mode, and implement integrity authentication. Based on these parameters correspond to the selected algorithm, perform bit operations, customize obfuscation and key expansion, select the cryptographic operation mode, and implement the implementation process of integrity authentication. The corresponding customized extension process can be performed in the form of algorithm type, key length, and basic parameters of elliptic curve.

[0064] On the other hand, a computer program product includes a computer program, characterized in that when the computer program is executed by a processor, any one of the data encryption and decryption teaching methods described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0066] Figure 1 It is a flow chart of a data encryption and decryption teaching method provided by the present invention;

[0067] Figure 2 It is a business logic flow chart of a data encryption and decryption teaching method provided by the present invention;

[0068] Figure 3 It is a flow chart of data interaction of a data encryption and decryption teaching method provided by the present invention;

[0069] Figure 4 It is a program module diagram of a data encryption and decryption teaching program provided by the present invention. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0071] In a specific embodiment, Figure 1 As shown, a data encryption and decryption teaching method provided by the present invention comprises the following steps:

[0072] S101 receives an encryption / decryption algorithm request and an algorithm description corresponding to the algorithm input by a user in a selected manner through an interface on a visual data interaction interface;

[0073] S102 uses the access token to verify the compliance of the user identity, and after confirming the compliance, uses the load balancing algorithm to distribute the algorithm request to the designated interface implementation server;

[0074] S103 obtains data corresponding to the algorithm request, including the algorithm return value, algorithm parameter value and algorithm call address, encapsulates the data and returns the result to the visual data interaction interface for teaching display.

[0075] In this example, S101 provides the user with an input interface and algorithm description through a visual data interaction interface, and returns a value after obtaining the processing result; specifically, Figure 2 As shown:

[0076] 210 Select encryption and decryption algorithm;

[0077] 220 parses and processes the data;

[0078] 221 Get the algorithm return value;

[0079] 222 obtain the parameters required by the algorithm;

[0080] 230 processes the packaging and integration data;

[0081] 240 data display;

[0082] The specific process is to use annotations on the interface methods of the encryption algorithm interface to customize the return value and type, and use annotations to mark the type and parameter name on the input parameters. Once the detailed information of the encryption interface method is obtained through reflection, this information can be displayed on the interface platform through the interface, so that users can clearly understand the purpose and parameter requirements of each method.

[0083] When the user obtains the relevant information of a certain encryption and decryption algorithm interface, all encryption and decryption methods in the class will be obtained through reflection methods, and the annotation information on these methods will be checked, such as obtaining the return value and parameter annotation of the encryption and decryption method, and the parameter list information on the method can be obtained, and then the name, type and related annotation information of each parameter can be obtained, which is conducive to customizing the display page according to different methods, and the display page method parameters can change with the method, and there is no need to specifically maintain the display information of all encryption and decryption interfaces. Through the annotations and reflections provided in this data encryption and decryption teaching method, the encryption and decryption algorithm interface can be managed more efficiently, while providing users with a better interactive experience and security.

[0084] In summary, the present invention uses the access token to verify the compliance of the user identity in S102, and after confirming the compliance, uses the load balancing algorithm to distribute the algorithm request to the specified interface implementation server. The specific operations are:

[0085] To prevent users from maliciously swiping the interface and causing the server to crash, the calling interface logic uses the aspect method to verify the token provided by the user before calling the interface. The token has a time limit and a usage limit to prevent malicious attacks. To improve the efficiency of token use, the token formula is:

[0086]

[0087] Where: T——token information;

[0088] HMAC – integrity algorithm;

[0089] K——key information;

[0090] U——user identity information;

[0091] And verify the access token submitted by the user in the aspect method to ensure that the token has not expired and is valid. Once the token expires, the aspect method will reject further requests to protect the service encryption and decryption interface from excessive use and reduce service pressure.

[0092] Based on the previous step, use the load balancing algorithm to distribute the algorithm request to the specified interface implementation server. Once the user calls the encryption and decryption interface and passes the verification to ensure that the call is legal and valid, use the load balancing algorithm to distribute the algorithm request to the specified interface implementation server, including: load balancing uses weighted polling to distribute interface implementation servers, assuming that the server The weight is , the total weight is , N is the total number of servers, then the i-th request will be assigned to the server that meets the following conditions :

[0093]

[0094] in:

[0095] k——The server currently being judged, used to identify the specific server number;

[0096] ——For the kth server;

[0097] i——the i-th request number;

[0098] j——loop variable, used to iterate over the server numbers and accumulate server weights;

[0099] ——The weight of the kth server;

[0100] ——The weight of the jth server;

[0101] ——The sum of the weights of the first k-1 servers;

[0102] ——The sum of the weights of the first k servers;

[0103] —— The result of taking the modulus of the total weight w for the i-th request, where W is the sum of the weights of all servers, i.e. , Calculate the relative position of request number i in a complete weighted polling cycle. Increase the fault tolerance of the system by using multiple servers.

[0104] After the steps are performed in sequence, S103 obtains data corresponding to the algorithm request, including the algorithm return value, algorithm parameter values ​​and algorithm call address, encapsulates the data and returns the result to the visual data interaction interface for teaching display.

[0105] The encryption algorithms are mainly international encryption algorithms such as RSA, AES, DES, SHA256, and SM2, SM4 national encryption algorithms. In addition, users can add custom operations such as secret key expansion, round key addition, and bit operations to these algorithms. The specific operations are as follows: Figure 3 As shown,

[0106] 310 Calling algorithm;

[0107] 320 Call the custom configuration corresponding to the algorithm;

[0108] 321 secret key expansion-round secret key addition;

[0109] 322 rows shifted;

[0110] 323 columns are confused;

[0111] 324 Other algorithm custom configurations;

[0112] 330 integrated data;

[0113] 340 returns the processed data;

[0114] In addition, the present invention provides a data encryption and decryption teaching program;

[0115] like Figure 4 Shown:

[0116] Data processing module 410: preliminarily organizes the data and verifies it into tokens;

[0117] Load balancing module 420: Requests are processed in an optimal manner;

[0118] Algorithm calling module 430: performs custom algorithm processing and generates corresponding encryption and decryption results;

[0119] Interface calling module 440: provides an API interface for remote calling.

[0120] This program uses the data processing module to organize the data and generate a token through a token algorithm for request use. The token algorithm is:

[0121]

[0122] Where: T——token information;

[0123] HMAC – integrity algorithm;

[0124] K——key information;

[0125] U——user identity information;

[0126] Among them, a globally unique token is generated through the identity information U provided by the user; then the request is made in the fastest response manner through the debt balancing module, and its load balancing polling formula is:

[0127]

[0128] Where: W——server weight;

[0129] j——loop variable, used to iterate over the server numbers and accumulate server weights;

[0130] i – the i-th request number;

[0131] k——The server currently being judged, used to identify the specific server number.

[0132] Among them, through The final weight is obtained and the algorithm server that is finally called is obtained.

[0133] Afterwards, in the specific algorithm calling server, the algorithm calling module performs custom algorithm processing and generates corresponding encryption and decryption results; the business logic that can be used includes calling international encryption algorithms and national secret algorithms, custom key expansion, row shifting and column confusion, and obtaining the data results required by the user through custom steps.

[0134] In addition, this program provides standard interface calling services in the interface calling module. Users can directly call algorithm services through the public interface. The public interface complies with the national secret encryption specification and the level 3 security specification. A software development kit manual is provided in the interface calling module. The manual provides some actual code examples to show how to use the SDK functions.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data encryption and decryption teaching method, characterized in that: include: Receive an encryption and decryption algorithm request and an algorithm description corresponding to the algorithm input by a user in a selected manner through an interface on the visual data interaction interface; Use the access token to verify the user's identity for compliance, and after confirming compliance, use the load balancing algorithm to distribute the algorithm request to the specified interface implementation server; Get the data corresponding to the algorithm request, including the algorithm return value, algorithm parameter value and algorithm call address, encapsulate the data and return the result to the visual data interaction interface for teaching display.

2. The data encryption and decryption teaching method according to claim 1 is characterized in that: This interface is used for users to call in the form of API, filter and integrate the data provided by users, and pass it to the sub-service for encryption or decryption.

3. A data encryption and decryption teaching method according to claim 1, characterized in that: When using the access token to verify the compliance of the user identity, and after confirming the compliance, before using the load balancing algorithm to distribute the algorithm request to the designated interface implementation server, the user input data is filtered for sensitive words by regular expression, and a corresponding unique access token is generated.

4. A data encryption and decryption teaching method according to claim 3, characterized in that: The access token is used to confirm the user's identity and generates a unique access token T through a generation algorithm: In the formula: T——token information; HMAC——integrity algorithm; K——key information; U——user identity information.

5. According to the data encryption and decryption teaching method of claim 3, the method of using a load balancing algorithm to distribute the algorithm request to a designated interface implementation server comprises: Load balancing uses weighted round-robin to allocate interfaces to implementation servers. The weight is , the total weight is , N is the total number of servers, then the i-th request will be assigned to the server that meets the following conditions : Among them: k——the server currently being judged, used to identify the specific server number; ——is the kth server; i——the i-th request number; j——loop variable, used to traverse the server numbers and accumulate server weights; ——The weight of the kth server; ——The weight of the jth server; ——The sum of the weights of the first k-1 servers; ——The sum of the weights of the first k servers; —— The result of taking the modulus of the total weight w for the i-th request, where W is the sum of the weights of all servers, i.e. , Calculate the relative position of request number i in a complete weighted polling cycle.

6. According to the data encryption and decryption teaching method of claim 1, the method of using a load balancing algorithm to distribute the algorithm request to a designated interface implementation server includes: Confirm the algorithm type according to the algorithm request, generate a calling address according to the algorithm type, and use the load balancing algorithm to distribute the algorithm request to the specified interface implementation server to stabilize the network transmission layer.

7. The data encryption and decryption teaching method according to claim 1, characterized in that: After verifying the user's identity, the data encryption and decryption teaching method further includes: recording events for self-monitoring and auditing of the system, and converting abnormal data into plain text data for printing.

8. The data encryption and decryption teaching method according to claim 1, characterized in that: Before encapsulating the data and returning the result, the data encryption and decryption teaching method also includes: receiving parameters input by the user, and based on these parameters corresponding to the selected algorithm, bit operations, customized obfuscation and key expansion, selecting a cryptographic operation mode, implementing integrity authentication, and providing a usage guide.

9. The data encryption and decryption teaching method according to claim 8, characterized in that: The parameters received from the user and the selected algorithm based on these parameters can perform bit operations, customize obfuscation and key expansion, select the cryptographic operation mode, and implement the integrity authentication process to perform corresponding customized extension processes in the form of algorithm type, key length, and basic parameters of elliptic curves.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the data encryption and decryption teaching method as described in any one of claims 1 to 9 is implemented.