Digital password encryption and decryption method of intelligent door lock

By using randomly generated permutation and shift matrices for encryption and decryption, the problems of data length and input bit length in smart door locks are solved, thereby improving applicability and security.

CN116311621BActive Publication Date: 2025-11-25TIANJIN TIANYOU TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310286079.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-23
Publication Date
2025-11-25
Estimated Expiration
2043-03-23

AI Technical Summary

Technical Problem

Existing digital password encryption and decryption methods are not applicable to smart locks, as they cannot meet their data length and input bit length requirements, and traditional methods cannot adapt to the input limitations of incomplete keyboards.

Method used

Encryption and decryption are performed using randomly generated permutation and shift matrices. Ciphertext and plaintext are generated through permutation and shift operations to ensure that the data length and input bit length meet the requirements of smart door locks.

Benefits of technology

It has implemented digital password encryption and decryption for smart door locks, improving data security and establishing a unified industry standard.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004139925700000021
    Figure BDA0004139925700000021
  • Figure BDA0004139925700000031
    Figure BDA0004139925700000031
Patent Text Reader

Abstract

The application relates to a digital password encryption and decryption method of an intelligent door lock. The encryption method comprises the following steps: S1, constructing a substitution matrix and a shift matrix: constructing an M*M substitution matrix and an N*N shift matrix, wherein M is the bit number of the digital keyboard of the intelligent door lock, the substitution matrix is generated by random numbers, and each horizontal data and each vertical data is not repeated, N is the data bit number participating in operation, the shift matrix is generated by random numbers, and each horizontal data and each vertical data is not repeated, and M is greater than N; S2, shifting; S3, substituting; the decryption method comprises the following steps: S1, reverse substitution; S2, reverse shifting. The application provides a digital password encryption and decryption method of an intelligent door lock. Compared with the existing digital password encryption and decryption method, the method in the application is suitable for the form of digital keyboard input of the intelligent door lock, and the encryption and decryption data length meets the use requirement of the intelligent door lock industry.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of intelligent door locks, and particularly relates to a digital password encryption and decryption method of an intelligent door lock. BACKGROUND

[0002] The digital password is one of important unlocking modes of the intelligent door lock, a user inputs the digital password to the door lock controller, and the door lock controller executes the unlocking or non-unlocking instruction after verification. The data encryption and decryption methods are various and quite perfect after years of development, but the current encryption and decryption methods are basically based on 16 hexadecimal data for encryption and decryption, and the plaintext, ciphertext and key are all based on 16 hexadecimal data, and most of the encryption and decryption methods have requirements for the data length to meet the length of 8 bytes, 16 bytes, etc. For the intelligent door lock, since the intelligent door lock keyboard usually only has 10 numbers of 0-9, it is impossible to input abcdef, and therefore the traditional encryption and decryption method cannot complete the verification work of the keyboard input data. Moreover, the password input bit number of the intelligent door lock is usually 4-8, and it is difficult to remember the password of more than 10 bits. In terms of the data length of encryption and decryption, the traditional encryption and decryption method cannot meet the use requirements of the intelligent door lock industry.

[0003] From the foregoing discussion, it can be known that the digital password encryption and decryption method needs to meet five requirements: 1) composed of plaintext, ciphertext and key, the plaintext is encrypted by the key to obtain the ciphertext, and the ciphertext is decrypted by the key to restore the plaintext; 2) the plaintext is encrypted by the key to form the ciphertext, and the ciphertext is decrypted by the key to form the plaintext, and the decrypted plaintext should be the same as the plaintext before encryption; 3) the plaintext, ciphertext and key can only be composed of numbers 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9; 4) the plaintext, ciphertext and key have the same length in the process of cooperation, and the specific length can be freely selected in 4-10 bits;

[0004] 5) the composition of the plaintext, ciphertext and key of the intelligent door lock for the incomplete keyboard can lack the number, but the used number needs to be continuous. Therefore, it is necessary to develop and design a digital password encryption and decryption method applied in the field of intelligent door locks to solve the foregoing technical problems. SUMMARY

[0005] The application provides a digital password encryption and decryption method of an intelligent door lock to solve the technical problems in the prior art, solve the deficiencies of the existing digital password encryption and decryption method, and meet the industry requirements of the existing intelligent door lock.

[0006] The technical scheme adopted by the present application to solve the technical problems existing in the prior art is: a digital password encryption and decryption method of an intelligent door lock, the encryption method comprising the following steps: S1, constructing a permutation matrix and a shift matrix: constructing an M*M permutation matrix and an N*N shift matrix, wherein M is the number of bits of the digital keyboard of the intelligent door lock, the permutation matrix is generated by random numbers and each horizontal data and each vertical data is not repeated, wherein N is the number of data bits participating in the operation, the shift matrix is generated by random numbers and each horizontal data and each vertical data is not repeated, and M is greater than or equal to N; S2, shifting: performing an arithmetic sum on each bit of the plaintext A and the secret key B, and performing a modulo operation on the arithmetic sum and N, taking the result of the modulo operation as the row number C, obtaining the row data of the row number C in the shift matrix, adding 1 to each bit of the row data to obtain the shift sequence code D, and shifting the plaintext A according to the shift sequence code D to obtain the shifted data E; S3, permutation: in the permutation matrix, selecting a column according to the shifted data E and selecting a row according to the secret key B, and cross-positioning each bit of the shifted data D to obtain the ciphertext F.

[0007] The decryption method comprises the following steps: S1, reverse permutation: in the permutation matrix, selecting a row according to the secret key B and querying the column where the ciphertext F is located to obtain the shifted data E; S2, reverse shifting: performing an arithmetic sum on each bit of the shifted data E and the secret key B, and performing a modulo operation on the arithmetic sum and N, taking the result of the modulo operation as the row number C, obtaining the row data of the row number C in the shift matrix, adding 1 to each bit of the row data to obtain the shift sequence code D, and performing reverse shifting on the shifted data E to obtain the plaintext A.

[0008] Preferably: 4≤N≤10, M≤10.

[0009] The present application has the advantages and positive effects that:

[0010] The present application provides a digital password encryption and decryption method of an intelligent door lock, which is suitable for the form of digital keyboard input of the intelligent door lock compared with the existing digital password encryption and decryption method, and the length of the encrypted and decrypted data meets the use requirements of the intelligent door lock industry. The digital password encryption and decryption method of the present application can standardize the intelligent door lock industry, improve the security of data, and is conducive to establishing unified industry standards. DETAILED DESCRIPTION

[0011] In order to further understand the invention content, characteristics and effects of the present application, the following examples are used for detailed description.

[0012] The digital password encryption and decryption method of the intelligent door lock of the present application comprises a digital password encryption method step and a digital password decryption method step.

[0013] I. The encryption method comprises the following steps:

[0014] Step S1, constructing a permutation matrix and a shift matrix:

[0015] A permutation matrix of M*M and a shift matrix of N*N are constructed, wherein M is the number of bits of the digital keyboard of the smart door lock, the permutation matrix is generated by random numbers and each horizontal data and each vertical data is not repeated, N is the number of data bits participating in operation, the shift matrix is generated by random numbers and each horizontal data and each vertical data is not repeated, and M≥N.

[0016] M is the number of bits of the digital keyboard of the smart door lock, if the smart door lock uses a digital keyboard of 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9, a 10*10 matrix is used, that is, M=10, if the smart door lock uses a digital keyboard of 1, 2, 3, 4, 5, 6, 7 and 8, an 8*8 matrix is used, that is, M=8.

[0017] N is the number of data bits participating in operation, that is, the number of bits of the plaintext A and the secret key B, in general, the number of bits of the plaintext A and the secret key B is at least 4 bits and at most 10 bits, therefore, the value range of N in the present application can be from 4 to 10, and the value of M is greater than or equal to the value of N.

[0018] In the embodiment, M=10 (corresponding to a digital keyboard of 10 keys), and N=6 (corresponding to a 6-bit plaintext and a 6-bit secret key).

[0019] The constructed 10*10 permutation matrix is shown in Table 1:

[0020] Table 1 Permutation matrix 10*10

[0021]

[0022]

[0023] It can be seen that the permutation matrix is generated by random numbers and each horizontal data and each vertical data is not repeated, each row data and each column data is 0-9 and not repeated.

[0024] The constructed 6*6 shift matrix is shown in Table 2:

[0025] Table 2 Shift matrix 6*6

[0026] 0 column 1 column 2 column 3 column 4 column 5 column 0 row 1 4 3 0 5 2 1 row 5 1 4 3 2 0 2 row 2 0 5 4 3 1 3 row 0 5 1 2 4 3 4 row 3 2 0 5 1 4 5 row 4 3 2 1 0 5

[0027] It can be seen that the shift matrix is generated by random numbers and each horizontal data and each vertical data is not repeated, each row data and each column data is 0-5 and not repeated.

[0028] Step S2, shifting:

[0029] The plaintext A and the key B are added together and the result is taken modulo N, and the result is taken as the row number C, the row number C is taken in the shift matrix, and each bit of the row is added by 1 to obtain the shift order code D, and the plaintext A is shifted according to the shift order code D to obtain the shifted data E.

[0030] In this embodiment, let the plaintext A = 654321 and the key B = 123456.

[0031] The shift process is as follows:

[0032] First, the plaintext A and the key B are added together and the result is taken modulo 6, the addition of the plaintext A and the key B = (6+5+4+3+2+1+1+2+3+4+5+6) = 42, and the result of the modulo operation is 0;

[0033] Then, the row number 0 is taken in the shift matrix, that is, 143052, each bit of the row is added by 1 to obtain the shift order code D, D = 254163.

[0034] Then, the plaintext A = 654321 is shifted according to the shift order code D = 254163, and the specific process is: the first bit 6 of the plaintext A is moved to the second bit, the second bit 5 is moved to the fifth bit, the third bit 4 is moved to the fourth bit, the fourth bit 3 is moved to the first bit, the fifth bit 2 is moved to the sixth bit, and the sixth bit 1 is moved to the third bit.

[0035] Finally, the shifted data E = 361452 is obtained.

[0036] Step S3, permutation:

[0037] In the permutation matrix, the column is selected according to the shifted data E, the row is selected according to the key B, and the data at the intersection point is used to replace each bit of the shifted data D to obtain the ciphertext F.

[0038] According to the shifted data E = 361452, the column is selected, the row is selected according to the key B = 123456, and the data at the intersection point is used to replace each bit of the shifted data E = 361452, and the specific process is: the data 0 in the first row of the third column of the permutation matrix is used to replace the first bit 3 of E, the data 6 in the second row of the sixth column of the permutation matrix is used to replace the second bit 6 of E, the data 1 in the third row of the first column of the permutation matrix is used to replace the third bit 1 of E, the data 0 in the fourth row of the fourth column of the permutation matrix is used to replace the fourth bit 4 of E, the data 1 in the fifth row of the fifth column of the permutation matrix is used to replace the fifth bit 5 of E, and the data 7 in the sixth row of the second column of the permutation matrix is used to replace the sixth bit 2 of E.

[0039] Finally, the ciphertext F = 061017 is obtained.

[0040] II. The decryption method comprises the following steps:

[0041] Step S1, reverse permutation:

[0042] In the permutation matrix, select the row according to the key B, query the column where the ciphertext F is located, and obtain the shifted data E.

[0043] Taking the foregoing encryption process as an example, the key B = 123456, the ciphertext F = 061017, the permutation matrix and the shift matrix are unchanged.

[0044] The specific process of reverse permutation is as follows: in the permutation matrix, select the row according to the key B = 123456, find the first bit 0 of the ciphertext F in the first row of the matrix, and query the column, which is found to be in the third column. Find the first bit 0 of the ciphertext F in the first row of the matrix, and query the column, which is found to be in the third column. Find the second bit 6 of the ciphertext F in the second row of the matrix, and query the column, which is found to be in the sixth column. Find the third bit 1 of the ciphertext F in the third row of the matrix, and query the column, which is found to be in the first column. Find the fourth bit 0 of the ciphertext F in the fourth row of the matrix, and query the column, which is found to be in the fourth column. Find the fifth bit 1 of the ciphertext F in the fifth row of the matrix, and query the column, which is found to be in the fifth column. Find the sixth bit 7 of the ciphertext F in the sixth row of the matrix, and query the column, which is found to be in the second column.

[0045] The shifted data E = 361452 is obtained.

[0046] Step S2, reverse shift:

[0047] The shifted data E is added to the key B, and the result is taken modulo N. The result of the modulo operation is taken as the row number C, and the data in the row number C in the shift matrix is obtained. The data in the row is added by 1 to obtain the shift sequence code D. The shifted data E is reversed to obtain the plaintext A.

[0048] The shifted data E = 361452 is added to the key B, and the result is taken modulo N. The shifted data E is added to the key B, and the result is taken modulo N. The result of the modulo operation is taken as the row number C, and the data in the row number C in the shift matrix is obtained. The data in the row is added by 1 to obtain the shift sequence code D. The shifted data E is reversed to obtain the plaintext A.

[0049] Then, the row number of the data in the shift matrix is obtained, that is, 143052, and each bit of the data is added by 1 to obtain the shift sequence code D, D = 254163.

[0050] Afterwards, the shifted data E is reversed shifted according to the shift order code D to get the plaintext A, the specific process is: the first bit of the plaintext A is moved to the second bit according to the shift order code D, which is the second bit 6 of the shifted data E, so the first bit of the plaintext A is 6, the second bit of the plaintext A is moved to the fifth bit according to the shift order code D, which is the fifth bit 5 of the shifted data E, so the second bit of the plaintext A is 5, the third bit of the plaintext A is moved to the fourth bit according to the shift order code D, which is the fourth bit 4 of the shifted data E, so the third bit of the plaintext A is 4, the fourth bit of the plaintext A is moved to the first bit according to the shift order code D, which is the first bit 3 of the shifted data E, so the fourth bit of the plaintext A is 3, the fifth bit of the plaintext A is moved to the sixth bit according to the shift order code D, which is the sixth bit 2 of the shifted data E, so the fifth bit of the plaintext A is 2, the sixth bit of the plaintext A is moved to the third bit according to the shift order code D, which is the third bit 1 of the shifted data E, so the sixth bit of the plaintext A is 1;

[0051] Finally, the decrypted plaintext A = 654321.

Claims

1. A digital password encryption and decryption method for a smart door lock, characterized by: The encryption method includes the following steps: S1. Constructing the permutation matrix and shift matrix: Construct an M*M permutation matrix and an N*N shift matrix, where M is the number of bits in the smart lock's numeric keypad. The permutation matrix is ​​generated using random numbers, and each row and column of data is unique. N is the number of bits of data involved in the calculation. The shift matrix is ​​generated using random numbers, and each row and column of data is unique. M≥N. S2, Shift: Calculate the arithmetic sum of plaintext A and key B, and perform a modulo operation on the arithmetic sum and N. Use the result of the modulo operation as the row number C. Obtain the data of row number C in the shift matrix, add 1 to each bit of the data in that row, and use it as the shift sequence code D. Shift plaintext A according to the shift sequence code D to obtain the shifted data E. S3, Permutation: Within the permutation matrix, select columns based on the shifted data E, select rows based on the key B, and use the data at the intersection points to swap each bit of the shifted data E to obtain the ciphertext F; Decryption method Includes the following steps, S1. Reverse permutation: Within the permutation matrix, select a row according to the key B, query the column where the ciphertext F is located, and obtain the shifted data E. S2, Reverse Shift: Perform an arithmetic sum of the shifted data E and each digit of the key B, and perform a modulo operation on the arithmetic sum and N. Use the result of the modulo operation as the row number C. Obtain the data of the row number C in the shift matrix, add 1 to each digit of the data in that row, and use it as the shift sequence code D. The shifted data E is reverse-shifted to obtain the plaintext A.

2. The digital password encryption and decryption method for smart door locks as described in claim 1, characterized in that: 4≤N≤10, M≤10.

Citation Information

Patent Citations

  • Encryption method based on dual cycle queue shift and transposition rule

    CN101237322A