Key verification method, device, electronic device and storage medium

By segmenting and converting the received keys, the encrypted keys are generated to match the target keys, which solves the problem of key security in Internet transmission, improves account security and reduces cracking risks.

CN115242380BActive Publication Date: 2024-12-27CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210737635.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2024-12-27
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

The prior art is difficult to effectively protect the security of user keys transmitted over the Internet, especially when facing the possibility of brute force cracking, there is a lack of effective encryption methods.

Method used

By receiving the key sent by the target terminal, it is divided into multiple characters, and each character is subjected to ASCII code conversion and Euler function calculation, and finally it is converted into an encrypted key to match the pre-stored target key. to verify the validity of the key.

Benefits of technology

It improves the security of user accounts, reduces the possibility that keys are brute-forced, and ensures the success rate of key verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115242380B_ABST
    Figure CN115242380B_ABST
Patent Text Reader

Abstract

The present application provides a key verification method, device, electronic device and storage medium, the method comprising: receiving a first key sent by a target terminal; dividing the first key to obtain a plurality of characters; for any character among the plurality of characters, converting the character according to a first character conversion method to obtain a converted first character, and determining a second character from the first character; converting the determined plurality of second characters respectively according to a second character conversion method to obtain a plurality of converted third characters; determining a second key corresponding to the first key based on the plurality of converted third characters; matching the second key with a pre-stored target key of the target terminal, and determining that the key verification is successful when the second key matches the target key. The technical solution provided by the embodiment of the present application can improve the security of the user account and reduce the possibility of the user key being cracked by brute force.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a key verification method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of information technology, the Internet has greatly changed people's living space and lifestyle. More and more users have joined the ranks of Internet users. How to protect the security of users' accounts has become particularly important.

[0003] To this end, it is necessary to encrypt data transmitted over the Internet, such as user keys. The so-called data encryption is to change the appearance of important data transmitted over the Internet, and the receiving end compares the encrypted data. In addition, data encryption can also be used as a means of preventing and controlling network security. Therefore, it is urgent to provide a suitable encryption method to protect the security of user data. Summary of the invention

[0004] In order to solve the above technical problems, the embodiments of the present application provide a key verification method, device, electronic device and storage medium.

[0005] In a first aspect, an embodiment of the present application provides a key verification method, the method comprising:

[0006] Receiving a first key sent by a target terminal;

[0007] Splitting the first key to obtain a plurality of characters;

[0008] For any character among the plurality of characters, convert the character according to a first character conversion method to obtain a converted first character, and determine a second character from the first character;

[0009] Performing character conversion on the determined plurality of second characters respectively according to the second character conversion mode to obtain a plurality of converted third characters;

[0010] Determining a second key corresponding to the first key based on the plurality of converted third characters;

[0011] The second key is matched with a target key of the target terminal stored in advance, and when the second key matches the target key, it is determined that the key verification is successful; wherein the target key is obtained by converting the key set by the target terminal, and the conversion method of the key set by the target terminal to the target key is the same as the conversion method of the first key to the second key.

[0012] Optionally, for any character among the multiple characters, converting the character according to a first character conversion method to obtain a converted first character, and determining a second character from the first character includes:

[0013] For any character among the multiple characters, convert the character into an ASCII code to obtain a first character after conversion;

[0014] A first prime number that is less than or equal to the character is determined from the first character, and the first prime number is determined as the second character.

[0015] Optionally, the method further includes:

[0016] Determine a second order of a plurality of second characters corresponding to the plurality of characters according to the first order of the plurality of characters in the first key;

[0017] According to the second order of the second characters, the second characters are sequentially stored in the first array.

[0018] Optionally, the converting the determined multiple second characters respectively according to the second character conversion mode to obtain multiple converted third characters includes:

[0019] Performing Euler function operations on the plurality of second characters in the first array respectively to obtain operation results corresponding to the plurality of second characters respectively;

[0020] The obtained multiple operation results are determined as multiple converted third characters.

[0021] Optionally, also include:

[0022] Determining a third order of the plurality of converted third characters; the third order of the plurality of converted third characters being the same as a second order of the corresponding plurality of second characters in the first array;

[0023] Every two adjacent characters in the plurality of converted third characters are multiplied to obtain a multiplied character.

[0024] Optionally, determining the second key corresponding to the first key based on the converted third character includes:

[0025] According to the order of multiplication, the multiplied characters are stored in the second array in order;

[0026] Perform character concatenation on the multiplied characters stored in the second array to obtain a concatenated character string;

[0027] The concatenated character string is determined as a second key corresponding to the first key.

[0028] In a second aspect, an embodiment of the present application provides a key verification device, the device comprising:

[0029] A key receiving module, used for receiving a first key sent by a target terminal;

[0030] A key segmentation module, used for segmenting the first key to obtain a plurality of characters;

[0031] A first conversion module, configured to convert any character among the plurality of characters according to a first character conversion method to obtain a converted first character, and determine a second character from the first character;

[0032] A second conversion module, used for performing character conversion on the determined plurality of second characters respectively according to a second character conversion mode to obtain a plurality of converted third characters;

[0033] a key determination module, configured to determine a second key corresponding to the first key based on the plurality of converted third characters;

[0034] A key verification module is used to match the second key with a target key of the target terminal stored in advance, and determine that the key verification is successful when the second key matches the target key; wherein the target key is obtained by converting the key set by the target terminal, and the conversion method of the key set by the target terminal to the target key is the same as the conversion method of the first key to the second key.

[0035] Optionally, the first conversion module is specifically used to:

[0036] For any character among the multiple characters, convert the character into an ASCII code to obtain a first character after conversion;

[0037] A first prime number that is less than or equal to the character is determined from the first character, and the first prime number is determined as the second character.

[0038] Optionally, the device further comprises:

[0039] A first sequence determining module, used for determining a second sequence of a plurality of second characters corresponding to the plurality of characters according to the first sequence of the plurality of characters in the first key;

[0040] The first storage module is used to store the plurality of second characters in sequence in a first array according to a second order of the plurality of second characters.

[0041] Optionally, the second conversion module is specifically used to:

[0042] Performing Euler function operations on the plurality of second characters in the first array respectively to obtain operation results corresponding to the plurality of second characters respectively;

[0043] The obtained multiple operation results are determined as multiple converted third characters.

[0044] Optionally, also include:

[0045] A second sequence determination module is used to determine a third sequence of the plurality of converted third characters; the third sequence of the plurality of converted third characters is the same as the second sequence of the corresponding plurality of second characters in the first array;

[0046] The character multiplication module is used to multiply every two adjacent characters in the plurality of converted third characters to obtain a multiplied character.

[0047] Optionally, the key determination module is specifically used to:

[0048] According to the order of multiplication, the multiplied characters are stored in the second array in order;

[0049] Perform character concatenation on the multiplied characters stored in the second array to obtain a concatenated character string;

[0050] The concatenated character string is determined as a second key corresponding to the first key.

[0051] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the key verification method described in the first aspect when executing the program.

[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the key verification method described in the first aspect are implemented.

[0053] The technical solution provided by the embodiment of the present application comprises the following steps: receiving a first key sent by a target terminal; dividing the first key to obtain a plurality of characters; for any character among the plurality of characters, converting the character according to a first character conversion method to obtain a converted first character, and determining a second character from the first character; performing character conversion on the determined plurality of second characters respectively according to a second character conversion method to obtain a plurality of converted third characters; determining a second key corresponding to the first key based on the plurality of converted third characters; matching the second key with a pre-stored target key of the target terminal, and determining that the key verification is successful when the second key matches the target key.

[0054] It can be seen that through the technical solution provided by the embodiment of the present application, after receiving the first key sent by the target terminal, the server divides the first key, and converts each character after the division according to the first character conversion method and the second character conversion method, and finally determines the second key corresponding to the first key, and the second key is the key encrypted by the first key. Then, when the second key matches the target key of the target terminal stored in advance, it is determined that the key verification is successful. Thereby improving the security of the user account and reducing the possibility of the user key being cracked by brute force. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a flowchart of the steps of a key verification method provided by an embodiment of the present application;

[0056] Figure 2 yes Figure 1 A flowchart of steps of an implementation method of S130;

[0057] Figure 3 yes Figure 1 A flowchart of steps of an implementation method of S140;

[0058] Figure 4 yes Figure 1 A flowchart of steps of an implementation method of S150;

[0059] Figure 5 It is a flowchart of the steps of the complete technical solution of this application;

[0060] Figure 6 It is a structural block diagram of a key verification device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0062] With the rapid development of information technology, the Internet has greatly changed people's living space and lifestyle. More and more users have joined the ranks of Internet users. How to protect the security of users' accounts has become particularly important.

[0063] To this end, it is necessary to encrypt data transmitted over the Internet, such as user keys. The so-called data encryption is to change the appearance of important data transmitted over the Internet, and the receiving end compares the encrypted data. In addition, data encryption can also be used as a means of preventing and controlling network security. Therefore, it is urgent to provide a suitable encryption method to protect the security of user data.

[0064] To this end, embodiments of the present application provide a key verification method, device, electronic device, and storage medium.

[0065] In the first aspect, a key verification method provided in an embodiment of the present application is first described in detail.

[0066] It should be noted that the execution entity of the key verification method can be a server.

[0067] like Figure 1 As shown, a key verification method provided in an embodiment of the present application may include the following steps:

[0068] S110, receiving a first key sent by a target terminal.

[0069] Specifically, the user can input the preset key in the key input interface of the target terminal, and the target terminal sends the key input by the user to the server, and then the server receives the key. For the sake of clear description of the solution, the key is called the first key.

[0070] S120, split the first key to obtain multiple characters.

[0071] Specifically, after receiving the first key, the server may divide the first key data according to the number of bits to obtain multiple characters. For example, if the first key includes 5 characters, the first key may be divided to obtain 5 characters.

[0072] Among them, characters include letters, numbers, words and symbols.

[0073] S130: for any character among the multiple characters, convert the character according to a first character conversion method to obtain a converted first character, and determine a second character from the first character.

[0074] Specifically, after the first key is split to obtain multiple characters, for any character among the multiple characters, the character can be converted according to the first character conversion method to obtain a converted first character. Since each first character usually includes more characters, it is necessary to determine some second characters from the converted first characters. Among them, the first character conversion method can be to convert each character of the multiple characters into ASCII code, and the converted first character is the ASCII code corresponding to the character, and the second character can be determined from the ASCII code corresponding to the character.

[0075] It can be understood that, for any character among the multiple characters, converting the character into a first character and determining the second character from the first character is a process of encrypting the first key.

[0076] In order to describe the solution clearly, S130 will be described in detail in the following embodiments.

[0077] S140: Perform character conversion on the determined plurality of second characters respectively according to a second character conversion method to obtain a plurality of converted third characters.

[0078] Specifically, since character conversion is performed for any character in each character according to the first character conversion method, multiple first characters are obtained; and the second character is determined from each first character to obtain multiple second characters. After obtaining multiple second characters, character conversion can be performed for each second character according to the second character conversion method to obtain multiple converted third characters. The second character conversion method can be: performing Euler function operation on each second character to obtain operation results corresponding to multiple second characters, and determining the obtained multiple operation results as multiple converted third characters.

[0079] Among them, in number theory, for a positive integer n, the Euler function is the number of numbers that are relatively prime to n among positive integers less than n. Those skilled in the art should understand the Euler function operation, and the embodiments of the present application will not elaborate on the Euler function.

[0080] In order to describe the solution clearly, S140 will be described in detail in the following embodiments.

[0081] S150: Determine a second key corresponding to the first key based on the plurality of converted third characters.

[0082] Specifically, after obtaining a plurality of converted third characters, the second key corresponding to the first key is determined according to the plurality of converted third characters. Specifically, every two characters in the third characters may be multiplied to obtain a multiplied result, and the multiplied results are concatenated, and the concatenated result is determined as the second key corresponding to the first key.

[0083] In order to describe the solution clearly, the specific implementation of S150 will be described in detail in the following embodiments.

[0084] S160, matching the second key with a pre-stored target key of the target terminal, and determining that the key verification is successful when the second key matches the target key.

[0085] The target key is obtained by converting the key set by the target terminal, and the conversion method of converting the key set by the target terminal to the target key is the same as the conversion method of converting the first key to the second key.

[0086] Specifically, the server can convert the key set by the target terminal using the method described in S120 to S150 to obtain the target key, and store the target key in the database. After obtaining the second key corresponding to the first key, the second key can be compared with the target key stored in the database. If the second key is consistent with the target key, then it is determined that the key verification is successful; otherwise, it is determined that the key verification has failed.

[0087] The technical solution provided by the embodiment of the present application comprises the following steps: receiving a first key sent by a target terminal; dividing the first key to obtain a plurality of characters; for any character among the plurality of characters, converting the character according to a first character conversion method to obtain a converted first character, and determining a second character from the first character; performing character conversion on the determined plurality of second characters respectively according to a second character conversion method to obtain a plurality of converted third characters; determining a second key corresponding to the first key based on the plurality of converted third characters; matching the second key with a pre-stored target key of the target terminal, and determining that the key verification is successful when the second key matches the target key.

[0088] It can be seen that through the technical solution provided by the embodiment of the present application, after receiving the first key sent by the target terminal, the server divides the first key, and converts each character after the division according to the first character conversion method and the second character conversion method, and finally determines the second key corresponding to the first key, and the second key is the key encrypted by the first key. Then, when the second key matches the target key of the target terminal stored in advance, it is determined that the key verification is successful. Thereby improving the security of the user account and reducing the possibility of the user key being cracked by brute force.

[0089] exist Figure 1 Based on the embodiment shown, S130, for any character among the multiple characters, the character is converted according to the first character conversion method to obtain a converted first character, and a second character is determined from the first character, such as Figure 2 As shown, the following steps may be included:

[0090] S131, for any character among the multiple characters, convert the character into an ASCII code to obtain a first character after conversion.

[0091] S132, determining a first prime number that is less than or equal to the character from the first character, and determining the first prime number as the second character.

[0092] Specifically, after receiving the first key sent by the target terminal, the server divides the first key according to the number of bits to obtain multiple characters. For each of the multiple characters, the character can be converted into an ASCII code to obtain the ASCII code corresponding to the first character, and the first prime number c less than or equal to the first character is found from the ASCII code corresponding to the first character, and the first prime number c of the first character is determined as the second character.

[0093] It can be seen that, through the technical solution provided by this embodiment, each of the multiple characters is converted into an ASCII code to obtain a converted first character; and the first prime number less than or equal to the character is determined from the first character to obtain the second character. This is a process of encrypting the first key, which helps to improve the security of the user account and reduce the possibility of the user key being cracked by brute force.

[0094] exist Figure 1 or Figure 2 Based on the illustrated embodiment, in one implementation manner, the key verification method may further include the following steps, namely step a1 and step a2:

[0095] Step a1: determining a second order of a plurality of second characters corresponding to the plurality of characters according to a first order of the plurality of characters in the first key.

[0096] Step a2: storing the second characters in the first array in order according to the second order of the second characters.

[0097] Specifically, the first key is divided to obtain a plurality of characters, and the plurality of characters are in order. For example, the first key is composed of 5 characters, namely the first character, the second character, the third character, the fourth character and the fifth character. Then, the second character corresponding to the first character, the second character corresponding to the second character, the second character corresponding to the third character, the second character corresponding to the fourth character and the second character corresponding to the fifth character can be stored in the first array in order.

[0098] It can be seen that by storing the plurality of second characters in the first array in order according to the second order of the plurality of second characters, it is advantageous to orderly convert the plurality of second characters according to the second character conversion method in the subsequent steps.

[0099] Based on the above embodiment, in one implementation, S140, the determined multiple second characters are respectively converted according to the second character conversion method to obtain multiple converted third characters, such as Figure 3 As shown, the following steps may be included:

[0100] S141, performing Euler function operations on the plurality of second characters in the first array respectively to obtain operation results corresponding to the plurality of second characters respectively.

[0101] Specifically, for the multiple second characters in the first array, the Euler function operation is performed on the multiple second characters in order. In number theory, for a positive integer n, the Euler function is the number of numbers that are relatively prime to n among the positive integers less than n.

[0102] For example, Φ(n) is the Euler function, Φ(1)=1, Φ(2)=1, Φ(3)=2, Φ(4)=2, Φ(4)=4, Φ(6)=2.

[0103] S142, determining the obtained multiple operation results as multiple converted third characters.

[0104] Specifically, after performing Euler function operations on the plurality of second characters respectively, operation results corresponding to the plurality of second characters are obtained, and the plurality of obtained operation results are determined as a plurality of converted third characters.

[0105] It can be seen that through the technical solution provided by this embodiment, by performing Euler function operations on multiple second characters to obtain the converted third character, which is also the process of encrypting the first key, it helps to improve the security of the user account and reduce the possibility of the user key being cracked by brute force.

[0106] exist Figure 3 Based on the illustrated embodiment, in one implementation manner, the key verification method may further include the following steps, namely step b1 and step b2:

[0107] Step b1, determining a third order of the plurality of converted third characters.

[0108] The third order of the converted third characters is the same as the second order of the corresponding second characters in the first array.

[0109] Specifically, since the second characters have an order in the first array, and each second character is subjected to the Euler function operation to obtain a third character, a plurality of converted third characters are obtained. The order of the third characters is the same as the order of the second characters in the first array.

[0110] Step b2, multiplying every two adjacent characters among the multiple converted third characters to obtain the multiplied characters.

[0111] Specifically, after obtaining multiple converted third characters, every two adjacent characters in the multiple converted third characters can be multiplied, for example, the first third character is multiplied by the second third character, the third third character is multiplied by the fourth third character, and so on. If the number of third characters is an odd number, the last third character is multiplied by the second to last third character.

[0112] It can be seen that by multiplying every two adjacent characters in the plurality of converted third characters to obtain the multiplied characters, it is helpful to generate the second key corresponding to the first key based on the multiplied characters.

[0113] Based on the above embodiments, in one implementation, Figure 4 As shown, S150, based on the converted third character, determining the second key corresponding to the first key may include the following steps:

[0114] S151, storing the multiplied characters in the second array in order according to the multiplication sequence.

[0115] Specifically, after obtaining the multiplied characters, the multiplied characters can be stored in the second array in order according to the multiplication sequence. For example, the first third character is multiplied by the second third character to obtain the first multiplied character; the third third character is multiplied by the fourth third character to obtain the second multiplied character; and so on... to obtain the Nth multiplied character.

[0116] The first multiplied character, the second multiplied character, ..., the Nth multiplied character are sequentially stored in the second array.

[0117] S152, concatenating the multiplied characters stored in the second array to obtain a concatenated character string.

[0118] S153: Determine the concatenated character string as the second key corresponding to the first key.

[0119] After obtaining the second array, the multiplied characters stored in the second array are concatenated to obtain a concatenated string. The concatenation can be performed in the order of the first multiplied character, the second multiplied character, ..., and the Nth multiplied character in the second array to obtain the concatenated string; and the concatenated string is determined as the second key corresponding to the first key.

[0120] It can be seen that through the technical solution provided by this embodiment, the multiplied characters are stored in the second array in order, the multiplied characters stored in the second array are concatenated to obtain a concatenated string, and the concatenated string is determined as the second key corresponding to the first key, and the second key is the key encrypted by the first key. In the subsequent steps, when the second key matches the target key of the pre-stored target terminal, it is determined that the key verification is successful, which helps to improve the security of the user account and reduce the possibility of the user key being cracked by brute force.

[0121] In order to describe the solution clearly, the complete technical solution of the embodiment of the present application will be explained in detail below with reference to specific examples.

[0122] like Figure 5 As shown, the technical solution provided in the embodiment of the present application may include the following steps:

[0123] S510, the server generates a target key using the key set by the terminal using the following algorithm, and stores the target key in a database.

[0124] The specific algorithm can be:

[0125] The key set by the terminal is split bit by bit, and each character obtained by the split is converted into ASCII code; for each character, the first prime number less than or equal to it is found from the character of the bit and stored in the array.

[0126] Calculate the Euler function value for each prime number in the array; multiply the first Euler function value by the second Euler function value, multiply the third Euler function value by the fourth Euler function value, ... If the length of the array is an odd number, multiply the last Euler function value by the second to last Euler function value, obtain the multiplication result, and store the multiplication result in a new array.

[0127] The multiplication results stored in the new array are concatenated into a string, which is the target key.

[0128] S520, the user inputs the key into the terminal, and the terminal sends the key to the server; the server divides the received key into bits, and converts each character obtained by the division into ASCII codes; for each character, find the first prime number less than or equal to it from the bit character, and store it in the array.

[0129] Here, the array may be X[n].

[0130] S530, the server calculates the Euler function value of each prime number in the array, multiplies two adjacent Euler function values, and stores the multiplication result in a new array.

[0131] Specifically, calculate the Euler function value of each prime number in the array; multiply the first Euler function value by the second Euler function value, multiply the third Euler function value by the fourth Euler function value, ... If the length of the array is an odd number, multiply the last Euler function value by the second to last Euler function value to obtain the multiplication result, and store the multiplication result in a new array.

[0132] For example, perform the Euler function operation on each number in X[n] to obtain the number y, and multiply y by 2 digits, for example, y[n*2]*y[n*2+1]. When n is an odd number, perform the operation y[n]*y[n-1] on the last digit. All multiplication results are stored in the new array Z[n] in sequence.

[0133] S540, concatenate the stored arrays into a string, and compare it with the target key stored in the database. If the string is consistent with the target key, it is determined that the key of the terminal is correct.

[0134] Specifically, the multiplication results stored in the array Z[n] are concatenated into a new string Str. If Str is consistent with the target key stored in the database, it is determined that the key of the terminal is correct.

[0135] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the present application.

[0136] In a second aspect, the present application embodiment provides a key verification device, such as Figure 6 As shown, the device comprises:

[0137] The key receiving module 610 is used to receive a first key sent by a target terminal;

[0138] A key splitting module 620, configured to split the first key into multiple characters;

[0139] A first conversion module 630 is used to convert any character among the multiple characters according to a first character conversion method to obtain a converted first character, and determine a second character from the first character;

[0140] A second conversion module 640 is used to perform character conversion on the determined plurality of second characters according to a second character conversion method to obtain a plurality of converted third characters;

[0141] A key determination module 650, configured to determine a second key corresponding to the first key based on the plurality of converted third characters;

[0142] The key verification module 660 is used to match the second key with the target key of the target terminal stored in advance, and determine that the key verification is successful when the second key matches the target key; wherein the target key is obtained by converting the key set by the target terminal, and the conversion method of the key set by the target terminal to the target key is the same as the conversion method of the first key to the second key.

[0143] The technical solution provided by the embodiment of the present application comprises the following steps: receiving a first key sent by a target terminal; dividing the first key to obtain a plurality of characters; for any character among the plurality of characters, converting the character according to a first character conversion method to obtain a converted first character, and determining a second character from the first character; performing character conversion on the determined plurality of second characters respectively according to a second character conversion method to obtain a plurality of converted third characters; determining a second key corresponding to the first key based on the plurality of converted third characters; matching the second key with a pre-stored target key of the target terminal, and determining that the key verification is successful when the second key matches the target key.

[0144] It can be seen that through the technical solution provided by the embodiment of the present application, after receiving the first key sent by the target terminal, the server divides the first key, and converts each character after the division according to the first character conversion method and the second character conversion method, and finally determines the second key corresponding to the first key, and the second key is the key encrypted by the first key. Then, when the second key matches the target key of the target terminal stored in advance, it is determined that the key verification is successful. Thereby improving the security of the user account and reducing the possibility of the user key being cracked by brute force.

[0145] Optionally, the first conversion module is specifically used to:

[0146] For any character among the multiple characters, convert the character into an ASCII code to obtain a first character after conversion;

[0147] A first prime number that is less than or equal to the character is determined from the first character, and the first prime number is determined as the second character.

[0148] Optionally, the device further comprises:

[0149] A first sequence determining module, used for determining a second sequence of a plurality of second characters corresponding to the plurality of characters according to the first sequence of the plurality of characters in the first key;

[0150] The first storage module is used to store the plurality of second characters in sequence in a first array according to a second order of the plurality of second characters.

[0151] Optionally, the second conversion module is specifically used to:

[0152] Performing Euler function operations on the plurality of second characters in the first array respectively to obtain operation results corresponding to the plurality of second characters respectively;

[0153] The obtained multiple operation results are determined as multiple converted third characters.

[0154] Optionally, also include:

[0155] A second sequence determination module is used to determine a third sequence of the plurality of converted third characters; the third sequence of the plurality of converted third characters is the same as the second sequence of the corresponding plurality of second characters in the first array;

[0156] The character multiplication module is used to multiply every two adjacent characters in the plurality of converted third characters to obtain a multiplied character.

[0157] Optionally, the key determination module is specifically used to:

[0158] According to the order of multiplication, the multiplied characters are stored in the second array in order;

[0159] Perform character concatenation on the multiplied characters stored in the second array to obtain a concatenated character string;

[0160] The concatenated character string is determined as a second key corresponding to the first key.

[0161] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0162] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the key verification method described in the first aspect when executing the program.

[0163] The technical solution provided by the embodiment of the present application comprises the following steps: receiving a first key sent by a target terminal; dividing the first key to obtain a plurality of characters; for any character among the plurality of characters, converting the character according to a first character conversion method to obtain a converted first character, and determining a second character from the first character; performing character conversion on the determined plurality of second characters respectively according to a second character conversion method to obtain a plurality of converted third characters; determining a second key corresponding to the first key based on the plurality of converted third characters; matching the second key with a pre-stored target key of the target terminal, and determining that the key verification is successful when the second key matches the target key.

[0164] It can be seen that through the technical solution provided by the embodiment of the present application, after receiving the first key sent by the target terminal, the server divides the first key, and converts each character after the division according to the first character conversion method and the second character conversion method, and finally determines the second key corresponding to the first key, and the second key is the key encrypted by the first key. Then, when the second key matches the target key of the target terminal stored in advance, it is determined that the key verification is successful. Thereby improving the security of the user account and reducing the possibility of the user key being cracked by brute force.

[0165] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the key verification method described in the first aspect are implemented.

[0166] The technical solution provided by the embodiment of the present application comprises the following steps: receiving a first key sent by a target terminal; dividing the first key to obtain a plurality of characters; for any character among the plurality of characters, converting the character according to a first character conversion method to obtain a converted first character, and determining a second character from the first character; performing character conversion on the determined plurality of second characters respectively according to a second character conversion method to obtain a plurality of converted third characters; determining a second key corresponding to the first key based on the plurality of converted third characters; matching the second key with a pre-stored target key of the target terminal, and determining that the key verification is successful when the second key matches the target key.

[0167] It can be seen that through the technical solution provided by the embodiment of the present application, after receiving the first key sent by the target terminal, the server divides the first key, and converts each character after the division according to the first character conversion method and the second character conversion method, and finally determines the second key corresponding to the first key, and the second key is the key encrypted by the first key. Then, when the second key matches the target key of the target terminal stored in advance, it is determined that the key verification is successful. Thereby improving the security of the user account and reducing the possibility of the user key being cracked by brute force.

[0168] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0169] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0170] The present application is described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0171] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0173] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0174] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0175] The key verification method, device, electronic device and storage medium provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A key verification method, characterized in that: The method comprises: Receiving a first key sent by a target terminal; Splitting the first key to obtain a plurality of characters; For any character among the plurality of characters, convert the character according to a first character conversion method to obtain a converted first character, and determine a second character from the first character; Performing character conversion on the determined plurality of second characters respectively according to the second character conversion mode to obtain a plurality of converted third characters; Determining a second key corresponding to the first key based on the plurality of converted third characters; The second key is matched with a target key of the target terminal stored in advance, and when the second key matches the target key, it is determined that the key verification is successful; wherein the target key is obtained by converting the key set by the target terminal, and the conversion method of the key set by the target terminal to the target key is the same as the conversion method of the first key to the second key.

2. The method according to claim 1, characterized in that The step of converting any character among the plurality of characters according to a first character conversion method to obtain a converted first character, and determining a second character from the first character includes: For any character among the multiple characters, convert the character into an ASCII code to obtain a first character after conversion; A first prime number that is less than or equal to the character is determined from the first character, and the first prime number is determined as the second character.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Determine a second order of a plurality of second characters corresponding to the plurality of characters according to the first order of the plurality of characters in the first key; According to the second order of the second characters, the second characters are sequentially stored in the first array.

4. The method according to claim 3, characterized in that The step of converting the determined plurality of second characters respectively according to the second character conversion mode to obtain a plurality of converted third characters includes: Performing Euler function operations on the plurality of second characters in the first array respectively to obtain operation results corresponding to the plurality of second characters respectively; The obtained multiple operation results are determined as multiple converted third characters.

5. The method according to claim 4, characterized in that Also includes: Determining a third order of the plurality of converted third characters; the third order of the plurality of converted third characters being the same as a second order of the corresponding plurality of second characters in the first array; Every two adjacent characters in the plurality of converted third characters are multiplied to obtain a multiplied character.

6. The method according to claim 5, characterized in that The determining, based on the converted third character, a second key corresponding to the first key includes: According to the order of multiplication, the multiplied characters are stored in the second array in order; Perform character concatenation on the multiplied characters stored in the second array to obtain a concatenated character string; The concatenated character string is determined as a second key corresponding to the first key.

7. A key verification device, characterized in that: The device comprises: A key receiving module, used for receiving a first key sent by a target terminal; A key segmentation module, used for segmenting the first key to obtain a plurality of characters; A first conversion module, configured to convert any character among the plurality of characters according to a first character conversion method to obtain a converted first character, and determine a second character from the first character; A second conversion module, used for performing character conversion on the determined plurality of second characters respectively according to a second character conversion mode to obtain a plurality of converted third characters; a key determination module, configured to determine a second key corresponding to the first key based on the plurality of converted third characters; A key verification module is used to match the second key with a target key of the target terminal stored in advance, and determine that the key verification is successful when the second key matches the target key; wherein the target key is obtained by converting the key set by the target terminal, and the conversion method of the key set by the target terminal to the target key is the same as the conversion method of the first key to the second key.

8. The device according to claim 7, characterized in that The first conversion module is specifically used to: For any character among the multiple characters, convert the character into an ASCII code to obtain a first character after conversion; A first prime number that is less than or equal to the character is determined from the first character, and the first prime number is determined as the second character.

9. The device according to claim 7 or 8, characterized in that The device also includes: A first sequence determining module, used for determining a second sequence of a plurality of second characters corresponding to the plurality of characters according to the first sequence of the plurality of characters in the first key; The first storage module is used to store the plurality of second characters in sequence in a first array according to a second order of the plurality of second characters.

10. The device according to claim 9, characterized in that The second conversion module is specifically used to: Performing Euler function operations on the plurality of second characters in the first array respectively to obtain operation results corresponding to the plurality of second characters respectively; The obtained multiple operation results are determined as multiple converted third characters.

11. The device according to claim 10, characterized in that Also includes: A second sequence determination module is used to determine a third sequence of the plurality of converted third characters; the third sequence of the plurality of converted third characters is the same as the second sequence of the corresponding plurality of second characters in the first array; The character multiplication module is used to multiply every two adjacent characters in the plurality of converted third characters to obtain a multiplied character.

12. The device according to claim 10, characterized in that The key determination module is specifically used to: According to the order of multiplication, the multiplied characters are stored in the second array in order; Perform character concatenation on the multiplied characters stored in the second array to obtain a concatenated character string; The concatenated character string is determined as a second key corresponding to the first key.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the key verification method according to any one of claims 1 to 6 are implemented.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the key verification method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Computer startup method based on RSA asymmetric encryption algorithm

    CN111414653A

  • Secret key storage method and reading method

    CN113704725A

  • KR20210123700A