Dynamic password generation method and system based on PLC and touch screen
By adopting a dynamic password generation method based on PLC and touch screen in the device, and using random numbers and matrix calculations to generate dynamic passwords, the problem of low reliability of the device password generation method in the prior art is solved, and the functions of high-difficulty cracking and countless shutdowns are realized.
Patent Information
- Application Number
- CN202411993280.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-13
AI Technical Summary
The existing equipment password generation method is not reliable, easy to be cracked, and cannot achieve countless downtimes.
Using a dynamic password generation method based on PLC and touch screen, a registration code is obtained by generating multiple random numbers and calculating with a preset matrix, and the random number is obtained through the inverse function, and the dynamic password is finally calculated.
It improves the difficulty of cracking passwords, achieves countless shutdowns, and significantly improves the reliability of the device password generation method.
Smart Images

Figure CN119989330A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic information technology, and in particular to a method and system for generating a dynamic password based on a PLC and a touch screen. Background Art
[0002] As the global economic development is generally in a downturn, enterprises in all walks of life are facing survival challenges. For example, after providing equipment to owners, the balance payment is often not collected, and the only way is to set up a program on the equipment in advance. When the payment time comes, if the balance payment is not paid, the equipment will be shut down. After the customer pays the balance, the customer will be given a password to unlock the equipment. The equipment can be used again after it is unlocked to promote the owner's payment.
[0003] If a static password is set, it will remain unchanged after it is set. As the owner's ability to crack the password continues to improve, others can spend a lot of time and keep trying, which poses a risk of cracking. And it is difficult to predict how many shutdowns will need to be set in the future before the equipment is provided.
[0004] The existing dynamic password has only one calculation formula, which takes several coefficients to achieve encryption. In comparison, it is easier to crack. And because after providing the password, the owner agrees to pay and often repeats it, more times of stopping the machine again and providing more passwords are required.
[0005] Therefore, the existing device password generation method has low reliability due to the above-mentioned technical problems. It can be seen that how to improve the reliability of the device password generation method is a problem that needs to be solved in this field. Summary of the invention
[0006] In view of the technical problem that the existing methods for generating passwords for equipment have low reliability, the purpose of the present invention is to provide a method for generating dynamic passwords based on PLC and touch screen. The method for generating dynamic passwords provided by the present invention can increase the difficulty of cracking the password and can achieve countless shutdowns. On this basis, a dynamic password generation system capable of implementing the method in real time is also provided, which effectively overcomes the problems existing in the prior art.
[0007] In order to achieve the above object, the present invention provides a method for generating a dynamic password based on PLC and a touch screen, and the method for generating a dynamic password comprises the following steps:
[0008] S1: After the device expires, multiple random numbers are generated in the editable logic controller PLC;
[0009] S2: The editing logic controller PLC calculates the three random numbers generated by S1 and the matrix preset in the editing logic controller PLC to obtain the registration code;
[0010] S3: Through the communication between the editing logic controller PLC and the touch screen, the editing logic controller PLC displays the registration code calculated in the above S2 on the touch screen;
[0011] S4: Calculate the random number generated by S1 through an inverse function according to the registration code on the touch screen;
[0012] S5: The random number obtained in S4 is substituted into the program of the editable logic controller PLC for calculation, and is calculated together with the date and other constants involved in the calculation in the editable logic controller PLC, and finally a dynamic password is obtained.
[0013] Furthermore, the value and quantity of the random numbers in S1 are customized.
[0014] Furthermore, the constant values in the matrix are preset values.
[0015] Furthermore, the steps of calculating the random number generated by S1 using the registration code in S4 are as follows:
[0016] S41: Find the inverse matrix of the preset matrix;
[0017] S42: The random number generated in S1 can be calculated by multiplying the inverse matrix obtained in S41 by the registration code displayed on the touch screen.
[0018] Furthermore, the calculation process of the S5 dynamic password includes the following steps:
[0019] S51: Get the date and get the variables, "year (Y)", "month (M)", "day (D)";
[0020] S52: Calculate according to the variables obtained in S421 and the formula:
[0021] E1=Y*256+M+D*256+a; E2=Y*256+M*256+D+a; E3=Y+M*256+D*256+a
[0022] S53: Compare the minimum value E(min) and the maximum value E(max) of E1, E2, and E3;
[0023] F1 = E(max)-b is used as the first part of the dynamic password, and F2 = E(min)-b is used as the second part of the dynamic password. The two parts constitute the final "dynamic password";
[0024] G1=E(max)-b+c is used as the first part of the dynamic password, and G2=E(min)-b+c is used as the second part of the dynamic password. The two parts constitute the final "dynamic password end password".
[0025] Furthermore, the “dynamic password” can continue to use the device until the next shutdown.
[0026] Furthermore, the "dynamic password end password" can permanently use the device.
[0027] In order to achieve the above object, the present invention provides a dynamic password generation system based on PLC and touch screen, which includes a programmable logic controller, a display screen and an industrial computer;
[0028] The programmable logic controller is used to complete all calculations and controls of the dynamic password;
[0029] The touch screen cooperates with the industrial computer and exchanges data with the programmable logic controller through a communication protocol. The registration code is displayed on the touch screen. The industrial computer interacts with the programmable logic controller. Based on the registration code, the dynamic password is calculated by the programmable logic controller, and then the dynamic password is input on the touch screen for unlocking and use.
[0030] The PLC- and touch screen-based dynamic password generation method and system provided by the present invention involve dates in their calculation formulas. Since the dates change every day, the calculation formulas can be changed at any time.
[0031] Secondly, the random numbers in the calculation formula used in this solution are all randomly generated, so the calculation formula can change at any time.
[0032] In addition, in this scheme, the random number is encrypted by using a matrix. When the matrix is unknown, it is difficult to deduce the value of the random number.
[0033] Therefore, the method for generating a dynamic password provided in this solution will keep changing the password, and the calculation formula will change every day. It will be difficult to crack the password due to insufficient cracking time. After using the dynamic password, you can set an unlimited number of shutdowns, which improves the reliability of the device password generation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0035] Figure 1 This is a flow chart of the dynamic password generation method;
[0036] Figure 2 This is a structural diagram of the dynamic password generation system based on PLC and touch screen;
[0037] Figure 3 This is an example flow chart of the dynamic password generation method. DETAILED DESCRIPTION
[0038] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below with reference to specific diagrams.
[0039] See also Figure 1 The method for generating a dynamic password based on PLC and touch screen provided by the present invention comprises the following steps:
[0040] S1: Generate multiple random numbers in the editable logic controller PLC.
[0041] After the device expires, multiple random numbers are generated in the editable logic controller PLC. The range of random number generation values can be customized and is not limited here. For example, 3 can be taken as an example to generate three random numbers a, b, and c.
[0042] S2: The editing logic controller PLC calculates the random number generated by S1 and the matrix preset in the editing logic controller PLC to obtain the registration code.
[0043] Here, the random numbers a, b, c are encrypted by using a matrix. When only x, y, z are known but not the matrix, it is difficult to deduce the values of the random numbers a, b, c, further increasing the difficulty of password cracking.
[0044] Here, F1(a, b, c) is used to represent the formula for generating dynamic passwords. Dynamic password = F1(a, b, c). In this step, since the random numbers a, b, c are randomly generated each time, the calculation formula of F1(a, b, c) changes, thus increasing the difficulty of password cracking.
[0045] As an example, the three random numbers a, b, and c generated in S1 can be multiplied by the following 3*3 matrix to obtain three values x, y, and z, which are the registration codes.
[0046]
[0047] Here, the values of constants a1, a2, a3, b1, b2, b3, c1, c2, c3 in matrix A are set in the PLC and recorded.
[0048] It should be noted here that when taking values of constants in matrix A, it is necessary to verify that the matrix is reversible, so as to avoid the situation where, after the irreversible matrix is involved in the calculation, when we use matrix A and registration codes x, y, z to calculate random numbers a, b, c, a, b, c will have countless solutions, and we will not be able to know the values of random numbers a, b, c in the PLC.
[0049] Here, we verify whether the matrix is reversible by calculating the determinant of the matrix. The calculation result is judged to be 0. If it is not 0, the matrix is reversible. If it is 0, please re-calculate the value and check again.
[0050] Multiplying the three random numbers a, b, c generated in S1 with the above 3*3 matrix will give the three values x, y, z. The generation method of x, y, z is recorded as F2(a, b, c) = (x, y, z). The inverse function of F2 is:
[0051] F2 -1 (x,y,z)=(a,b,c)
[0052] Then the relationship between the dynamic password and x, y, z can be expressed as: dynamic password = F1[F2 -1 (x,y,z)]. So far, the generation of dynamic password has been completed.
[0053] S3: Through the communication between the editing logic controller PLC and the touch screen, the editing logic controller PLC displays the registration code calculated in the above S2 on the touch screen.
[0054] S4: Calculate the random number generated by S1 through an inverse function according to the registration code on the touch screen.
[0055] In this step, the owner tells the engineer the registration code, and the engineer calculates the dynamic password based on the registration code displayed on the touch screen. The calculation process of the dynamic password includes the following steps:
[0056] S41: Find the inverse matrix of the preset matrix A.
[0057] For matrix A, if it is invertible, there exists another matrix B such that AB = BA = E. B is the inverse matrix of A, and the calculation method is omitted. The inverse matrix can be calculated at the beginning of determining matrix A and recorded and saved for easy calculation.
[0058] The commonly used second-order and third-order matrix formulas are as follows:
[0059]
[0060] S42: Multiply the inverse matrix of A by the values x, y, z displayed on the touch screen to calculate the values of the random numbers a, b, c generated by S1.
[0061]
[0062] S5: Substitute the random number obtained in S4 into the program of the editable logic controller PLC for calculation, and calculate it with the date and other constants involved in the calculation in the editable logic controller PLC, and finally obtain the dynamic password. The calculation method of F1(a, b, c) includes the following steps:
[0063] S51: Get the date and obtain the variables, “year (Y)”, “month (M)”, and “day (D)”.
[0064] S52: Calculate according to the variables obtained in S421 and the formula:
[0065] E1=Y*256+M+D*256+a; E2=Y*256+M*256+D+a; E3=Y+M*256+D*256+a
[0066] It should be noted that the calculation formula here uses the value a, and can also use b or c. The specific one to use is custom. Just make sure that at least one of a, b, c or more random numbers is involved in the calculation.
[0067] S53: Compare the minimum value E(min) and the maximum value E(max) of E1, E2, and E3.
[0068] Use F1=E(max)-b as the first part of the dynamic password, and F2=E(min)-b as the second part of the dynamic password. The two parts form the final "dynamic password". You can continue to use the device until the next shutdown.
[0069] It should be noted here that the value b is used in the calculation formula here, and a or c can also be used. The specific one to be used is customized. Just make sure that there are at least 2 random numbers among a, b, c or more that participate in the calculation in the previous step and this step.
[0070] Use G1=E(max)-b+c as the first part of the dynamic password, and G2=E(min)-b+c as the second part of the dynamic password. The two parts form the final "dynamic password end password". Then you can use the device permanently.
[0071] It should be noted here that the calculation formula here uses the value c, and you can also use a or b. The specific one to use is customized. Just make sure that a, b, c or more random numbers here are involved in the calculation after the first two steps and this step.
[0072] Here, dynamic password = F1[F2 -1 (x,y,z)], due to the change of date, the values of variables, "year", "month" and "day" will change tomorrow, which will change the calculation formula of F1(a,b,c), making it difficult to crack the password.
[0073] Even if the matrix is leaked here, the values of a, b, and c are calculated. The subsequent calculations of this solution are also calculated in combination with the characteristics of the PLC. Some results are selected by size, and the storage area address is used to increase the difficulty of cracking the password, which can also avoid the risk of leakage to a certain extent.
[0074] The dynamic password generation method given in this example solution can be used to form a corresponding software program and a corresponding dynamic password generation system when it is applied. When the software program is running, it will execute the dynamic password generation method and store it in a corresponding storage medium for the processor to retrieve and execute.
[0075] See also Figure 2 The dynamic password generation system based on PLC and touch screen provided in this solution includes an editable logic controller 100, a touch screen 200 and an industrial computer 300.
[0076] The programmable logic controller (PLC) 100 is used to complete all calculations and controls of the dynamic password, and stores and executes the above-mentioned corresponding dynamic password generation method.
[0077] The touch screen 200 cooperates with the industrial computer 300 and exchanges data with the programmable logic controller 100 through a communication protocol. The registration code calculated by the programmable logic controller (PLC) 100 is displayed on the touch screen 200. The industrial computer 300 exchanges data with the editable logic 100. Based on the registration code, the programmable logic controller 100 calculates a dynamic password, and then enters the dynamic password on the touch screen 200 for unlocking and use.
[0078] At the same time, the touch screen 200 can also display the status, such as whether it is shut down / unlocked, the number of incorrect password input times, and other functions.
[0079] If the programmable logic controller 100 and the display screen 200 are of different brands, the communication protocol between them will change. Just select the appropriate communication method to achieve successful communication.
[0080] As an example, use Siemens S7-1500 series plc to communicate with industrial computer (computer) through network cable using profinet protocol. Install Wincc software in the computer to display the screen, where you can see the registration code, enter the dynamic password, and see other status.
[0081] Based on the PLC and touch screen dynamic password generation method constructed based on the above scheme, the following examples illustrate its working process in specific applications. It should be noted here that the numerical values and methods involved in the working process are for illustration only and do not constitute a limitation to this scheme.
[0082] See also Figure 3When the trial period expires, the device is shut down and the system is unavailable. The date is 2024.12.30. The programmable logic controller 100 in the system generates random numbers a=1, b=2, c=5. In the matrix A preset by the previous program, the constants are a1=1, a2=1, a3=1, b1=1, b2=-1, b3=1, c1=1, c2=1, c3=-1. The programmable logic controller PLC multiplies the random numbers a, b, c with the preset matrix A and generates a registration code, x=8, y=4, z=-2, which is displayed on the touch screen.
[0083]
[0084] If the owner needs to continue using it, he / she will pay the engineer and inform him / her of the registration code displayed on the touch screen.
[0085] Engineers use the registration code to calculate the dynamic password: multiply the inverse matrix of matrix A by the registration code to find the values of the generated random numbers a, b, c. a=1, b=2, c=5
[0086]
[0087] According to the procedure, calculate
[0088] E1=24*256+12+30*256+1=13837;
[0089] E2=24*256+12*256+30+1=9247;
[0090] E3=24+12*256+30*256+1=10777;
[0091] E(min)=9247, E(max)=13837;
[0092] F1=E(max)-b=13835, F2=E(min)-b=9245;
[0093] G1=F1+c=13840, G2=F2+c=9250;
[0094] Therefore, you can continue to use the device until the next shutdown by entering 13835 and 9245 in the two dynamic password input boxes on the touch screen. You can use the device permanently by entering 13840 and 9250 in the two dynamic password input boxes on the screen.
[0095] The calculation formula of the dynamic password generation method and system based on PLC and touch screen constituted by the above scheme involves date. Since the date changes every day, the calculation formula changes at any time.
[0096] Secondly, the random numbers in the calculation formula used in this solution are all randomly generated, so the calculation formula can change at any time.
[0097] In addition, in this scheme, the random number is encrypted by using a matrix. When the matrix is unknown, it is difficult to deduce the value of the random number.
[0098] Therefore, the method for generating a dynamic password provided in this solution will keep changing the password, and the calculation formula will change every day. It will be difficult to crack the password due to insufficient cracking time. After using the dynamic password, you can set an unlimited number of shutdowns, which improves the reliability of the device password generation method.
[0099] The above-mentioned method of the present invention, or a specific system unit, or a part of the same, is a pure software architecture, which can be arranged on a physical medium, such as a hard disk, an optical disk, or any electronic device (such as a smart phone, a computer-readable storage medium) through program code. When the machine loads the program code and executes it (such as a smart phone loading and executing it), the machine becomes a device for implementing the present invention. The above-mentioned method and device of the present invention can also be transmitted in the form of program code through some transmission media, such as cables, optical fibers, or any transmission mode. When the program code is received, loaded and executed by a machine (such as a smart phone), the machine becomes a device for implementing the present invention.
[0100] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for generating a dynamic password based on PLC and touch screen, characterized in that: The dynamic password generation method comprises the following steps: S1: After the device expires, multiple random numbers will be generated in the editable logic controller PLC; S2: The editing logic controller PLC calculates the three random numbers generated by S1 and the matrix preset in the editing logic controller PLC to obtain the registration code; S3: Through the communication between the editing logic controller PLC and the touch screen, the editing logic controller PLC displays the registration code calculated in the above S2 on the touch screen; S4: Calculate the random number generated by S1 through an inverse function according to the registration code on the touch screen; S5: The random number obtained in S4 is substituted into the program of the editable logic controller PLC for calculation, and is calculated together with the date and other constants involved in the calculation in the editable logic controller PLC, and finally a dynamic password is obtained.
2. According to the method for generating a dynamic password based on PLC and touch screen according to claim 1, it is characterized in that: The value and quantity of random numbers in S1 are customized.
3. A method for generating a dynamic password based on PLC and touch screen according to claim 1, characterized in that: The constant values in the matrix are preset values.
4. A method for generating a dynamic password based on PLC and touch screen according to claim 1, characterized in that: The steps for calculating the random number generated by S1 using the registration code in S4 are as follows: S41: Find the inverse matrix of the preset matrix; S42: The random number generated in S1 can be calculated by multiplying the inverse matrix obtained in S41 by the registration code displayed on the touch screen.
5. A method for generating a dynamic password based on PLC and touch screen according to claim 1, characterized in that: The calculation process of S5 dynamic password includes the following steps: S51: Get the date and get the variables, "year (Y)", "month (M)", "day (D)"; S52: Calculate according to the variables obtained in S421 and the formula: E1=Y*256+M+D*256+a; E2=Y*256+M*256+D+a; E3=Y+M*256+D*256+a S53: Compare the minimum value E(min) and the maximum value E(max) of E1, E2, and E3; Let F1=E(max)-b be the first part of the dynamic password, and F2=E(min)-b be the second part of the dynamic password. The two parts constitute the final "dynamic password"; G1=E(max)-b+c is used as the first part of the dynamic password, and G2=E(min)-b+c is used as the second part of the dynamic password. The two parts constitute the final "dynamic password end password".
6. A method for generating a dynamic password based on PLC and touch screen according to claim 5, characterized in that: "Dynamic password" can continue to use the device until the next shutdown.
7. A method for generating a dynamic password based on PLC and touch screen according to claim 5, characterized in that: "Dynamic password end password" can permanently use the device.
8. A dynamic password generation system based on PLC and touch screen, characterized in that: It includes a programmable logic controller, a display screen and an industrial computer; The programmable logic controller is used to complete all calculations and controls of the dynamic password; The touch screen cooperates with the industrial computer and exchanges data with the programmable logic controller through a communication protocol. The registration code is displayed on the touch screen. The industrial computer interacts with the programmable logic controller. Based on the registration code, the dynamic password is calculated by the programmable logic controller, and then the dynamic password is input on the touch screen for unlocking and use.