A method and system for protecting passwords using a secure keyboard

By using a self-made secure keyboard with one password per character and distributed storage, the risk of user password leakage when entered using the system's default keyboard is resolved, enabling secure storage and use of passwords and improving the security and protection of user passwords.

CN112507403BActive Publication Date: 2026-05-12BEIJING WATCH DATA SYSTEM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING WATCH DATA SYSTEM CO LTD
Filing Date
2020-12-08
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, when users enter their passwords using the system's default keyboard, the passwords may be intercepted by hackers, leading to the leakage of sensitive information. Furthermore, storing plaintext passwords in memory while the keyboard is not retracted increases the risk of leakage.

Method used

A self-made secure keyboard is used. By using a one-key-one-key and distributed storage method, the plaintext characters obtained from each key press are encrypted and then distributed. When in use, the plaintext characters are decrypted and the RC4 algorithm is used for encryption and decryption. The key positions are randomly distributed each time the keyboard pops up.

Benefits of technology

It effectively prevents attackers from obtaining plaintext passwords through debugging software, reduces the risk of leakage, ensures user password security, and does not affect user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112507403B_ABST
    Figure CN112507403B_ABST
Patent Text Reader

Abstract

The application discloses a method and system for protecting passwords by using a secure keyboard, and the method comprises the following steps: S100, after the secure keyboard is popped up, the clear text characters obtained by clicking the keys each time are encrypted to obtain corresponding cipher text characters and are stored in a scattered manner; S200, when the password is used, each cipher text character stored in a scattered manner is found and decrypted to obtain corresponding clear text characters. According to the method and system, the password is stored and used in a one-character-one-cipher manner and a scattered storage manner, the encrypted password is stored in a scattered manner, the clear text password is not stored continuously in the memory, and therefore, the attacker cannot directly obtain the clear text password by debugging software, and the safety of the password of the user is effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of information security and cryptography, and specifically to a method and system for protecting passwords using a secure keyboard. Background Technology

[0002] With the widespread use of mobile banking, protecting user password security has become increasingly important. Entering passwords using the system's default keyboard can be intercepted by hackers, leading to the leakage of sensitive information and exposing users to the risk of significant financial losses. Therefore, to protect sensitive information from leakage, users should encrypt their passwords after entering them and waiting for the keyboard to be retracted. However, if the keyboard remains on the keyboard after the user has entered their password, consecutive plaintext passwords will be stored in memory, increasing the risk of password leakage. Summary of the Invention

[0003] In view of the deficiencies in the existing technology, the purpose of this invention is to provide a method and system for protecting passwords using a secure keyboard. To protect the security of user-input passwords, a self-made password keyboard is used, and passwords are securely stored and used by using a one-word-one-key and distributed storage method.

[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0005] A method for protecting passwords using a secure keyboard, the method comprising:

[0006] S100. After the secure keyboard pops up, the plaintext characters obtained from each key press are encrypted to obtain the corresponding ciphertext characters and then stored in a distributed manner.

[0007] S200. When using the password, decrypt each ciphertext character found in the scattered storage to obtain the corresponding plaintext character.

[0008] Furthermore, in the method described above, S100 includes:

[0009] S101. Create a linked list and a list of specified lengths, wherein the linked list is used to store the ciphertext characters and the list is used to store the storage position of each ciphertext character in the linked list;

[0010] S102. When encrypting the current plaintext character, record the current encryption count M1, where M1 is a positive integer;

[0011] S103. Traverse the list from the beginning to the end. On the M1st traversal, retrieve the data N1 stored at the M1st position of the list, where N1 is a positive integer.

[0012] S104. Traverse the linked list from the beginning to the end. On the N1st traversal, store the ciphertext character corresponding to the current plaintext character at the N1st position of the linked list.

[0013] Furthermore, in the method described above, S200 includes:

[0014] S201. Locate the linked list and the list;

[0015] S202. When decrypting the current ciphertext character, record the current decryption count M2, where M2 is a positive integer;

[0016] S203. Traverse the list from the beginning to the end. On the M2nd traversal, retrieve the data N2 stored at the M2th position of the list, where N2 is a positive integer.

[0017] S204. Traverse the linked list from the beginning to the end. On the N2nd traversal, retrieve the current ciphertext character stored at the N2nd position of the linked list, decrypt it to obtain the corresponding plaintext character.

[0018] Furthermore, the method described above, before the security keyboard pops out, also includes:

[0019] Obtain an encryption key, which is used to encrypt the plaintext characters using the RC4 algorithm and decrypt the ciphertext characters.

[0020] Furthermore, as described above, the key layout displayed each time the secure keyboard pops up is randomly distributed;

[0021] Each time the secure keyboard pops up, the data in the list is refilled with random numbers to ensure that the encrypted ciphertext characters are stored in a different position in the linked list each time the secure keyboard pops up.

[0022] A system for protecting passwords using a secure keyboard, the system comprising:

[0023] The secure storage module is used to encrypt the plaintext characters obtained from each key press after the secure keyboard pops up, obtain the corresponding ciphertext characters, and then store them in a distributed manner.

[0024] The module is used to decrypt each ciphertext character found in the scattered storage when using a password, and then obtain the corresponding plaintext character.

[0025] Furthermore, in the system described above, the secure storage module is specifically used for:

[0026] Create a linked list and a list of specified lengths, wherein the linked list is used to store the ciphertext characters and the list is used to store the storage position of each ciphertext character in the linked list;

[0027] When encrypting the current plaintext character, record the current encryption count M1, where M1 is a positive integer;

[0028] Traverse the list from the beginning to the end. On the M1th traversal, retrieve the data N1 stored at the M1th position of the list, where N1 is a positive integer.

[0029] Traverse the linked list from the beginning to the end. On the N1st traversal, store the ciphertext character corresponding to the current plaintext character at the N1st position of the linked list.

[0030] Furthermore, in the system described above, the module is specifically used for:

[0031] Locate the linked list and the list;

[0032] When decrypting the current ciphertext character, record the current decryption count M2, where M2 is a positive integer;

[0033] Traverse the list from the beginning to the end. On the M2nd traversal, retrieve the data N2 stored at the M2th position of the list, where N2 is a positive integer.

[0034] Traverse the linked list from the beginning to the end. On the N2nd traversal, retrieve the current ciphertext character stored at the N2nd position of the linked list, decrypt it to obtain the corresponding plaintext character.

[0035] Furthermore, the system described above is characterized in that, before the security keyboard pops out, the system is also used to:

[0036] Obtain an encryption key, which is used to encrypt the plaintext characters using the RC4 algorithm and decrypt the ciphertext characters.

[0037] Furthermore, in the system described above, the key layout displayed each time the security keyboard pops up is randomly distributed;

[0038] Each time the secure keyboard pops up, the data in the list is refilled with random numbers to ensure that the encrypted ciphertext characters are stored in a different position in the linked list each time the secure keyboard pops up.

[0039] The beneficial effects of the present invention are as follows: The method and system provided by the present invention securely store and use passwords by using one-word-one-key and distributed storage. The encrypted passwords are distributed and stored. Since the plaintext passwords are not stored continuously in memory, attackers cannot directly obtain the plaintext passwords through debugging software, thus effectively ensuring the security of user passwords. Attached Figure Description

[0040] Figure 1 This is a flowchart illustrating a method for protecting passwords using a secure keyboard, as provided in an embodiment of the present invention.

[0041] Figure 2 This is a schematic diagram of a method for protecting passwords using a secure keyboard, provided in an embodiment of the present invention.

[0042] Figure 3 This is a schematic diagram illustrating the storage or retrieval of encrypted characters provided in an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of a system for protecting passwords using a secure keyboard, provided in an embodiment of the present invention. Detailed Implementation

[0044] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0045] To protect the security of user-entered passwords, a self-made password keypad is used, and passwords are securely stored and used by employing a one-word-one-key and distributed storage method.

[0046] like Figure 1 As shown, this embodiment of the invention provides a method for protecting passwords using a secure keyboard, comprising:

[0047] S100. After the secure keyboard pops up, encrypt the plaintext characters obtained from each key press to obtain the corresponding ciphertext characters, and then store them in a distributed manner.

[0048] Before the secure keyboard pops up, an encryption key needs to be obtained. This key is used to encrypt plaintext characters and decrypt ciphertext characters using the RC4 algorithm. After the keyboard pops up, each key press encrypts the obtained plaintext characters, and finally, all the ciphertext is distributed and stored in memory.

[0049] S100 includes:

[0050] S101. Create a linked list and a list of specified lengths. The linked list is used to store the ciphertext characters, and the list is used to store the storage position of each ciphertext character in the linked list.

[0051] S102. When encrypting the current plaintext character, record the current encryption count M1, where M1 is a positive integer;

[0052] S103. Traverse the list from the beginning to the end. On the M1th traversal, retrieve the data N1 stored in the M1th position of the list, where N1 is a positive integer.

[0053] S104. Traverse the linked list from the beginning to the end. On the N1st traversal, store the ciphertext character corresponding to the current plaintext character at the N1st position of the linked list.

[0054] S200. When using the password, decrypt each ciphertext character found in the scattered storage to obtain the corresponding plaintext character.

[0055] When using a password, it is necessary to find each password that is already scattered and stored in memory, which is the reverse of the stored procedure.

[0056] S200 specifically includes:

[0057] S201. Locate the linked list and the list;

[0058] S202. When decrypting the current ciphertext character, record the current decryption count M2, where M2 is a positive integer;

[0059] S203. Traverse the list from the beginning to the end. On the M2nd traversal, retrieve the data N2 stored in the M2th position of the list, where N2 is a positive integer.

[0060] S204. Traverse the linked list from the beginning to the end. On the N2nd traversal, retrieve the current ciphertext character stored at the N2nd position of the linked list, decrypt it, and obtain the corresponding plaintext character.

[0061] like Figure 2-3 As shown, to effectively ensure the security of user passwords, an encryption key S is first obtained through a certain algorithm. The plaintext password and S are then processed using RC4 to obtain the ciphertext password. To prevent attackers from directly obtaining the plaintext password through debugging software, the obtained ciphertext password needs to be stored in a distributed manner. The specific location of its storage in memory must first be determined, as follows:

[0062] 1) Create a linked list N of a specified length to store the ciphertext. Create a list L to determine the location of the ciphertext within linked list N.

[0063] 2) Each time encryption is performed, record the current encryption count I, that is, the current encryption is the Ith time.

[0064] 3) Traverse the list L from the beginning to the end. On the Ith traversal, retrieve the data P stored at that position in the list L.

[0065] 4) Traverse the linked list N from the beginning to the end. On the Pth traversal, store the ciphertext password at that position.

[0066] Once the encrypted password is saved, when using it, you need to retrieve each password that has been scattered and stored in memory. The process is the reverse of the storage process, as follows:

[0067] 1) Locate the previously used linked list N and list L.

[0068] 2) Each time decryption is about to occur, record the current decryption count I, i.e., the current decryption is the Ith time.

[0069] 3) Traverse the list L from the beginning to the end. On the Ith traversal, retrieve the data P stored at that position in the list L.

[0070] 4) Traverse the linked list N from the beginning. On the Pth traversal, retrieve the ciphertext password stored at that position in linked list N and perform the decryption operation. To decrypt the ciphertext, perform an operation using the RC4 algorithm on the ciphertext and the previously calculated S to obtain the plaintext password.

[0071] To reduce the risk of attackers simulating key layouts to deduce a user's actual password, the secure keyboard needs to be designed with randomly distributed keys each time it pops up. After each use, the data in list L is refilled with random numbers, ensuring that the encrypted ciphertext is stored in a different location in memory each time the keyboard is used, thus increasing the difficulty for attackers to find the ciphertext's storage location. Using a self-made secure keyboard can effectively protect user passwords and reduce the risk of leakage. Each time the secure keyboard pops up, the password keys are randomly distributed, and each character entered by the user is encrypted and stored dispersedly in memory. Because the key layout is random and the encrypted password is stored in memory, it is very difficult for hackers to intercept the user's real password, thus significantly improving security.

[0072] like Figure 4 As shown, this embodiment of the invention also provides a system for protecting passwords using a secure keyboard. When a user enters a password using the secure keyboard, the entered password is securely stored and used through a one-character-one-key and distributed storage method. The system includes:

[0073] The secure storage module 100 is used to encrypt the plaintext characters obtained from each key press after the secure keyboard pops up, obtain the corresponding ciphertext characters, and then store them in a distributed manner.

[0074] Module 200 is used to decrypt each ciphertext character found in scattered storage when using a password, and obtain the corresponding plaintext character.

[0075] The secure storage module 100 is specifically used for:

[0076] Create a linked list and a list of specified lengths. The linked list stores the ciphertext characters, and the list stores the storage position of each ciphertext character in the linked list. When encrypting the current plaintext character, record the current encryption count M1, where M1 is a positive integer. Traverse the list from the beginning, and at the M1th traversal, retrieve the data N1 stored at the M1th position of the list, where N1 is a positive integer. Traverse the linked list from the beginning, and at the N1th traversal, store the ciphertext character corresponding to the current plaintext character at the N1th position of the linked list.

[0077] Module 200 is specifically used for:

[0078] Find the linked list and the list; when decrypting the current ciphertext character, record the current decryption count M2, where M2 is a positive integer; traverse the list from the beginning, and on the M2th traversal, retrieve the data N2 stored at the M2th position of the list, where N2 is a positive integer; traverse the linked list from the beginning, and on the N2th traversal, retrieve the current ciphertext character stored at the N2th position of the linked list, decrypt it, and obtain the corresponding plaintext character.

[0079] Before the secure keyboard pops up, the system also obtains an encryption key, which is used to encrypt plaintext characters and decrypt ciphertext characters using the RC4 algorithm.

[0080] The beneficial effects of the technical solution of this invention include:

[0081] 1) Encrypting user passwords effectively ensures their security. The encrypted passwords are then stored in a distributed manner to increase the difficulty for attackers to crack them.

[0082] 2) Throughout the entire lifecycle of the secure keyboard, the plaintext password will not be stored continuously in memory, and attackers will not be able to directly obtain the plaintext password through debugging software.

[0083] 3) The password encryption and distributed storage process is high-performance, short-time, and has low memory consumption, which is almost imperceptible to users and does not affect the user experience.

[0084] 4) The secure keyboard is compatible with the vast majority of mobile phones and does not conflict with the system keyboard. It is highly portable, making it easy for developers to integrate and call it, as well as to make some personalized customizations.

[0085] 5) The security keyboard and the system keyboard are largely the same in appearance and function, and will not affect the user's previous usage habits and input experience.

[0086] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention is also intended to include these modifications and variations.

Claims

1. A method for protecting passwords using a secure keyboard, characterized in that, The method includes: S100. After the secure keyboard pops up, the plaintext characters obtained from each key press are encrypted to obtain the corresponding ciphertext characters and then stored in a distributed manner. S200: When using the password, each ciphertext character found and stored in a scattered manner is decrypted to obtain the corresponding plaintext character; S100 includes: S101. Create a linked list and a list of specified lengths, wherein the linked list is used to store the ciphertext characters and the list is used to store the storage position of each ciphertext character in the linked list; each time the secure keyboard pops up, the data in the list is refilled with random numbers; S102. When encrypting the current plaintext character, record the current encryption count M1, where M1 is a positive integer; S103. Traverse the list from the beginning to the end. On the M1st traversal, retrieve the data N1 stored at the M1st position of the list, where N1 is a positive integer. S104. Traverse the linked list from the beginning to the end. On the N1st traversal, store the ciphertext character corresponding to the current plaintext character at the N1st position of the linked list; S200 includes: S201. Locate the linked list and the list; S202. When decrypting the current ciphertext character, record the current decryption count M2, where M2 is a positive integer; S203. Traverse the list from the beginning to the end. On the M2nd traversal, retrieve the data N2 stored at the M2th position of the list, where N2 is a positive integer. S204. Traverse the linked list from the beginning to the end. On the N2nd traversal, retrieve the current ciphertext character stored at the N2nd position of the linked list, decrypt it to obtain the corresponding plaintext character.

2. The method according to claim 1, characterized in that, Before the security keyboard pops out, it also includes: Obtain an encryption key, which is used to encrypt the plaintext characters using the RC4 algorithm and decrypt the ciphertext characters.

3. The method according to claim 2, characterized in that, The key layout displayed each time the security keyboard pops up is randomly distributed; Each time the secure keyboard pops up, the data in the list is refilled with random numbers to ensure that the encrypted ciphertext characters are stored in a different position in the linked list each time the secure keyboard pops up.

4. A system for protecting passwords using a secure keyboard, characterized in that, The system includes: The secure storage module is used to encrypt the plaintext characters obtained from each key press after the secure keyboard pops up, obtain the corresponding ciphertext characters, and then store them in a distributed manner. The module is used to decrypt each ciphertext character found in the scattered storage when using a password, and then obtain the corresponding plaintext character. The secure storage module is specifically used for: Create a linked list and a list of specified lengths, wherein the linked list is used to store the ciphertext characters and the list is used to store the storage position of each ciphertext character in the linked list; each time the secure keyboard is popped up, the data in the list is refilled with random numbers; When encrypting the current plaintext character, record the current encryption count M1, where M1 is a positive integer; Traverse the list from the beginning to the end. On the M1th traversal, retrieve the data N1 stored at the M1th position of the list, where N1 is a positive integer. Traverse the linked list from the beginning to the end. On the N1st traversal, store the ciphertext character corresponding to the current plaintext character at the N1st position of the linked list. The module is specifically used for: Locate the linked list and the list; When decrypting the current ciphertext character, record the current decryption count M2, where M2 is a positive integer; Traverse the list from the beginning to the end. On the M2nd traversal, retrieve the data N2 stored at the M2th position of the list, where N2 is a positive integer. Traverse the linked list from the beginning to the end. On the N2nd traversal, retrieve the current ciphertext character stored at the N2nd position of the linked list, decrypt it to obtain the corresponding plaintext character.

5. The system according to claim 4, characterized in that, Before the security keyboard pops out, the system is also used to: Obtain an encryption key, which is used to encrypt the plaintext characters using the RC4 algorithm and decrypt the ciphertext characters.

6. The system according to claim 5, characterized in that, The key layout displayed each time the security keyboard pops up is randomly distributed; Each time the secure keyboard pops up, the data in the list is refilled with random numbers to ensure that the encrypted ciphertext characters are stored in a different position in the linked list each time the secure keyboard pops up.