Disclosure of Invention
The invention aims to provide a medical insurance financial user information encryption method and system based on big data, which are used for solving the problems in the prior art.
In a first aspect, an embodiment of the present invention provides a big data-based medical insurance financial user information encryption method, including:
obtaining user information, and storing the user information into a queue to obtain a user information queue;
obtaining a first user information block from a user information queue, wherein the length of the first user information block is one third of the length of the user information queue, and the first user information block comprises a plurality of pieces of user information;
obtaining a first key in a key queue;
encrypting the first user information block based on the first key to obtain a first ciphertext;
obtaining a second user information block from a user information queue, wherein the length of the second user information block is two thirds of the length of the user information queue, and the second user information block and the first user information block have the same user information;
obtaining a second key in the key queue;
encrypting a second user information block based on the second key to obtain a second ciphertext;
obtaining a third key in the key queue;
encrypting the user information queue based on the third key to obtain a third ciphertext;
encrypting the second ciphertext by taking the first ciphertext as a key to obtain a fourth ciphertext;
and encrypting the third ciphertext by taking the fourth ciphertext as a key to obtain a target ciphertext.
Optionally, the second user information block includes all user information in the first user information block.
Optionally, the obtaining user information and storing the user information in a queue to obtain a user information queue includes:
acquiring a user name and a user password of a user registration system;
and mixing, inserting and temporarily storing the user name and the user password into a queue to obtain a user information queue, wherein the user information queue comprises a plurality of user information, and the user information is the user name or the user password.
Optionally, the mixing, inserting, and temporarily storing the user name and the user password into a queue to obtain a user information queue includes:
converting the user name into a first character string and converting the user password into a second character string;
firstly, storing a first number of characters in a first character string into a queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string;
then storing a first number of characters in the updated first character string into the queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string;
and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
Optionally, the mixing, inserting, and temporarily storing the user name and the user password into a queue to obtain a user information queue includes:
converting the user name into a first character string and converting the user password into a second character string;
randomly obtaining characters in a first character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the first character string;
then randomly obtaining characters in a second character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the second character string;
and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
In a second aspect, an embodiment of the present invention provides a big data-based medical insurance financial user information encryption system, where the system includes:
the acquisition module is used for acquiring user information and storing the user information into a queue to obtain a user information queue;
the first encryption module is used for obtaining a first user information block from a user information queue, the length of the first user information block is one third of the length of the user information queue, and the first user information block comprises a plurality of user information; obtaining a first key in a key queue; encrypting the first user information block based on the first key to obtain a first ciphertext; obtaining a second user information block from a user information queue, wherein the length of the second user information block is two thirds of the length of the user information queue, and the second user information block and the first user information block have the same user information; obtaining a second key in the key queue; encrypting a second user information block based on the second key to obtain a second ciphertext; obtaining a third key in the key queue; encrypting the user information queue based on the third key to obtain a third ciphertext;
the second encryption module is used for encrypting the second ciphertext by taking the first ciphertext as a key to obtain a fourth ciphertext; and encrypting the third ciphertext by taking the fourth ciphertext as a key to obtain a target ciphertext.
Optionally, the second user information block includes all user information in the first user information block.
Optionally, the obtaining user information and storing the user information in a queue to obtain a user information queue includes:
acquiring a user name and a user password of a user registration system;
and mixing, inserting and temporarily storing the user name and the user password into a queue to obtain a user information queue, wherein the user information queue comprises a plurality of user information, and the user information is the user name or the user password.
Optionally, the mixing, inserting, and temporarily storing the user name and the user password into a queue to obtain a user information queue includes:
converting the user name into a first character string and converting the user password into a second character string;
firstly, storing a first number of characters in a first character string into a queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string;
then storing a first number of characters in the updated first character string into the queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string;
and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
Optionally, the mixing, inserting, and temporarily storing the user name and the user password into a queue to obtain a user information queue includes:
converting the user name into a first character string and converting the user password into a second character string;
randomly obtaining characters in a first character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the first character string;
then randomly obtaining characters in a second character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the second character string;
and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a medical insurance financial user information encryption method and system based on big data, which comprises the steps of obtaining user information, storing the user information into a queue and obtaining a user information queue; obtaining a first user information block from a user information queue, wherein the length of the first user information block is one third of the length of the user information queue, and the first user information block comprises a plurality of pieces of user information; obtaining a first key in a key queue; encrypting the first user information block based on the first key to obtain a first ciphertext; obtaining a second user information block from a user information queue, wherein the length of the second user information block is two thirds of the length of the user information queue, and the second user information block and the first user information block have the same user information; obtaining a second key in the key queue; encrypting a second user information block based on the second key to obtain a second ciphertext; obtaining a third key in the key queue; encrypting the user information queue based on the third key to obtain a third ciphertext; encrypting the second ciphertext by taking the first ciphertext as a key to obtain a fourth ciphertext; and encrypting the third ciphertext by taking the fourth ciphertext as a key to obtain a target ciphertext. The first number of characters in the first character string are stored in the queue, and then the second number of characters in the second character string are stored in the queue, so that the user name and the user password can be more easily recovered from the user information queue. The characters in the first character string are stored in the queue randomly, so that the encryption performance of user information encryption is improved, a target ciphertext is not easy to crack, and the safety of user information is improved.
Examples
The embodiment of the invention provides a medical insurance financial user information encryption method based on big data, and as shown in figure 1, the method comprises the following steps:
s101: and obtaining user information, and storing the user information into a queue to obtain a user information queue.
S102: and obtaining a first user information block from the user information queue, wherein the length of the first user information block is one third of the length of the user information queue, and the first user information block comprises a plurality of pieces of user information.
S103: a first key in a key queue is obtained.
S104: and encrypting the first user information block based on the first key to obtain a first ciphertext.
S105: and obtaining a second user information block from the user information queue, wherein the length of the second user information block is two thirds of the length of the user information queue, and the second user information block and the first user information block have the same user information.
S106: a second key in the key queue is obtained.
S107: and encrypting the second user information block based on the second key to obtain a second ciphertext.
S108: a third key in the key queue is obtained.
S109: and encrypting the user information queue based on the third key to obtain a third ciphertext.
S110: and encrypting the second ciphertext by taking the first ciphertext as a key to obtain a fourth ciphertext.
S111: and encrypting the third ciphertext by taking the fourth ciphertext as a key to obtain a target ciphertext.
As an optional implementation manner, diversification of encryption of the user information is enhanced by encrypting the user information (user information blocks) of different segments in the user information queue, and then encryption is performed based on the result of diversified encryption (the first ciphertext, the second ciphertext, and the third ciphertext), so that the encryption performance, the security, and the reliability of user information encryption are improved, and a target ciphertext obtained after encryption is not easy to crack. Meanwhile, the first ciphertext is used as a key to encrypt the second ciphertext to obtain a fourth ciphertext, the fourth ciphertext is used as a key to encrypt the third ciphertext to obtain a target ciphertext, the target ciphertext does not depend on a prepared key any more, the encryption performance is better, and the target ciphertext is not easy to crack. Meanwhile, the encryption mode of the scheme is simple and the calculated amount is small.
Optionally, as shown in fig. 2, the second user information block includes all the user information in the first user information block, that is, the first user information block and the second user information block are sub-queues in a user information queue. Therefore, the user information is encrypted based on the first user information block, the second user information block and the user information queue, the obtained target ciphertext is high in encryption, and meanwhile the fidelity of the target ciphertext is improved. For example, the user information queue is aabbbccddeefffgghhiijjkkkll, and the first user information block is: aabbbccdde, the second user information block is: aabbbccddeefgghh.
In this embodiment of the present invention, the obtaining user information and storing the user information in a queue to obtain a user information queue includes: acquiring a user name and a user password of a user registration system; and mixing, inserting and temporarily storing the user name and the user password into a queue to obtain a user information queue, wherein the user information queue comprises a plurality of user information, and the user information is the user name or the user password.
And mixing, inserting and temporarily storing the user name and the user password into the queue, wherein the user name and the user password in the user information contained in the obtained user information queue are scrambled, so that the encryption property of user information encryption is enhanced.
As an optional implementation manner, the mixing, inserting, and temporarily storing the user name and the user password into a queue to obtain a user information queue includes: converting the user name into a first character string and converting the user password into a second character string; firstly, storing a first number of characters in a first character string into a queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string; then storing a first number of characters in the updated first character string into the queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string; and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
Storing a first number of characters in a first character string into a queue, specifically: a first number of characters are randomly obtained from the first character string and stored in the queue, and the characters can be continuous or discontinuous and random. Similarly, storing a second number of characters in the second character string into the queue specifically includes: a second number of characters, which may be continuous or discontinuous and random, is randomly obtained from the second string and stored in the queue. The first number and the second number may be the same or different, the value of the first number may be a positive integer such as 1, 2, 3, 4, etc., and the value of the second number may be a positive integer such as 1, 2, 3, 4, etc.
As an example, the first string into which the username is converted is: and ABCDEFGHIJKL, wherein the second character string converted from the user password is ABCDEFGHIJKL, and one character is sequentially taken out from the first character string and the second character string respectively and is inserted into the queue, and the steps are repeated until the second character string and the second character string are empty. And when the advance of the first character string is empty, the rest characters in the second character string are sequentially stored in the queue. The resulting user information queue is aaabbcddeefffgghghhiijjkll.
As another optional implementation manner, the mixing, inserting, and temporarily storing the user name and the user password into a queue to obtain a user information queue includes: converting the user name into a first character string and converting the user password into a second character string; randomly obtaining characters in a first character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then randomly obtaining characters in a second character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the second character string; and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
The method comprises the following steps of firstly randomly obtaining characters in a first character string, and storing the characters into a queue, wherein the method specifically comprises the following steps: randomly obtaining a random number of characters from the first character string and storing the characters into a queue, wherein the characters can be continuous or discontinuous and random. If repeated for a plurality of times, the number of characters stored in the queue at each time can be the same or different, and the characters taken out at each time can be continuous or discontinuous and random.
According to the mode, the partial character strings of the user names and the partial character strings of the user passwords are continuously stored in the queue, and the obtained user information queue enables the characters of all the user names in the user information queue not to be arranged continuously and the characters of the user passwords not to be arranged continuously, so that the user names and the user passwords are not easy to decipher, and the encryption of the user information queue to the user information is improved. The first number of characters in the first character string are stored in the queue, and the second number of characters in the second character string are stored in the queue, so that the user name and the user password can be more easily recovered from the user information queue. The characters in the first character string are stored in the queue randomly, so that the encryption performance of user information encryption is improved.
In the embodiment of the present invention, the Encryption algorithm may adopt a Data Encryption Standard (DES). Encrypting the first user information block based on the first key to obtain a first ciphertext, which specifically comprises: and taking the first key as a key, the first user information block as a plaintext, the first user information block as an input of a DES encryption algorithm, and the output of the DES encryption algorithm as a first ciphertext. Encrypting a second user information block based on the second key to obtain a second ciphertext, which specifically comprises: and taking the second key as a key, the second user information block as a plaintext, the second user information block as an input of a DES encryption algorithm, and the output of the DES encryption algorithm as a second ciphertext. Encrypting the user information queue based on the third key to obtain a third ciphertext, which specifically comprises: and taking the third key as a key, the user information queue as a plaintext, the user information queue as an input of a DES encryption algorithm, and the output of the DES encryption algorithm as a third ciphertext.
And encrypting the second ciphertext by taking the first ciphertext as a key to obtain a fourth ciphertext, which specifically comprises: and taking the first ciphertext as a secret key, the second ciphertext as a plaintext, the DES encryption algorithm as an input, and the DES encryption algorithm as an output to serve as a fourth ciphertext. And encrypting the third ciphertext by taking the fourth ciphertext as a key to obtain a target ciphertext, wherein the target ciphertext is specifically as follows: and taking the fourth ciphertext as a secret key, taking the third ciphertext as a plaintext, taking the third ciphertext as the input of the DES encryption algorithm, and taking the output of the DES encryption algorithm as a target ciphertext. In this way, encryption of the user information is completed.
Optionally, the method further includes: acquiring a face image when a user registers a system, and establishing a corresponding relation between the face image and a user name and a user password; encrypting the face image to obtain encrypted image information; and specifically, the encrypted image information is used as the key, the target ciphertext is used as the plaintext and is used as the input of a DES (data encryption standard) encryption algorithm, and the final user information ciphertext of the DES encryption algorithm is used. Therefore, the reliability of user information encryption is improved.
The embodiment of the present application further correspondingly provides an executing subject for executing the above steps, and the executing subject may be the medical insurance financial user information encryption system 200 based on big data in fig. 3. Referring to fig. 3, the system includes:
an obtaining module 210, configured to obtain user information, store the user information in a queue, and obtain a user information queue;
the first encryption module 220 is configured to obtain a first user information block from a user information queue, where the length of the first user information block is one third of the length of the user information queue, and the first user information block includes a plurality of pieces of user information; obtaining a first key in a key queue; encrypting the first user information block based on the first key to obtain a first ciphertext; obtaining a second user information block from a user information queue, wherein the length of the second user information block is two thirds of the length of the user information queue, and the second user information block and the first user information block have the same user information; obtaining a second key in the key queue; encrypting a second user information block based on the second key to obtain a second ciphertext; obtaining a third key in the key queue; encrypting the user information queue based on the third key to obtain a third ciphertext;
the second encryption module 230 is configured to encrypt the second ciphertext with the first ciphertext as a key to obtain a fourth ciphertext; and encrypting the third ciphertext by taking the fourth ciphertext as a key to obtain a target ciphertext.
Optionally, the obtaining module 210 is further configured to obtain a user name and a user password of the user registration system;
and mixing, inserting and temporarily storing the user name and the user password into a queue to obtain a user information queue, wherein the user information queue comprises a plurality of user information, and the user information is the user name or the user password.
Optionally, the obtaining module 210 is further configured to: converting the user name into a first character string and converting the user password into a second character string;
firstly, storing a first number of characters in a first character string into a queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string;
then storing a first number of characters in the updated first character string into the queue, deleting the characters stored in the queue from the first character string, and updating the first character string; then storing a second number of characters in the second character string into the queue, deleting the characters stored in the queue from the second character string, and updating the second character string;
and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
Optionally, the obtaining module 210 is further configured to mix, insert, and temporarily store the user name and the user password in a queue to obtain a user information queue, where the obtaining module includes:
converting the user name into a first character string and converting the user password into a second character string;
randomly obtaining characters in a first character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the first character string;
then randomly obtaining characters in a second character string, storing the characters in a queue, deleting the characters stored in the queue from the first character string, and updating the second character string;
and if the updated first character string and the second character string are empty, taking the queue with the character strings as a user information queue, wherein each character string is user information.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.