A security authentication management method and system based on blockchain big data
Through blockchain big data and multiple encryption algorithms, the problems of account and password leakage and network path delay in traditional security authentication methods are solved, and higher security authentication reliability and timeliness are achieved.
Patent Information
- Application Number
- CN202411149367.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Traditional security authentication methods have risks of leakage, theft and tampering in account and password verification, and the timeliness of devices with long network paths are insufficient during security authentication, which affects the user experience.
Adopt a secure authentication management method based on blockchain big data, build a data set by obtaining authentication historical data, create an authentication behavior monitoring model, generate an encrypted password table and store it distributedly on the blockchain, establish a secure communication channel, and record and monitor it in real time. Authentication logs, using multiple encryption algorithms and blockchain to ensure data security and reliability.
It improves the reliability and timeliness of security authentication, prevents account and password leakage, shortens network paths, enhances the storage security of password tables, and improves user experience.
Smart Images

Figure CN118656853B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of security authentication technology, and in particular to a security authentication management method and system based on blockchain big data. Background Art
[0002] In order to ensure the security of user data, security authentication is required. For example, when a user needs to access a cloud disk to download backed-up data, security authentication is required.
[0003] However, most traditional security authentication methods only perform simple verification of the user's account and password, and the password table that stores the account and password is stored on the server, which has the following problems: 1. If the account and password are only verified and leaked, the security authentication will be meaningless; 2. No corresponding security measures are taken during the authentication process, and the transmission of the account and password can be easily stolen; 3. The password table stored on the server may also be tampered with; 4. Each time a security authentication is performed, it is necessary to access the same server to obtain the password table to match the account and password. For devices with long network paths, the timeliness of security authentication is poor, affecting the user experience.
[0004] Therefore, how to provide a security authentication management method and system based on blockchain big data to improve the reliability and timeliness of security authentication has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a security authentication management method and system based on blockchain big data, so as to improve the reliability and timeliness of security authentication.
[0006] In a first aspect, the present invention provides a security authentication management method based on blockchain big data, comprising the following steps:
[0007] Step S10, obtaining a large amount of authentication history data, constructing a data set after preprocessing each authentication history data, mining the user behavior characteristics of the data set through big data technology, and annotating the authentication history data in the data set based on the user behavior characteristics;
[0008] Step S20: creating an authentication behavior monitoring model based on a neural network, setting hyperparameters of the authentication behavior monitoring model, and training the authentication behavior monitoring model using the data set;
[0009] Step S30: obtaining the user's registration data, generating a password table based on the registration data, encrypting the password table into a ciphertext table, and distributively storing the ciphertext table in a blockchain;
[0010] Step S40: create a root private key and a root certificate carrying a root public key, create a first authentication private key, a first authentication public key, a first user private key and a first user public key based on the RSA algorithm, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate and the first authentication private key to the authentication end, and send the root certificate, the user work certificate and the first user private key to the user end;
[0011] Step S50: The authentication end and the user end establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key;
[0012] Step S60: The user terminal encrypts the account number and password into authentication data, generates an authentication request based on the authentication data, and sends the authentication request to the authentication terminal through a secure communication channel;
[0013] Step S70: After verifying the received authentication request, the authentication end decrypts the authentication data carried in the authentication request to obtain the account number and password, downloads the ciphertext table from the nearest node in the blockchain, decrypts the ciphertext table to obtain the password table, and verifies the account number and password based on the password table;
[0014] Step S80, recording the authentication log of the user terminal in real time, performing security monitoring on the authentication log through the authentication behavior monitoring model, and generating a security authentication result;
[0015] The step S10 is specifically as follows:
[0016] Obtain a large amount of authentication history data, which includes at least account number, authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region, and risk events;
[0017] Performing preprocessing on each of the authentication history data, including at least null value processing, data standardization processing, missing value processing, and abnormal value processing, and constructing a data set based on each of the authentication history data after preprocessing;
[0018] Classify and cluster the data set by big data technology to mine the user behavior characteristics of each account in the data set, and annotate each authentication history data in the data set based on the user behavior characteristics and risk events;
[0019] The step S20 is specifically as follows:
[0020] Creating an authentication behavior monitoring model based on a neural network, including an input module, a feature extraction module, a feature fusion module, and an output module, and setting the authentication behavior monitoring model to at least include hyperparameters of a learning rate, a batch size, an optimizer, a number of iterations, an activation function, a discard rate, and a loss function;
[0021] The input module is used for inputting a data set; the feature extraction module is used for extracting deep features and shallow features in the data set; the feature fusion module is used for fusing deep features and shallow features and outputting fused features; the output module is used for outputting risk identification results of authentication behaviors based on fused features;
[0022] Dividing the data set into a training set, a validation set, and a test set based on a ratio of 6:2:2, training the authentication behavior monitoring model through the training set, and continuously optimizing the hyperparameters during the training process until the number of training times reaches the number of iterations;
[0023] The trained authentication behavior monitoring model is verified using the verification set to determine whether the recognition accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then:
[0024] Using the test set to test the verified authentication behavior monitoring model, determine whether the confidence is greater than a preset confidence threshold, if not, expand the training set to continue training; if yes, end the training;
[0025] The step S30 is specifically as follows:
[0026] Obtaining registration data of each user, and generating a password table based on the account number and password carried in the registration data;
[0027] A hash calculation is performed on the password table to obtain a first hash value, the password table and the first hash value are encrypted by an AES algorithm to obtain primary encrypted data, each character of the primary encrypted data is mapped by a preset mapping rule to obtain secondary encrypted data, the secondary encrypted data is encrypted by a 3DES algorithm to obtain tertiary encrypted data, the tertiary encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block and the third encrypted data block are encrypted by an ElGamal algorithm to obtain a ciphertext table, and the ciphertext table is distributed and stored in a blockchain.
[0028] Furthermore, in step S40, the root private key and the root public key are a pair of paired keys; the first authentication private key and the first authentication public key are a pair of paired keys; the first user private key and the first user public key are a pair of paired keys;
[0029] The root private key is used to sign the first authentication public key and the first user public key; the root public key is used to verify the authentication work certificate and the user work certificate.
[0030] Furthermore, the step S50 specifically includes:
[0031] Step S51: The user terminal generates a first random number, obtains a current first timestamp, performs a hash calculation on the first random number, the first timestamp and the user's work certificate to obtain a second hash value, generates a first instruction carrying the first random number, the user's work certificate, the first timestamp and the second hash value, and sends it to the authentication terminal;
[0032] Step S52: After verifying the received first instruction, the authentication end extracts the first user public key from the user work certificate carried in the first instruction;
[0033] Step S53: the authentication end generates a second random number, obtains a current second timestamp, generates a second authentication private key and a second authentication public key based on the RSA algorithm, signs the first random number and the second authentication public key with the first authentication private key to obtain first signature data, generates a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, and sends the second instruction to the user end;
[0034] Step S54: After verifying the received second instruction, the user terminal extracts the first authentication public key from the authentication work certificate carried by the second instruction;
[0035] Step S55: The user terminal generates a second user private key and a second user public key based on the RSA algorithm, and obtains a current third timestamp; negotiates a first session key and calculates a first check value through the second user private key and the second authentication public key, signs the second random number, the second user public key and the first check value through the first user private key to obtain second signature data, generates a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and sends the third instruction to the authentication terminal;
[0036] Step S56: After verifying the received third instruction, the authenticating end negotiates a second session key through the second user public key and the second authentication private key carried in the third instruction, calculates a second check value of the second session key, obtains the current fourth timestamp, generates a fourth instruction carrying the second check value and the fourth timestamp, and sends it to the user end;
[0037] Step S57: After verifying the received fourth instruction, the user terminal establishes a secure communication channel between the user terminal and the authentication terminal.
[0038] Furthermore, the step S60 is specifically as follows:
[0039] The user end encrypts the account number and password by using the ECDSA algorithm to obtain a first encrypted string, shifts each character in the first encrypted string to the right based on a preset shift amount to obtain a second encrypted string, divides the second encrypted string based on a preset division ratio and swaps the order to obtain a third encrypted string, and encrypts the third encrypted string by using the RC2 algorithm to obtain authentication data;
[0040] Obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel.
[0041] Furthermore, the step S70 is specifically as follows:
[0042] The authentication end receives the authentication request, parses the authentication request to obtain authentication data, a fifth timestamp, and a MAC value, performs an integrity check through the MAC value, and then performs a timeliness check through the fifth timestamp;
[0043] Decrypting the authentication data using the RC2 algorithm to obtain a third encrypted string, dividing the third encrypted string based on the inverse of a preset division ratio and swapping the order of the characters to obtain a second encrypted string, shifting each character in the second encrypted string to the left based on a preset displacement to obtain a first encrypted string, and decrypting the first encrypted string using the ECDSA algorithm to obtain an account number and a password;
[0044] Downloading a ciphertext table from the nearest node in the blockchain based on the node proxy API, decrypting the ciphertext table to obtain a password table, performing a matching check on the account and password based on the password table, and if there is a matching account and password, proceeding to step S80; if there is no matching account and password, generating a security authentication result of authentication failure;
[0045] The step S80 is specifically as follows:
[0046] An authentication log is recorded in real time on the user side, which includes at least authentication frequency, dwell time, authentication time, IP address, MAC address, keyboard typing speed and input error rate. The authentication log is security-monitored through the authentication behavior monitoring model to generate a risk identification result. If the risk identification result is that the authentication behavior is safe, a security authentication result of successful authentication is generated; if the risk identification result is that the authentication behavior is unsafe, a security authentication result of failed authentication is generated.
[0047] In a second aspect, the present invention provides a security authentication management system based on blockchain big data, comprising the following modules:
[0048] A data set construction module is used to obtain a large amount of authentication history data, construct a data set after preprocessing each authentication history data, mine the user behavior characteristics of the data set through big data technology, and annotate the authentication history data in the data set based on the user behavior characteristics;
[0049] An authentication behavior monitoring model training module is used to create an authentication behavior monitoring model based on a neural network, set hyperparameters of the authentication behavior monitoring model, and train the authentication behavior monitoring model using the data set;
[0050] A password table encryption storage module, used to obtain the user's registration data, generate a password table based on the registration data, encrypt the password table into a ciphertext table, and store the ciphertext table in a distributed manner on the blockchain;
[0051] A key creation module, used to create a private key and a root certificate carrying a root public key, create a first authentication private key, a first authentication public key, a first user private key and a first user public key based on an RSA algorithm, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate and the first authentication private key to an authentication end, and send the root certificate, the user work certificate and the first user private key to a user end;
[0052] A secure communication channel establishment module, used for the authentication end and the user end to establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key;
[0053] An authentication request sending module is used for the user end to encrypt the account number and password into authentication data, generate an authentication request based on the authentication data, and send the authentication request to the authentication end through a secure communication channel;
[0054] An authentication request verification module, configured to, after the authentication end verifies the received authentication request, decrypt the authentication data carried in the authentication request to obtain the account number and password, download the ciphertext table from the nearest node in the blockchain, decrypt the ciphertext table to obtain the password table, and verify the account number and password based on the password table;
[0055] A security monitoring module is used to record the authentication log of the user end in real time, perform security monitoring on the authentication log through the authentication behavior monitoring model, and generate a security authentication result;
[0056] The data set construction module is specifically used for:
[0057] Obtain a large amount of authentication history data, which includes at least account number, authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region, and risk events;
[0058] Performing preprocessing on each of the authentication history data, including at least null value processing, data standardization processing, missing value processing, and abnormal value processing, and constructing a data set based on each of the authentication history data after preprocessing;
[0059] Classify and cluster the data set by big data technology to mine the user behavior characteristics of each account in the data set, and annotate each authentication history data in the data set based on the user behavior characteristics and risk events;
[0060] The authentication behavior monitoring model training module is specifically used for:
[0061] Creating an authentication behavior monitoring model based on a neural network, including an input module, a feature extraction module, a feature fusion module, and an output module, and setting the authentication behavior monitoring model to at least include hyperparameters of a learning rate, a batch size, an optimizer, a number of iterations, an activation function, a discard rate, and a loss function;
[0062] The input module is used for inputting a data set; the feature extraction module is used for extracting deep features and shallow features in the data set; the feature fusion module is used for fusing deep features and shallow features and outputting fused features; the output module is used for outputting risk identification results of authentication behaviors based on fused features;
[0063] Dividing the data set into a training set, a validation set, and a test set based on a ratio of 6:2:2, training the authentication behavior monitoring model through the training set, and continuously optimizing the hyperparameters during the training process until the number of training times reaches the number of iterations;
[0064] The trained authentication behavior monitoring model is verified using the verification set to determine whether the recognition accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then:
[0065] Using the test set to test the verified authentication behavior monitoring model, determine whether the confidence is greater than a preset confidence threshold, if not, expand the training set to continue training; if yes, end the training;
[0066] The password table encryption storage module is specifically used for:
[0067] Obtaining registration data of each user, and generating a password table based on the account number and password carried in the registration data;
[0068] A hash calculation is performed on the password table to obtain a first hash value, the password table and the first hash value are encrypted by an AES algorithm to obtain primary encrypted data, each character of the primary encrypted data is mapped by a preset mapping rule to obtain secondary encrypted data, the secondary encrypted data is encrypted by a 3DES algorithm to obtain tertiary encrypted data, the tertiary encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block and the third encrypted data block are encrypted by an ElGamal algorithm to obtain a ciphertext table, and the ciphertext table is distributed and stored in a blockchain.
[0069] Furthermore, in the key creation module, the root private key and the root public key are a pair of paired keys; the first authentication private key and the first authentication public key are a pair of paired keys; the first user private key and the first user public key are a pair of paired keys;
[0070] The root private key is used to sign the first authentication public key and the first user public key; the root public key is used to verify the authentication work certificate and the user work certificate.
[0071] Furthermore, the secure communication channel establishment module specifically includes:
[0072] A first instruction sending unit is used for the user end to generate a first random number, obtain a current first timestamp, perform a hash calculation on the first random number, the first timestamp and the user work certificate to obtain a second hash value, and generate a first instruction carrying the first random number, the user work certificate, the first timestamp and the second hash value and send it to the authentication end;
[0073] A first user public key extraction unit, configured to extract the first user public key from the user work certificate carried in the first instruction after the authentication end verifies the received first instruction;
[0074] A second instruction sending unit is used for the authentication end to generate a second random number, obtain a current second timestamp, generate a second authentication private key and a second authentication public key based on the RSA algorithm, sign the first random number and the second authentication public key with the first authentication private key to obtain first signature data, generate a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, and send the second instruction to the user end;
[0075] A first authentication public key extraction unit, configured to extract a first authentication public key from an authentication work certificate carried by the second instruction after the user terminal verifies the received second instruction;
[0076] A third instruction sending unit is used for the user end to generate a second user private key and a second user public key based on the RSA algorithm, and obtain a current third timestamp; negotiate the first session key and calculate the first check value through the second user private key and the second authentication public key, sign the second random number, the second user public key and the first check value through the first user private key to obtain second signature data, generate a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and send the third instruction to the authentication end;
[0077] A fourth instruction sending unit is used for, after the authentication end verifies the received third instruction, to negotiate a second session key through the second user public key and the second authentication private key carried in the third instruction, to calculate a second check value of the second session key, to obtain a current fourth timestamp, to generate a fourth instruction carrying the second check value and the fourth timestamp, and to send the fourth instruction to the user end;
[0078] The fourth instruction verification unit is used to establish a secure communication channel between the user terminal and the authentication terminal after the user terminal verifies the received fourth instruction.
[0079] Furthermore, the authentication request sending module is specifically used for:
[0080] The user end encrypts the account number and password by using the ECDSA algorithm to obtain a first encrypted string, shifts each character in the first encrypted string to the right based on a preset shift amount to obtain a second encrypted string, divides the second encrypted string based on a preset division ratio and swaps the order to obtain a third encrypted string, and encrypts the third encrypted string by using the RC2 algorithm to obtain authentication data;
[0081] Obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel.
[0082] Furthermore, the authentication request verification module is specifically used to:
[0083] The authentication end receives the authentication request, parses the authentication request to obtain authentication data, a fifth timestamp, and a MAC value, performs an integrity check through the MAC value, and then performs a timeliness check through the fifth timestamp;
[0084] Decrypting the authentication data using the RC2 algorithm to obtain a third encrypted string, dividing the third encrypted string based on the inverse of a preset division ratio and swapping the order of the characters to obtain a second encrypted string, shifting each character in the second encrypted string to the left based on a preset displacement to obtain a first encrypted string, and decrypting the first encrypted string using the ECDSA algorithm to obtain an account number and a password;
[0085] Download the ciphertext table from the nearest node in the blockchain based on the node agent API, decrypt the ciphertext table to obtain the password table, perform matching verification on the account and password based on the password table, and enter the security monitoring module if there is a matching account and password; if there is no matching account and password, generate a security authentication result of authentication failure;
[0086] The security monitoring module is specifically used for:
[0087] An authentication log is recorded in real time on the user side, which includes at least authentication frequency, dwell time, authentication time, IP address, MAC address, keyboard typing speed and input error rate. The authentication log is security-monitored through the authentication behavior monitoring model to generate a risk identification result. If the risk identification result is that the authentication behavior is safe, a security authentication result of successful authentication is generated; if the risk identification result is that the authentication behavior is unsafe, a security authentication result of failed authentication is generated.
[0088] The advantages of the present invention are:
[0089] 1. A data set is constructed by obtaining a large amount of authentication history data for preprocessing, and the user behavior characteristics of the data set are mined through big data technology. The authentication history data in the data set are labeled based on the user behavior characteristics; then an authentication behavior monitoring model is created based on a neural network, the hyperparameters of the authentication behavior monitoring model are set, and the authentication behavior monitoring model is trained through the data set; then the user's registration data is obtained to generate a password table, and the password table is encrypted into a ciphertext table and distributedly stored in the blockchain; then a root private key and a root certificate carrying a root public key are created, a first authentication private key, a first authentication public key, a first user private key and a first user public key are created, the first authentication public key is signed by the root private key to obtain an authentication work certificate, the first user public key is signed by the root private key to obtain a user work certificate, the root certificate, the authentication work certificate and the first authentication private key are sent to the authentication end, the root certificate, the user work certificate and the first user private key are sent to the user end, and the authentication end and the user end establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key; the user end The account number and password are encrypted into authentication data, an authentication request is generated based on the authentication data and sent to the authentication end through a secure communication channel. After the authentication end verifies the authentication request, the authentication data carried in the authentication request is decrypted to obtain the account number and password, the ciphertext table is downloaded from the nearest node in the blockchain, the ciphertext table is decrypted to obtain the password table, the account number and password are verified based on the password table, and the authentication log of the user end is recorded in real time. The authentication log is securely monitored through the authentication behavior monitoring model to generate a security authentication result; that is, the authentication log generated during the authentication process is analyzed through the authentication behavior monitoring model to identify authentication behaviors with security risks. When the account number and password are leaked, if the authentication behavior is abnormal, the security authentication cannot be completed; by encrypting the password table into a ciphertext table and distributing the ciphertext table to the blockchain, the password table is prevented from being stolen and tampered with in plain text, thereby preventing illegal users from passing the security authentication; by downloading the ciphertext table from the nearest node in the blockchain for decryption, the network path is effectively shortened, and combined with the secure communication channel established between the authentication end and the user end, the reliability and timeliness of the security authentication are ultimately greatly improved.
[0090] 2. By obtaining authentication history data including at least account number, authentication frequency, stay time, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region and risk events, user behavior characteristics are mined, which effectively enhances the dimension of user behavior monitoring. Combined with preprocessing including at least null value processing, data standardization processing, missing value processing and outlier processing, the quality of the data set is effectively improved. The authentication behavior monitoring model is then trained with the labeled data set, thereby effectively improving the recognition accuracy of the authentication behavior monitoring model.
[0091] 3. By dividing the data set into training set, validation set and test set, the authentication behavior monitoring model is trained with the training set, and the hyperparameters are continuously optimized during the training process. The trained authentication behavior monitoring model is verified with the validation set, and the verified authentication behavior monitoring model is tested with the test set. The training is terminated only when the verification and test are passed, which further improves the recognition accuracy of the authentication behavior monitoring model.
[0092] 4. Obtain a first hash value by performing hash calculation on the password table, encrypt the password table and the first hash value by using the AES algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data by using the mapping rule to obtain second-level encrypted data, encrypt the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divide the third-level encrypted data into a first data block, a second data block, and a third data block, encrypt the first data block by using the BLOWFISH algorithm to obtain a first encrypted data block, encrypt the second data block by using the RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using the IDEA algorithm to obtain a third encrypted data block, and The amal algorithm encrypts the first encrypted data block, the second encrypted data block and the third encrypted data block to obtain a ciphertext table, and stores the ciphertext table in a distributed manner on the blockchain; since hash calculation is irreversible, the integrity check can be performed through the first hash value later. If the corresponding encryption algorithm and data transformation rules are not known, the ciphertext table cannot be cracked. It also combines data block encryption and adopts different encryption algorithms. At least ten security measures are taken before and after (hash calculation, AES algorithm, mapping rules, 3DES algorithm, data block, BLOWFISH algorithm, RSA algorithm, IDEA algorithm, ElGamal algorithm, blockchain), which greatly improves the security of password table storage.
[0093] 5. Create a root private key, a root certificate carrying a root public key, a first authentication private key, a first authentication public key, a first user private key, and a first user public key, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate, and the first authentication private key to the authentication end, and send the root certificate, the user work certificate, and the first user private key to the user end; the user end generates a first random number, obtains the current first timestamp, performs a hash calculation on the first random number, the first timestamp, and the user work certificate to obtain a second hash value, and generates a first random number carrying the first random number, the user work certificate, the first timestamp, and the second hash value. The first instruction is sent to the authentication end; after the authentication end verifies the first instruction, the first user public key is extracted from the user work certificate carried by the first instruction; a second random number is generated, the current second timestamp is obtained, a second authentication private key and a second authentication public key are generated, the first random number and the second authentication public key are signed by the first authentication private key to obtain the first signature data, a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp is generated and sent to the user end; after the user end verifies the second instruction, the first authentication public key is extracted from the authentication work certificate carried by the second instruction, the second user private key and the second user public key are generated, the current third timestamp is obtained, and the second user private key and the first timestamp are signed by the second user private key and the second timestamp are obtained. The second authentication public key is used to negotiate the first session key and calculate the first check value, and the second random number, the second user public key and the first check value are signed by the first user private key to obtain the second signature data, and a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp is generated and sent to the authentication end; after the authentication end verifies the third instruction, the second session key is negotiated by the second user public key and the second authentication private key carried in the third instruction, the second check value of the second session key is calculated, the current fourth timestamp is obtained, and a fourth instruction carrying the second check value and the fourth timestamp is generated and sent to the user end; after the user end verifies the fourth instruction, a secure communication channel is established; that is, based on the root certificate, the authentication work certificate The authentication end and the user end use a pair of random numbers to perform two-way authentication on the communication between the authentication end and the user end. The authentication end adopts at least three security measures (user work certificate verification, second signature data verification, second check value comparison), and the user end adopts at least three security measures (authentication work certificate verification, first signature data verification, first check value comparison). The first signature data, the second signature data, the first check value, and the second check value are all generated based on multiple keys, which increases the difficulty of cracking. Ultimately, the security of communication between the user end and the authentication end is greatly improved, and the reliability of security authentication is greatly improved.
[0094] 6. The user terminal generates a first random number and the authentication terminal generates a second random number for two-way authentication, which can effectively prevent replay attacks. The timestamps carried by the first instruction, the second instruction, the third instruction, and the fourth instruction are combined to perform time verification to prevent replay attacks. At the same time, it also increases the difficulty of attacks and further improves the security of communication between the user terminal and the authentication terminal.
[0095] 7. Encrypt the account and password through the ECDSA algorithm to obtain a first encrypted string, shift each character in the first encrypted string to the right based on a preset displacement to obtain a second encrypted string, split the second encrypted string based on a preset segmentation ratio and swap the order to obtain a third encrypted string, encrypt the third encrypted string through the RC2 algorithm to obtain authentication data; obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel; subsequently, the fifth timestamp can be used for time verification, and the MAC calculation is based on a hash function carrying a secret key, which is more secure than ordinary hash calculation. If the corresponding encryption algorithm and data transformation rules are not known, the authentication data cannot be cracked. At least eight security measures (ECDSA algorithm, displacement, displacement direction, segmentation ratio, RC2 algorithm, fifth timestamp, MAC calculation, secure communication channel) are taken before and after to prevent the account and password from being stolen and tampered with during transmission, which greatly improves the security of account and password transmission.
[0096] 8. By recording the user's authentication log in real time, including at least authentication frequency, stay time, authentication time, IP address, MAC address, keyboard typing speed and input error rate, and inputting the authentication log into the pre-trained authentication behavior monitoring model, the authentication behavior can be effectively identified, and it can be determined whether there is a risk in the authentication behavior. Based on the risk identification results, it is decided whether the security authentication is passed. That is, after the account and password verification is passed, the risk identification of the authentication behavior is added, which greatly improves the reliability of the security authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0098] Figure 1 It is a flow chart of a security authentication management method based on blockchain big data of the present invention.
[0099] Figure 2 It is a structural schematic diagram of a security authentication management system based on blockchain big data in the present invention. DETAILED DESCRIPTION
[0100] The technical solution in the embodiment of the present application has the following overall idea: the authentication log generated during the authentication process is analyzed through an authentication behavior monitoring model to identify authentication behaviors with security risks. When the account and password are leaked, if the authentication behavior is abnormal, the security authentication cannot be completed; by encrypting the password table into a ciphertext table and storing the ciphertext table in a distributed manner on the blockchain, the password table is prevented from being stolen and tampered with in plain text, thereby preventing illegal users from passing the security authentication; by downloading the ciphertext table from the nearest node in the blockchain for decryption, the network path is effectively shortened, and combined with the secure communication channel established between the authentication end and the user end, the reliability and timeliness of the security authentication are ultimately greatly improved.
[0101] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a security authentication management method based on blockchain big data of the present invention comprises the following steps:
[0102] Step S10, obtaining a large amount of authentication history data, constructing a data set after preprocessing each authentication history data, mining the user behavior characteristics of the data set through big data technology, and annotating the authentication history data in the data set based on the user behavior characteristics;
[0103] Step S20: creating an authentication behavior monitoring model based on a neural network, setting hyperparameters of the authentication behavior monitoring model, and training the authentication behavior monitoring model using the data set;
[0104] Step S30: Obtain the user's registration data, generate a password table based on the registration data, encrypt the password table into a ciphertext table, and store the ciphertext table in a distributed manner in the blockchain; decentralized distributed storage through the blockchain can not only improve the security of storage, but also select the nearest node to download the ciphertext table as needed, so as to shorten the network path and improve the timeliness of security authentication; due to Moore's Law, the performance of processors is now very powerful, and even in the face of complex encryption schemes, calculations can be completed instantly. Compared with the network delay, the calculation time of the processor is negligible;
[0105] Step S40: create a root private key and a root certificate carrying a root public key, create a first authentication private key, a first authentication public key, a first user private key and a first user public key based on the RSA algorithm, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate and the first authentication private key to the authentication end, and send the root certificate, the user work certificate and the first user private key to the user end;
[0106] Step S50: The authentication end and the user end establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key;
[0107] Step S60: The user terminal encrypts the account number and password into authentication data, generates an authentication request based on the authentication data, and sends the authentication request to the authentication terminal through a secure communication channel;
[0108] Step S70: After verifying the received authentication request, the authentication end decrypts the authentication data carried in the authentication request to obtain the account number and password, downloads the ciphertext table from the nearest node in the blockchain, decrypts the ciphertext table to obtain the password table, and verifies the account number and password based on the password table;
[0109] Step S80, recording the authentication log of the user terminal in real time, performing security monitoring on the authentication log through the authentication behavior monitoring model, and generating a security authentication result;
[0110] The step S10 is specifically as follows:
[0111] Obtain a large amount of authentication history data, which includes at least account number, authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region, and risk events;
[0112] Performing preprocessing on each of the authentication history data, including at least null value processing, data standardization processing, missing value processing, and abnormal value processing, and constructing a data set based on each of the authentication history data after preprocessing;
[0113] Classify and cluster the data set by big data technology to mine the user behavior characteristics of each account in the data set, and annotate each authentication history data in the data set based on the user behavior characteristics and risk events;
[0114] By acquiring authentication history data including at least account number, authentication frequency, length of stay, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region and risk events, user behavior characteristics are mined, which effectively enhances the dimension of user behavior monitoring. Combined with preprocessing including at least null value processing, data standardization processing, missing value processing and outlier processing, the quality of the data set is effectively improved. The authentication behavior monitoring model is then trained with the labeled data set, thereby effectively improving the recognition accuracy of the authentication behavior monitoring model.
[0115] The step S20 is specifically as follows:
[0116] Creating an authentication behavior monitoring model based on a neural network, including an input module, a feature extraction module, a feature fusion module, and an output module, and setting the authentication behavior monitoring model to at least include hyperparameters of a learning rate, a batch size, an optimizer, a number of iterations, an activation function, a discard rate, and a loss function;
[0117] The input module is used for inputting a data set; the feature extraction module is used for extracting deep features and shallow features in the data set; the feature fusion module is used for fusing deep features and shallow features and outputting fused features; the output module is used for outputting risk identification results of authentication behaviors based on fused features;
[0118] Dividing the data set into a training set, a validation set, and a test set based on a ratio of 6:2:2, training the authentication behavior monitoring model through the training set, and continuously optimizing the hyperparameters during the training process until the number of training times reaches the number of iterations;
[0119] The trained authentication behavior monitoring model is verified using the verification set to determine whether the recognition accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then:
[0120] Using the test set to test the verified authentication behavior monitoring model, determine whether the confidence is greater than a preset confidence threshold, if not, expand the training set to continue training; if yes, end the training;
[0121] By dividing the data set into training set, validation set and test set, the authentication behavior monitoring model is trained with the training set, and the hyperparameters are continuously optimized during the training process. The trained authentication behavior monitoring model is verified with the validation set, and the verified authentication behavior monitoring model is tested with the test set. The training is terminated only when the verification and test are passed, which further improves the recognition accuracy of the authentication behavior monitoring model.
[0122] The step S30 is specifically as follows:
[0123] Obtaining registration data of each user, and generating a password table based on the account number and password carried in the registration data;
[0124] A hash calculation is performed on the password table to obtain a first hash value, the password table and the first hash value are encrypted by an AES algorithm to obtain primary encrypted data, each character of the primary encrypted data is mapped by a preset mapping rule to obtain secondary encrypted data, the secondary encrypted data is encrypted by a 3DES algorithm to obtain tertiary encrypted data, the tertiary encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block and the third encrypted data block are encrypted by an ElGamal algorithm to obtain a ciphertext table, and the ciphertext table is distributed and stored in a blockchain.
[0125] A first hash value is obtained by performing hash calculation on the password table, the password table and the first hash value are encrypted by using the AES algorithm to obtain first-level encrypted data, each character of the first-level encrypted data is mapped by a mapping rule to obtain second-level encrypted data, the second-level encrypted data is encrypted by using the 3DES algorithm to obtain third-level encrypted data, the third-level encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by using the BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by using the RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by using the IDEA algorithm to obtain a third encrypted data block, and the third encrypted data block is encrypted by using the ElGa The mal algorithm encrypts the first encrypted data block, the second encrypted data block and the third encrypted data block to obtain a ciphertext table, and stores the ciphertext table in a distributed manner on the blockchain; since the hash calculation is irreversible, the integrity check can be performed through the first hash value later. If the corresponding encryption algorithm and data transformation rules are not known, the ciphertext table cannot be cracked. It also combines data block encryption and adopts different encryption algorithms. At least ten security measures are taken before and after (hash calculation, AES algorithm, mapping rules, 3DES algorithm, data block, BLOWFISH algorithm, RSA algorithm, IDEA algorithm, ElGamal algorithm, blockchain), which greatly improves the security of password table storage.
[0126] In the step S40, the root private key and the root public key are a pair of paired keys; the first authentication private key and the first authentication public key are a pair of paired keys; the first user private key and the first user public key are a pair of paired keys;
[0127] The root private key is used to sign the first authentication public key and the first user public key; the root public key is used to verify the authentication work certificate and the user work certificate.
[0128] The step S50 specifically includes:
[0129] Step S51: The user terminal generates a first random number, obtains a current first timestamp, performs a hash calculation on the first random number, the first timestamp and the user's work certificate to obtain a second hash value, generates a first instruction carrying the first random number, the user's work certificate, the first timestamp and the second hash value, and sends it to the authentication terminal;
[0130] Step S52: After verifying the received first instruction, the authentication end extracts the first user public key from the user work certificate carried in the first instruction;
[0131] The step S52 is specifically as follows:
[0132] The authentication end receives the first instruction in real time, parses the first instruction to obtain a first random number, a user work certificate, a first timestamp and a second hash value, performs an integrity check through the second hash value, and then performs a timeliness check through the first timestamp, then extracts the root public key from the root certificate, verifies the user work certificate through the root public key, and then extracts the first user public key from the public key modulus field of the user work certificate.
[0133] Step S53: the authentication end generates a second random number, obtains a current second timestamp, generates a second authentication private key and a second authentication public key based on the RSA algorithm, signs the first random number and the second authentication public key with the first authentication private key to obtain first signature data, generates a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, and sends the second instruction to the user end;
[0134] Step S54: After verifying the received second instruction, the user terminal extracts the first authentication public key from the authentication work certificate carried by the second instruction;
[0135] The step S54 is specifically as follows:
[0136] The user end receives the second instruction in real time, parses the second instruction to obtain the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, verifies the validity of the second instruction through the second timestamp, extracts the root public key from the root certificate, verifies the authentication work certificate through the root public key, and then extracts the first authentication public key from the public key modulus field of the authentication work certificate.
[0137] Step S55: The user terminal generates a second user private key and a second user public key based on the RSA algorithm, and obtains a current third timestamp; negotiates a first session key and calculates a first check value through the second user private key and the second authentication public key, signs the second random number, the second user public key and the first check value through the first user private key to obtain second signature data, generates a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and sends the third instruction to the authentication terminal;
[0138] The negotiation of the first session key and calculation of the first check value by using the second user private key and the second authentication public key is specifically as follows:
[0139] Perform ECDH calculation on the second user private key and the second authentication public key, then perform sha256 calculation and then cut off the preset length to generate a first session key, use the first session key to encrypt 9 bytes of 0, and take the first 6 bytes as the first check value;
[0140] Step S56: After verifying the received third instruction, the authenticating end negotiates a second session key through the second user public key and the second authentication private key carried in the third instruction, calculates a second check value of the second session key, obtains the current fourth timestamp, generates a fourth instruction carrying the second check value and the fourth timestamp, and sends it to the user end;
[0141] The step S56 is specifically as follows:
[0142] The authentication end receives the third instruction in real time, parses the third instruction to obtain second signature data, a second user public key, a first check value and a third timestamp, first performs a time validity check on the third instruction using the third timestamp, then verifies the second signature data using the first user public key, then negotiates a second session key using the second user public key and a second authentication private key, calculates a second check value for the second session key, generates a fourth instruction carrying the second check value and a fourth timestamp, and sends the fourth instruction to the user end in real time.
[0143] The second session key is negotiated by using the second user public key and the second authentication private key, and the second check value of the second session key is calculated as follows:
[0144] Perform ECDH calculation on the second user public key and the second authentication private key, then perform sha256 calculation and then cut off the preset length to generate a second session key, use the second session key to encrypt 9 bytes of 0, and take the first 6 bytes as the second check value;
[0145] Step S57: After verifying the received fourth instruction, the user terminal establishes a secure communication channel between the user terminal and the authentication terminal.
[0146] The step S57 is specifically as follows:
[0147] The user end receives the fourth instruction in real time, parses the fourth instruction to obtain the second verification value and the fourth timestamp, and after performing time verification on the fourth instruction through the fourth timestamp, determines whether the first verification value is consistent with the second verification value. If not, terminates the process; if so, establishes a secure communication channel between the user end and the authentication end.
[0148] Since the first session key is generated through negotiation between the second user private key and the second authentication public key, and the second session key is generated through negotiation between the second user public key and the second authentication private key, the first session key and the second session key are the same pair of keys. In theory, the first verification value calculated based on the first session key needs to be equal to the second verification value calculated based on the second session key; that is, verifying the first verification value through the second verification value is to compare whether the values of the second verification value are equal to the first verification value.
[0149] By creating a root private key, a root certificate carrying a root public key, a first authentication private key, a first authentication public key, a first user private key, and a first user public key, signing the first authentication public key with the root private key to obtain an authentication work certificate, signing the first user public key with the root private key to obtain a user work certificate, sending the root certificate, the authentication work certificate, and the first authentication private key to the authentication end, and sending the root certificate, the user work certificate, and the first user private key to the user end; the user end generates a first random number, obtains the current first timestamp, performs a hash calculation on the first random number, the first timestamp, and the user work certificate to obtain a second hash value, and generates a first instruction carrying the first random number, the user work certificate, the first timestamp, and the second hash value The authentication end verifies the first instruction and extracts the first user public key from the user work certificate carried by the first instruction; generates a second random number, obtains the current second timestamp, generates a second authentication private key and a second authentication public key, signs the first random number and the second authentication public key with the first authentication private key to obtain the first signature data, generates a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp and sends it to the user end; the user end verifies the second instruction and extracts the first authentication public key from the authentication work certificate carried by the second instruction, generates a second user private key and a second user public key, obtains the current third timestamp, and signs the first random number and the second authentication public key with the first authentication private key to obtain the first signature data, generates a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp and sends it to the user end; The authentication public key negotiates the first session key and calculates the first check value, signs the second random number, the second user public key and the first check value through the first user private key to obtain the second signature data, generates a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and sends it to the authentication end; after the authentication end verifies the third instruction, it negotiates the second session key through the second user public key and the second authentication private key carried in the third instruction, calculates the second check value of the second session key, obtains the current fourth timestamp, generates a fourth instruction carrying the second check value and the fourth timestamp, and sends it to the user end; after the user end verifies the fourth instruction, it establishes a secure communication channel; that is, based on the root certificate and the authentication work certificate , user work certificate, second authentication private key, second authentication public key, second user private key, second user public key, first random number, second random number, perform two-way authentication on the communication between the authentication end and the user end, the authentication end takes at least three security measures (user work certificate verification, second signature data verification, second check value comparison), the user end takes at least three security measures (authentication work certificate verification, first signature data verification, first check value comparison), and the first signature data, the second signature data, the first check value, and the second check value are all generated based on multiple keys, which increases the difficulty of cracking, and ultimately greatly improves the security of communication between the user end and the authentication end, thereby greatly improving the reliability of security authentication.
[0150] By generating a first random number on the user side and a second random number on the authentication side for two-way authentication, replay attacks can be effectively prevented. The timestamps carried by the first, second, third, and fourth instructions are combined for time validity verification to prevent replay attacks. This also increases the difficulty of attacks and further improves the security of communication between the user side and the authentication side.
[0151] The step S60 is specifically as follows:
[0152] The user end encrypts the account number and password by using the ECDSA algorithm to obtain a first encrypted string, shifts each character in the first encrypted string to the right based on a preset shift amount to obtain a second encrypted string, divides the second encrypted string based on a preset division ratio and swaps the order to obtain a third encrypted string, and encrypts the third encrypted string by using the RC2 algorithm to obtain authentication data;
[0153] Obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel.
[0154] The account number and password are encrypted by the ECDSA algorithm to obtain a first encrypted string, each character in the first encrypted string is shifted to the right based on a preset displacement to obtain a second encrypted string, the second encrypted string is divided based on a preset segmentation ratio and the order is swapped to obtain a third encrypted string, and the third encrypted string is encrypted by the RC2 algorithm to obtain authentication data; the current fifth timestamp is obtained, MAC calculation is performed on the authentication data and the fifth timestamp to obtain a MAC value, an authentication request is generated based on the authentication data, the fifth timestamp and the MAC value, and the authentication request is sent to the authentication end through a secure communication channel; the fifth timestamp can be used for time verification later, and the MAC calculation is based on a hash function carrying a secret key, which is more secure than ordinary hash calculation. If the corresponding encryption algorithm and data transformation rules are not known, the authentication data cannot be cracked. At least eight security measures (ECDSA algorithm, displacement, displacement direction, segmentation ratio, RC2 algorithm, fifth timestamp, MAC calculation, secure communication channel) are taken before and after to prevent the account number and password from being stolen and tampered with during transmission, which greatly improves the security of account number and password transmission.
[0155] The step S70 is specifically as follows:
[0156] The authentication end receives the authentication request, parses the authentication request to obtain authentication data, a fifth timestamp, and a MAC value, performs an integrity check through the MAC value, and then performs a timeliness check through the fifth timestamp;
[0157] Decrypting the authentication data using the RC2 algorithm to obtain a third encrypted string, dividing the third encrypted string based on the inverse of a preset division ratio and swapping the order of the characters to obtain a second encrypted string, shifting each character in the second encrypted string to the left based on a preset displacement to obtain a first encrypted string, and decrypting the first encrypted string using the ECDSA algorithm to obtain an account number and a password;
[0158] Based on the node proxy API, a ciphertext table is downloaded from the nearest node in the blockchain, the ciphertext table is decrypted to obtain a password table, and the account and password are matched and verified based on the password table. If there is a matching account and password, step S80 is entered; if there is no matching account and password, a security authentication result of authentication failure is generated; the node proxy API (such as Geth / Parity Proxy) provides functions such as obtaining the latest block number, block information, and transaction information in the blockchain to help users directly obtain the required blockchain data from the nearest node;
[0159] Decrypting the ciphertext table is specifically as follows:
[0160] The ciphertext table is decrypted by the ElGamal algorithm to obtain a first encrypted data block, a second encrypted data block and a third encrypted data block, the first encrypted data block is decrypted by the BLOWFISH algorithm to obtain a first data block, the second encrypted data block is decrypted by the RSA algorithm to obtain a second data block, the third encrypted data block is decrypted by the IDEA algorithm to obtain a third data block, the first data block, the second data block and the third data block are spliced into three-level encrypted data, the three-level encrypted data is decrypted by the 3DES algorithm to obtain second-level encrypted data, each character of the second-level encrypted data is mapped according to a preset mapping rule to obtain first-level encrypted data, the first-level encrypted data is decrypted by the AES algorithm to obtain a password table and a first hash value, and the password table is integrity checked by the first hash value.
[0161] The step S80 is specifically as follows:
[0162] An authentication log is recorded in real time on the user side, which includes at least authentication frequency, dwell time, authentication time, IP address, MAC address, keyboard typing speed and input error rate. The authentication log is security-monitored through the authentication behavior monitoring model to generate a risk identification result. If the risk identification result is that the authentication behavior is safe, a security authentication result of successful authentication is generated; if the risk identification result is that the authentication behavior is unsafe, a security authentication result of failed authentication is generated.
[0163] By recording in real time the user's authentication log, which includes at least authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, and input error rate, and inputting the authentication log into a pre-trained authentication behavior monitoring model, the authentication behavior can be effectively identified to determine whether there is a risk in the authentication behavior. Based on the risk identification results, it is decided whether the security authentication is passed. That is, after the account and password verification is passed, the risk identification of the authentication behavior is added, which greatly improves the reliability of the security authentication.
[0164] A preferred embodiment of a security authentication management system based on blockchain big data in the present invention includes the following modules:
[0165] A data set construction module is used to obtain a large amount of authentication history data, construct a data set after preprocessing each authentication history data, mine the user behavior characteristics of the data set through big data technology, and annotate the authentication history data in the data set based on the user behavior characteristics;
[0166] An authentication behavior monitoring model training module is used to create an authentication behavior monitoring model based on a neural network, set hyperparameters of the authentication behavior monitoring model, and train the authentication behavior monitoring model using the data set;
[0167] A password table encryption storage module is used to obtain the user's registration data, generate a password table based on the registration data, encrypt the password table into a ciphertext table, and store the ciphertext table in a distributed manner in the blockchain; decentralized distributed storage through the blockchain can not only improve the security of storage, but also select the nearest node to download the ciphertext table as needed, so as to shorten the network path and improve the timeliness of security authentication; due to Moore's Law, the performance of processors is now very powerful, and even in the face of complex encryption schemes, calculations can be completed instantly. Compared with the network delay, the calculation time of the processor is negligible;
[0168] A key creation module, used to create a private key and a root certificate carrying a root public key, create a first authentication private key, a first authentication public key, a first user private key and a first user public key based on an RSA algorithm, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate and the first authentication private key to an authentication end, and send the root certificate, the user work certificate and the first user private key to a user end;
[0169] A secure communication channel establishment module, used for the authentication end and the user end to establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key;
[0170] An authentication request sending module is used for the user end to encrypt the account number and password into authentication data, generate an authentication request based on the authentication data, and send the authentication request to the authentication end through a secure communication channel;
[0171] An authentication request verification module, configured to, after the authentication end verifies the received authentication request, decrypt the authentication data carried in the authentication request to obtain the account number and password, download the ciphertext table from the nearest node in the blockchain, decrypt the ciphertext table to obtain the password table, and verify the account number and password based on the password table;
[0172] A security monitoring module is used to record the authentication log of the user end in real time, perform security monitoring on the authentication log through the authentication behavior monitoring model, and generate a security authentication result;
[0173] The data set construction module is specifically used for:
[0174] Obtain a large amount of authentication history data, which includes at least account number, authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region, and risk events;
[0175] Performing preprocessing on each of the authentication history data, including at least null value processing, data standardization processing, missing value processing, and abnormal value processing, and constructing a data set based on each of the authentication history data after preprocessing;
[0176] Classify and cluster the data set by big data technology to mine the user behavior characteristics of each account in the data set, and annotate each authentication history data in the data set based on the user behavior characteristics and risk events;
[0177] By acquiring authentication history data including at least account number, authentication frequency, length of stay, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region and risk events, user behavior characteristics are mined, which effectively enhances the dimension of user behavior monitoring. Combined with preprocessing including at least null value processing, data standardization processing, missing value processing and outlier processing, the quality of the data set is effectively improved. The authentication behavior monitoring model is then trained with the labeled data set, thereby effectively improving the recognition accuracy of the authentication behavior monitoring model.
[0178] The authentication behavior monitoring model training module is specifically used for:
[0179] Creating an authentication behavior monitoring model based on a neural network, including an input module, a feature extraction module, a feature fusion module, and an output module, and setting the authentication behavior monitoring model to at least include hyperparameters of a learning rate, a batch size, an optimizer, a number of iterations, an activation function, a discard rate, and a loss function;
[0180] The input module is used for inputting a data set; the feature extraction module is used for extracting deep features and shallow features in the data set; the feature fusion module is used for fusing deep features and shallow features and outputting fused features; the output module is used for outputting risk identification results of authentication behaviors based on fused features;
[0181] Dividing the data set into a training set, a validation set, and a test set based on a ratio of 6:2:2, training the authentication behavior monitoring model through the training set, and continuously optimizing the hyperparameters during the training process until the number of training times reaches the number of iterations;
[0182] The trained authentication behavior monitoring model is verified using the verification set to determine whether the recognition accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then:
[0183] Using the test set to test the verified authentication behavior monitoring model, determine whether the confidence is greater than a preset confidence threshold, if not, expand the training set to continue training; if yes, end the training;
[0184] By dividing the data set into training set, validation set and test set, the authentication behavior monitoring model is trained with the training set, and the hyperparameters are continuously optimized during the training process. The trained authentication behavior monitoring model is verified with the validation set, and the verified authentication behavior monitoring model is tested with the test set. The training is terminated only when the verification and test are passed, which further improves the recognition accuracy of the authentication behavior monitoring model.
[0185] The password table encryption storage module is specifically used for:
[0186] Obtaining registration data of each user, and generating a password table based on the account number and password carried in the registration data;
[0187] A hash calculation is performed on the password table to obtain a first hash value, the password table and the first hash value are encrypted by an AES algorithm to obtain primary encrypted data, each character of the primary encrypted data is mapped by a preset mapping rule to obtain secondary encrypted data, the secondary encrypted data is encrypted by a 3DES algorithm to obtain tertiary encrypted data, the tertiary encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block and the third encrypted data block are encrypted by an ElGamal algorithm to obtain a ciphertext table, and the ciphertext table is distributed and stored in a blockchain.
[0188] A first hash value is obtained by performing hash calculation on the password table, the password table and the first hash value are encrypted by using the AES algorithm to obtain first-level encrypted data, each character of the first-level encrypted data is mapped by a mapping rule to obtain second-level encrypted data, the second-level encrypted data is encrypted by using the 3DES algorithm to obtain third-level encrypted data, the third-level encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by using the BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by using the RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by using the IDEA algorithm to obtain a third encrypted data block, and the third encrypted data block is encrypted by using the ElGa The mal algorithm encrypts the first encrypted data block, the second encrypted data block and the third encrypted data block to obtain a ciphertext table, and stores the ciphertext table in a distributed manner on the blockchain; since the hash calculation is irreversible, the integrity check can be performed through the first hash value later. If the corresponding encryption algorithm and data transformation rules are not known, the ciphertext table cannot be cracked. It also combines data block encryption and adopts different encryption algorithms. At least ten security measures are taken before and after (hash calculation, AES algorithm, mapping rules, 3DES algorithm, data block, BLOWFISH algorithm, RSA algorithm, IDEA algorithm, ElGamal algorithm, blockchain), which greatly improves the security of password table storage.
[0189] In the key creation module, the root private key and the root public key are a pair of paired keys; the first authentication private key and the first authentication public key are a pair of paired keys; the first user private key and the first user public key are a pair of paired keys;
[0190] The root private key is used to sign the first authentication public key and the first user public key; the root public key is used to verify the authentication work certificate and the user work certificate.
[0191] The secure communication channel establishment module specifically includes:
[0192] A first instruction sending unit is used for the user end to generate a first random number, obtain a current first timestamp, perform a hash calculation on the first random number, the first timestamp and the user work certificate to obtain a second hash value, and generate a first instruction carrying the first random number, the user work certificate, the first timestamp and the second hash value and send it to the authentication end;
[0193] A first user public key extraction unit, configured to extract the first user public key from the user work certificate carried in the first instruction after the authentication end verifies the received first instruction;
[0194] The first user public key extraction unit is specifically used for:
[0195] The authentication end receives the first instruction in real time, parses the first instruction to obtain a first random number, a user work certificate, a first timestamp and a second hash value, performs an integrity check through the second hash value, and then performs a timeliness check through the first timestamp, then extracts the root public key from the root certificate, verifies the user work certificate through the root public key, and then extracts the first user public key from the public key modulus field of the user work certificate.
[0196] A second instruction sending unit is used for the authentication end to generate a second random number, obtain a current second timestamp, generate a second authentication private key and a second authentication public key based on the RSA algorithm, sign the first random number and the second authentication public key with the first authentication private key to obtain first signature data, generate a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, and send the second instruction to the user end;
[0197] A first authentication public key extraction unit, configured to extract a first authentication public key from an authentication work certificate carried by the second instruction after the user terminal verifies the received second instruction;
[0198] The first authentication public key extraction unit is specifically used for:
[0199] The user end receives the second instruction in real time, parses the second instruction to obtain the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, verifies the validity of the second instruction through the second timestamp, extracts the root public key from the root certificate, verifies the authentication work certificate through the root public key, and then extracts the first authentication public key from the public key modulus field of the authentication work certificate.
[0200] A third instruction sending unit is used for the user end to generate a second user private key and a second user public key based on the RSA algorithm, and obtain a current third timestamp; negotiate the first session key and calculate the first check value through the second user private key and the second authentication public key, sign the second random number, the second user public key and the first check value through the first user private key to obtain second signature data, generate a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and send the third instruction to the authentication end;
[0201] The negotiation of the first session key and calculation of the first check value by using the second user private key and the second authentication public key is specifically as follows:
[0202] Perform ECDH calculation on the second user private key and the second authentication public key, then perform sha256 calculation and then cut off the preset length to generate a first session key, use the first session key to encrypt 9 bytes of 0, and take the first 6 bytes as the first check value;
[0203] A fourth instruction sending unit is used for, after the authentication end verifies the received third instruction, to negotiate a second session key through the second user public key and the second authentication private key carried in the third instruction, to calculate a second check value of the second session key, to obtain a current fourth timestamp, to generate a fourth instruction carrying the second check value and the fourth timestamp, and to send the fourth instruction to the user end;
[0204] The fourth instruction sending unit is specifically used for:
[0205] The authentication end receives the third instruction in real time, parses the third instruction to obtain second signature data, a second user public key, a first check value and a third timestamp, first performs a time validity check on the third instruction using the third timestamp, then verifies the second signature data using the first user public key, then negotiates a second session key using the second user public key and a second authentication private key, calculates a second check value for the second session key, generates a fourth instruction carrying the second check value and a fourth timestamp, and sends the fourth instruction to the user end in real time.
[0206] The second session key is negotiated by using the second user public key and the second authentication private key, and the second check value of the second session key is calculated as follows:
[0207] Perform ECDH calculation on the second user public key and the second authentication private key, then perform sha256 calculation and then cut off the preset length to generate a second session key, use the second session key to encrypt 9 bytes of 0, and take the first 6 bytes as the second check value;
[0208] The fourth instruction verification unit is used to establish a secure communication channel between the user terminal and the authentication terminal after the user terminal verifies the received fourth instruction.
[0209] The fourth instruction checking unit is specifically used for:
[0210] The user end receives the fourth instruction in real time, parses the fourth instruction to obtain the second verification value and the fourth timestamp, and after performing time verification on the fourth instruction through the fourth timestamp, determines whether the first verification value is consistent with the second verification value. If not, terminates the process; if so, establishes a secure communication channel between the user end and the authentication end.
[0211] Since the first session key is generated through negotiation between the second user private key and the second authentication public key, and the second session key is generated through negotiation between the second user public key and the second authentication private key, the first session key and the second session key are the same pair of keys. In theory, the first verification value calculated based on the first session key needs to be equal to the second verification value calculated based on the second session key; that is, verifying the first verification value through the second verification value is to compare whether the values of the second verification value are equal to the first verification value.
[0212] By creating a root private key, a root certificate carrying a root public key, a first authentication private key, a first authentication public key, a first user private key, and a first user public key, signing the first authentication public key with the root private key to obtain an authentication work certificate, signing the first user public key with the root private key to obtain a user work certificate, sending the root certificate, the authentication work certificate, and the first authentication private key to the authentication end, and sending the root certificate, the user work certificate, and the first user private key to the user end; the user end generates a first random number, obtains the current first timestamp, performs a hash calculation on the first random number, the first timestamp, and the user work certificate to obtain a second hash value, and generates a first instruction carrying the first random number, the user work certificate, the first timestamp, and the second hash value The authentication end verifies the first instruction and extracts the first user public key from the user work certificate carried by the first instruction; generates a second random number, obtains the current second timestamp, generates a second authentication private key and a second authentication public key, signs the first random number and the second authentication public key with the first authentication private key to obtain the first signature data, generates a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp and sends it to the user end; the user end verifies the second instruction and extracts the first authentication public key from the authentication work certificate carried by the second instruction, generates a second user private key and a second user public key, obtains the current third timestamp, and signs the first random number and the second authentication public key with the first authentication private key to obtain the first signature data, generates a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp and sends it to the user end; The authentication public key negotiates the first session key and calculates the first check value, signs the second random number, the second user public key and the first check value through the first user private key to obtain the second signature data, generates a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and sends it to the authentication end; after the authentication end verifies the third instruction, it negotiates the second session key through the second user public key and the second authentication private key carried in the third instruction, calculates the second check value of the second session key, obtains the current fourth timestamp, generates a fourth instruction carrying the second check value and the fourth timestamp, and sends it to the user end; after the user end verifies the fourth instruction, it establishes a secure communication channel; that is, based on the root certificate and the authentication work certificate , user work certificate, second authentication private key, second authentication public key, second user private key, second user public key, first random number, second random number, perform two-way authentication on the communication between the authentication end and the user end, the authentication end takes at least three security measures (user work certificate verification, second signature data verification, second check value comparison), the user end takes at least three security measures (authentication work certificate verification, first signature data verification, first check value comparison), and the first signature data, the second signature data, the first check value, and the second check value are all generated based on multiple keys, which increases the difficulty of cracking, and ultimately greatly improves the security of communication between the user end and the authentication end, thereby greatly improving the reliability of security authentication.
[0213] By generating a first random number on the user side and a second random number on the authentication side for two-way authentication, replay attacks can be effectively prevented. The timestamps carried by the first, second, third, and fourth instructions are combined for time validity verification to prevent replay attacks. This also increases the difficulty of attacks and further improves the security of communication between the user side and the authentication side.
[0214] The authentication request sending module is specifically used for:
[0215] The user end encrypts the account number and password by using the ECDSA algorithm to obtain a first encrypted string, shifts each character in the first encrypted string to the right based on a preset shift amount to obtain a second encrypted string, divides the second encrypted string based on a preset division ratio and swaps the order to obtain a third encrypted string, and encrypts the third encrypted string by using the RC2 algorithm to obtain authentication data;
[0216] Obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel.
[0217] The account number and password are encrypted by the ECDSA algorithm to obtain a first encrypted string, each character in the first encrypted string is shifted to the right based on a preset displacement to obtain a second encrypted string, the second encrypted string is divided based on a preset segmentation ratio and the order is swapped to obtain a third encrypted string, and the third encrypted string is encrypted by the RC2 algorithm to obtain authentication data; the current fifth timestamp is obtained, MAC calculation is performed on the authentication data and the fifth timestamp to obtain a MAC value, an authentication request is generated based on the authentication data, the fifth timestamp and the MAC value, and the authentication request is sent to the authentication end through a secure communication channel; the fifth timestamp can be used for time verification later, and the MAC calculation is based on a hash function carrying a secret key, which is more secure than ordinary hash calculation. If the corresponding encryption algorithm and data transformation rules are not known, the authentication data cannot be cracked. At least eight security measures (ECDSA algorithm, displacement, displacement direction, segmentation ratio, RC2 algorithm, fifth timestamp, MAC calculation, secure communication channel) are taken before and after to prevent the account number and password from being stolen and tampered with during transmission, which greatly improves the security of account number and password transmission.
[0218] The authentication request verification module is specifically used for:
[0219] The authentication end receives the authentication request, parses the authentication request to obtain authentication data, a fifth timestamp, and a MAC value, performs an integrity check through the MAC value, and then performs a timeliness check through the fifth timestamp;
[0220] Decrypting the authentication data using the RC2 algorithm to obtain a third encrypted string, dividing the third encrypted string based on the inverse of a preset division ratio and swapping the order of the characters to obtain a second encrypted string, shifting each character in the second encrypted string to the left based on a preset displacement to obtain a first encrypted string, and decrypting the first encrypted string using the ECDSA algorithm to obtain an account number and a password;
[0221] Based on the node proxy API, the ciphertext table is downloaded from the nearest node in the blockchain, the ciphertext table is decrypted to obtain the password table, and the account and password are matched and verified based on the password table. If there is a matching account and password, the security monitoring module is entered; if there is no matching account and password, a security authentication result of authentication failure is generated; the node proxy API (such as Geth / Parity Proxy) provides functions such as obtaining the latest block number, block information, transaction information, etc. in the blockchain to help users directly obtain the required blockchain data from the nearest node;
[0222] Decrypting the ciphertext table is specifically as follows:
[0223] The ciphertext table is decrypted by the ElGamal algorithm to obtain a first encrypted data block, a second encrypted data block and a third encrypted data block, the first encrypted data block is decrypted by the BLOWFISH algorithm to obtain a first data block, the second encrypted data block is decrypted by the RSA algorithm to obtain a second data block, the third encrypted data block is decrypted by the IDEA algorithm to obtain a third data block, the first data block, the second data block and the third data block are spliced into three-level encrypted data, the three-level encrypted data is decrypted by the 3DES algorithm to obtain second-level encrypted data, each character of the second-level encrypted data is mapped according to a preset mapping rule to obtain first-level encrypted data, the first-level encrypted data is decrypted by the AES algorithm to obtain a password table and a first hash value, and the password table is integrity checked by the first hash value.
[0224] The security monitoring module is specifically used for:
[0225] An authentication log is recorded in real time on the user side, which includes at least authentication frequency, dwell time, authentication time, IP address, MAC address, keyboard typing speed and input error rate. The authentication log is security-monitored through the authentication behavior monitoring model to generate a risk identification result. If the risk identification result is that the authentication behavior is safe, a security authentication result of successful authentication is generated; if the risk identification result is that the authentication behavior is unsafe, a security authentication result of failed authentication is generated.
[0226] By recording in real time the user's authentication log, which includes at least authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, and input error rate, and inputting the authentication log into a pre-trained authentication behavior monitoring model, the authentication behavior can be effectively identified to determine whether there is a risk in the authentication behavior. Based on the risk identification results, it is decided whether the security authentication is passed. That is, after the account and password verification is passed, the risk identification of the authentication behavior is added, which greatly improves the reliability of the security authentication.
[0227] In summary, the advantages of the present invention are:
[0228] 1. A data set is constructed by obtaining a large amount of authentication history data for preprocessing, and the user behavior characteristics of the data set are mined through big data technology. The authentication history data in the data set are labeled based on the user behavior characteristics; then an authentication behavior monitoring model is created based on a neural network, the hyperparameters of the authentication behavior monitoring model are set, and the authentication behavior monitoring model is trained through the data set; then the user's registration data is obtained to generate a password table, and the password table is encrypted into a ciphertext table and distributedly stored in the blockchain; then a root private key and a root certificate carrying a root public key are created, a first authentication private key, a first authentication public key, a first user private key and a first user public key are created, the first authentication public key is signed by the root private key to obtain an authentication work certificate, the first user public key is signed by the root private key to obtain a user work certificate, the root certificate, the authentication work certificate and the first authentication private key are sent to the authentication end, the root certificate, the user work certificate and the first user private key are sent to the user end, and the authentication end and the user end establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key; the user end The account number and password are encrypted into authentication data, an authentication request is generated based on the authentication data and sent to the authentication end through a secure communication channel. After the authentication end verifies the authentication request, the authentication data carried in the authentication request is decrypted to obtain the account number and password, the ciphertext table is downloaded from the nearest node in the blockchain, the ciphertext table is decrypted to obtain the password table, the account number and password are verified based on the password table, and the authentication log of the user end is recorded in real time. The authentication log is securely monitored through the authentication behavior monitoring model to generate a security authentication result; that is, the authentication log generated during the authentication process is analyzed through the authentication behavior monitoring model to identify authentication behaviors with security risks. When the account number and password are leaked, if the authentication behavior is abnormal, the security authentication cannot be completed; by encrypting the password table into a ciphertext table and distributing the ciphertext table to the blockchain, the password table is prevented from being stolen and tampered with in plain text, thereby preventing illegal users from passing the security authentication; by downloading the ciphertext table from the nearest node in the blockchain for decryption, the network path is effectively shortened, and combined with the secure communication channel established between the authentication end and the user end, the reliability and timeliness of the security authentication are ultimately greatly improved.
[0229] 2. By obtaining authentication history data including at least account number, authentication frequency, stay time, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region and risk events, user behavior characteristics are mined, which effectively enhances the dimension of user behavior monitoring. Combined with preprocessing including at least null value processing, data standardization processing, missing value processing and outlier processing, the quality of the data set is effectively improved. The authentication behavior monitoring model is then trained with the labeled data set, thereby effectively improving the recognition accuracy of the authentication behavior monitoring model.
[0230] 3. By dividing the data set into training set, validation set and test set, the authentication behavior monitoring model is trained with the training set, and the hyperparameters are continuously optimized during the training process. The trained authentication behavior monitoring model is verified with the validation set, and the verified authentication behavior monitoring model is tested with the test set. The training is terminated only when the verification and test are passed, which further improves the recognition accuracy of the authentication behavior monitoring model.
[0231] 4. Obtain a first hash value by performing hash calculation on the password table, encrypt the password table and the first hash value by using the AES algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data by using the mapping rule to obtain second-level encrypted data, encrypt the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divide the third-level encrypted data into a first data block, a second data block, and a third data block, encrypt the first data block by using the BLOWFISH algorithm to obtain a first encrypted data block, encrypt the second data block by using the RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using the IDEA algorithm to obtain a third encrypted data block, and The amal algorithm encrypts the first encrypted data block, the second encrypted data block and the third encrypted data block to obtain a ciphertext table, and stores the ciphertext table in a distributed manner on the blockchain; since hash calculation is irreversible, the integrity check can be performed through the first hash value later. If the corresponding encryption algorithm and data transformation rules are not known, the ciphertext table cannot be cracked. It also combines data block encryption and adopts different encryption algorithms. At least ten security measures are taken before and after (hash calculation, AES algorithm, mapping rules, 3DES algorithm, data block, BLOWFISH algorithm, RSA algorithm, IDEA algorithm, ElGamal algorithm, blockchain), which greatly improves the security of password table storage.
[0232] 5. Create a root private key, a root certificate carrying a root public key, a first authentication private key, a first authentication public key, a first user private key, and a first user public key, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate, and the first authentication private key to the authentication end, and send the root certificate, the user work certificate, and the first user private key to the user end; the user end generates a first random number, obtains the current first timestamp, performs a hash calculation on the first random number, the first timestamp, and the user work certificate to obtain a second hash value, and generates a first random number carrying the first random number, the user work certificate, the first timestamp, and the second hash value. The first instruction is sent to the authentication end; after the authentication end verifies the first instruction, the first user public key is extracted from the user work certificate carried by the first instruction; a second random number is generated, the current second timestamp is obtained, a second authentication private key and a second authentication public key are generated, the first random number and the second authentication public key are signed by the first authentication private key to obtain the first signature data, a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp is generated and sent to the user end; after the user end verifies the second instruction, the first authentication public key is extracted from the authentication work certificate carried by the second instruction, the second user private key and the second user public key are generated, the current third timestamp is obtained, and the second user private key and the first timestamp are signed by the second user private key and the second timestamp are obtained. The second authentication public key is used to negotiate the first session key and calculate the first check value, and the second random number, the second user public key and the first check value are signed by the first user private key to obtain the second signature data, and a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp is generated and sent to the authentication end; after the authentication end verifies the third instruction, the second session key is negotiated by the second user public key and the second authentication private key carried in the third instruction, the second check value of the second session key is calculated, the current fourth timestamp is obtained, and a fourth instruction carrying the second check value and the fourth timestamp is generated and sent to the user end; after the user end verifies the fourth instruction, a secure communication channel is established; that is, based on the root certificate, the authentication work certificate The authentication end and the user end use a pair of random numbers to perform two-way authentication on the communication between the authentication end and the user end. The authentication end adopts at least three security measures (user work certificate verification, second signature data verification, second check value comparison), and the user end adopts at least three security measures (authentication work certificate verification, first signature data verification, first check value comparison). The first signature data, the second signature data, the first check value, and the second check value are all generated based on multiple keys, which increases the difficulty of cracking. Ultimately, the security of communication between the user end and the authentication end is greatly improved, and the reliability of security authentication is greatly improved.
[0233] 6. The user terminal generates a first random number and the authentication terminal generates a second random number for two-way authentication, which can effectively prevent replay attacks. The timestamps carried by the first instruction, the second instruction, the third instruction, and the fourth instruction are combined to perform time verification to prevent replay attacks. At the same time, it also increases the difficulty of attacks and further improves the security of communication between the user terminal and the authentication terminal.
[0234] 7. Encrypt the account and password through the ECDSA algorithm to obtain a first encrypted string, shift each character in the first encrypted string to the right based on a preset displacement to obtain a second encrypted string, split the second encrypted string based on a preset segmentation ratio and swap the order to obtain a third encrypted string, encrypt the third encrypted string through the RC2 algorithm to obtain authentication data; obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel; subsequently, the fifth timestamp can be used for time verification, and the MAC calculation is based on a hash function carrying a secret key, which is more secure than ordinary hash calculation. If the corresponding encryption algorithm and data transformation rules are not known, the authentication data cannot be cracked. At least eight security measures (ECDSA algorithm, displacement, displacement direction, segmentation ratio, RC2 algorithm, fifth timestamp, MAC calculation, secure communication channel) are taken before and after to prevent the account and password from being stolen and tampered with during transmission, which greatly improves the security of account and password transmission.
[0235] 8. By recording the user's authentication log in real time, including at least authentication frequency, stay time, authentication time, IP address, MAC address, keyboard typing speed and input error rate, and inputting the authentication log into the pre-trained authentication behavior monitoring model, the authentication behavior can be effectively identified, and it can be determined whether there is a risk in the authentication behavior. Based on the risk identification results, it is decided whether the security authentication is passed. That is, after the account and password verification is passed, the risk identification of the authentication behavior is added, which greatly improves the reliability of the security authentication.
[0236] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A security authentication management method based on blockchain big data, characterized by: The steps include: Step S10, obtaining a large amount of authentication history data, constructing a data set after preprocessing each authentication history data, mining the user behavior characteristics of the data set through big data technology, and annotating the authentication history data in the data set based on the user behavior characteristics; Step S20: creating an authentication behavior monitoring model based on a neural network, setting hyperparameters of the authentication behavior monitoring model, and training the authentication behavior monitoring model using the data set; Step S30: obtaining the user's registration data, generating a password table based on the registration data, encrypting the password table into a ciphertext table, and distributively storing the ciphertext table in a blockchain; Step S40: create a root private key and a root certificate carrying a root public key, create a first authentication private key, a first authentication public key, a first user private key and a first user public key based on the RSA algorithm, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate and the first authentication private key to the authentication end, and send the root certificate, the user work certificate and the first user private key to the user end; Step S50: The authentication end and the user end establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key; Step S60: The user terminal encrypts the account number and password into authentication data, generates an authentication request based on the authentication data, and sends the authentication request to the authentication terminal through a secure communication channel; Step S70: After verifying the received authentication request, the authentication end decrypts the authentication data carried in the authentication request to obtain the account number and password, downloads the ciphertext table from the nearest node in the blockchain, decrypts the ciphertext table to obtain the password table, and verifies the account number and password based on the password table; Step S80, recording the authentication log of the user terminal in real time, performing security monitoring on the authentication log through the authentication behavior monitoring model, and generating a security authentication result; The step S10 is specifically as follows: Obtain a large amount of authentication history data, which includes at least account number, authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region, and risk events; Performing preprocessing on each of the authentication history data, including at least null value processing, data standardization processing, missing value processing, and abnormal value processing, and constructing a data set based on each of the authentication history data after preprocessing; Classify and cluster the data set by big data technology to mine the user behavior characteristics of each account in the data set, and annotate each authentication history data in the data set based on the user behavior characteristics and risk events; The step S20 is specifically as follows: Creating an authentication behavior monitoring model based on a neural network, including an input module, a feature extraction module, a feature fusion module, and an output module, and setting the authentication behavior monitoring model to at least include hyperparameters of a learning rate, a batch size, an optimizer, a number of iterations, an activation function, a discard rate, and a loss function; The input module is used for inputting a data set; the feature extraction module is used for extracting deep features and shallow features in the data set; the feature fusion module is used for fusing deep features and shallow features and outputting fused features; The output module is used to output the risk identification result of the authentication behavior based on the fusion feature; Dividing the data set into a training set, a validation set, and a test set based on a ratio of 6:2:2, training the authentication behavior monitoring model through the training set, and continuously optimizing the hyperparameters during the training process until the number of training times reaches the number of iterations; The trained authentication behavior monitoring model is verified using the verification set to determine whether the recognition accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then: Using the test set to test the verified authentication behavior monitoring model, determine whether the confidence is greater than a preset confidence threshold, if not, expand the training set to continue training; if yes, end the training; The step S30 is specifically as follows: Obtaining registration data of each user, and generating a password table based on the account number and password carried in the registration data; A hash calculation is performed on the password table to obtain a first hash value, the password table and the first hash value are encrypted by an AES algorithm to obtain primary encrypted data, each character of the primary encrypted data is mapped by a preset mapping rule to obtain secondary encrypted data, the secondary encrypted data is encrypted by a 3DES algorithm to obtain tertiary encrypted data, the tertiary encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block and the third encrypted data block are encrypted by an ElGamal algorithm to obtain a ciphertext table, and the ciphertext table is distributed and stored in a blockchain.
2. A security authentication management method based on blockchain big data as claimed in claim 1, characterized in that: In the step S40, the root private key and the root public key are a pair of paired keys; the first authentication private key and the first authentication public key are a pair of paired keys; the first user private key and the first user public key are a pair of paired keys; The root private key is used to sign the first authentication public key and the first user public key; the root public key is used to verify the authentication work certificate and the user work certificate.
3. A security authentication management method based on blockchain big data as claimed in claim 1, characterized in that: The step S50 specifically includes: Step S51: The user terminal generates a first random number, obtains a current first timestamp, performs a hash calculation on the first random number, the first timestamp and the user's work certificate to obtain a second hash value, generates a first instruction carrying the first random number, the user's work certificate, the first timestamp and the second hash value, and sends it to the authentication terminal; Step S52: After verifying the received first instruction, the authentication end extracts the first user public key from the user work certificate carried in the first instruction; Step S53: the authentication end generates a second random number, obtains a current second timestamp, generates a second authentication private key and a second authentication public key based on the RSA algorithm, signs the first random number and the second authentication public key with the first authentication private key to obtain first signature data, generates a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, and sends the second instruction to the user end; Step S54: After verifying the received second instruction, the user terminal extracts the first authentication public key from the authentication work certificate carried by the second instruction; Step S55: The user terminal generates a second user private key and a second user public key based on the RSA algorithm, and obtains a current third timestamp; negotiates a first session key and calculates a first check value through the second user private key and the second authentication public key, signs the second random number, the second user public key and the first check value through the first user private key to obtain second signature data, generates a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and sends the third instruction to the authentication terminal; Step S56: After verifying the received third instruction, the authenticating end negotiates a second session key through the second user public key and the second authentication private key carried in the third instruction, calculates a second check value of the second session key, obtains the current fourth timestamp, generates a fourth instruction carrying the second check value and the fourth timestamp, and sends it to the user end; Step S57: After verifying the received fourth instruction, the user terminal establishes a secure communication channel between the user terminal and the authentication terminal.
4. A security authentication management method based on blockchain big data as claimed in claim 1, characterized in that: The step S60 is specifically as follows: The user end encrypts the account number and password by using the ECDSA algorithm to obtain a first encrypted string, shifts each character in the first encrypted string to the right based on a preset shift amount to obtain a second encrypted string, divides the second encrypted string based on a preset division ratio and swaps the order to obtain a third encrypted string, and encrypts the third encrypted string by using the RC2 algorithm to obtain authentication data; Obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel.
5. A security authentication management method based on blockchain big data as claimed in claim 1, characterized in that: The step S70 is specifically as follows: The authentication end receives the authentication request, parses the authentication request to obtain authentication data, a fifth timestamp, and a MAC value, performs an integrity check through the MAC value, and then performs a timeliness check through the fifth timestamp; Decrypting the authentication data using the RC2 algorithm to obtain a third encrypted string, dividing the third encrypted string based on the inverse of a preset division ratio and swapping the order of the characters to obtain a second encrypted string, shifting each character in the second encrypted string to the left based on a preset displacement to obtain a first encrypted string, and decrypting the first encrypted string using the ECDSA algorithm to obtain an account number and a password; Downloading a ciphertext table from the nearest node in the blockchain based on the node proxy API, decrypting the ciphertext table to obtain a password table, performing a matching check on the account and password based on the password table, and if there is a matching account and password, proceeding to step S80; if there is no matching account and password, generating a security authentication result of authentication failure; The step S80 is specifically as follows: Record in real time the authentication log of the user terminal, which includes at least the authentication frequency, stay time, authentication time, IP address, MAC address, keyboard typing speed and input error rate; perform security monitoring on the authentication log through the authentication behavior monitoring model to generate a risk identification result; if the risk identification result is that the authentication behavior is safe, generate a security authentication result indicating successful authentication; If the risk identification result is that the authentication behavior is unsafe, a security authentication result of authentication failure is generated.
6. A security authentication management system based on blockchain big data, characterized by: Includes the following modules: A data set construction module is used to obtain a large amount of authentication history data, construct a data set after preprocessing each authentication history data, mine the user behavior characteristics of the data set through big data technology, and annotate the authentication history data in the data set based on the user behavior characteristics; An authentication behavior monitoring model training module is used to create an authentication behavior monitoring model based on a neural network, set hyperparameters of the authentication behavior monitoring model, and train the authentication behavior monitoring model using the data set; A password table encryption storage module, used to obtain the user's registration data, generate a password table based on the registration data, encrypt the password table into a ciphertext table, and store the ciphertext table in a distributed manner on the blockchain; A key creation module, used to create a private key and a root certificate carrying a root public key, create a first authentication private key, a first authentication public key, a first user private key and a first user public key based on an RSA algorithm, sign the first authentication public key with the root private key to obtain an authentication work certificate, sign the first user public key with the root private key to obtain a user work certificate, send the root certificate, the authentication work certificate and the first authentication private key to an authentication end, and send the root certificate, the user work certificate and the first user private key to a user end; A secure communication channel establishment module, used for the authentication end and the user end to establish a secure communication channel through the root certificate, the authentication work certificate, the first authentication private key, the user work certificate and the first user private key; An authentication request sending module is used for the user end to encrypt the account number and password into authentication data, generate an authentication request based on the authentication data, and send the authentication request to the authentication end through a secure communication channel; An authentication request verification module, configured to, after the authentication end verifies the received authentication request, decrypt the authentication data carried in the authentication request to obtain the account number and password, download the ciphertext table from the nearest node in the blockchain, decrypt the ciphertext table to obtain the password table, and verify the account number and password based on the password table; A security monitoring module is used to record the authentication log of the user end in real time, perform security monitoring on the authentication log through the authentication behavior monitoring model, and generate a security authentication result; The data set construction module is specifically used for: Obtain a large amount of authentication history data, which includes at least account number, authentication frequency, stay duration, authentication time, IP address, MAC address, keyboard typing speed, input error rate, user age, user gender, user region, and risk events; Performing preprocessing on each of the authentication history data, including at least null value processing, data standardization processing, missing value processing, and abnormal value processing, and constructing a data set based on each of the authentication history data after preprocessing; Classify and cluster the data set by big data technology to mine the user behavior characteristics of each account in the data set, and annotate each authentication history data in the data set based on the user behavior characteristics and risk events; The authentication behavior monitoring model training module is specifically used for: Creating an authentication behavior monitoring model based on a neural network, including an input module, a feature extraction module, a feature fusion module, and an output module, and setting the authentication behavior monitoring model to at least include hyperparameters of a learning rate, a batch size, an optimizer, a number of iterations, an activation function, a discard rate, and a loss function; The input module is used for inputting a data set; the feature extraction module is used for extracting deep features and shallow features in the data set; the feature fusion module is used for fusing deep features and shallow features and outputting fused features; The output module is used to output the risk identification result of the authentication behavior based on the fusion feature; Dividing the data set into a training set, a validation set, and a test set based on a ratio of 6:2:2, training the authentication behavior monitoring model through the training set, and continuously optimizing the hyperparameters during the training process until the number of training times reaches the number of iterations; The trained authentication behavior monitoring model is verified using the verification set to determine whether the recognition accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then: Using the test set to test the verified authentication behavior monitoring model, determine whether the confidence is greater than a preset confidence threshold, if not, expand the training set to continue training; if yes, end the training; The password table encryption storage module is specifically used for: Obtaining registration data of each user, and generating a password table based on the account number and password carried in the registration data; A hash calculation is performed on the password table to obtain a first hash value, the password table and the first hash value are encrypted by an AES algorithm to obtain primary encrypted data, each character of the primary encrypted data is mapped by a preset mapping rule to obtain secondary encrypted data, the secondary encrypted data is encrypted by a 3DES algorithm to obtain tertiary encrypted data, the tertiary encrypted data is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a BLOWFISH algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block and the third encrypted data block are encrypted by an ElGamal algorithm to obtain a ciphertext table, and the ciphertext table is distributed and stored in a blockchain.
7. A security authentication management system based on blockchain big data as claimed in claim 6, characterized in that: In the key creation module, the root private key and the root public key are a pair of paired keys; the first authentication private key and the first authentication public key are a pair of paired keys; the first user private key and the first user public key are a pair of paired keys; The root private key is used to sign the first authentication public key and the first user public key; the root public key is used to verify the authentication work certificate and the user work certificate.
8. A security authentication management system based on blockchain big data as claimed in claim 6, characterized in that: The secure communication channel establishment module specifically includes: A first instruction sending unit is used for the user end to generate a first random number, obtain a current first timestamp, perform a hash calculation on the first random number, the first timestamp and the user work certificate to obtain a second hash value, and generate a first instruction carrying the first random number, the user work certificate, the first timestamp and the second hash value and send it to the authentication end; A first user public key extraction unit, configured to extract the first user public key from the user work certificate carried in the first instruction after the authentication end verifies the received first instruction; A second instruction sending unit is used for the authentication end to generate a second random number, obtain a current second timestamp, generate a second authentication private key and a second authentication public key based on the RSA algorithm, sign the first random number and the second authentication public key with the first authentication private key to obtain first signature data, generate a second instruction carrying the first signature data, the second random number, the second authentication public key, the authentication work certificate and the second timestamp, and send the second instruction to the user end; A first authentication public key extraction unit, configured to extract a first authentication public key from an authentication work certificate carried by the second instruction after the user terminal verifies the received second instruction; A third instruction sending unit is used for the user end to generate a second user private key and a second user public key based on the RSA algorithm, and obtain a current third timestamp; negotiate the first session key and calculate the first check value through the second user private key and the second authentication public key, sign the second random number, the second user public key and the first check value through the first user private key to obtain second signature data, generate a third instruction carrying the second signature data, the second user public key, the first check value and the third timestamp, and send the third instruction to the authentication end; A fourth instruction sending unit is used for, after the authentication end verifies the received third instruction, to negotiate a second session key through the second user public key and the second authentication private key carried in the third instruction, to calculate a second check value of the second session key, to obtain a current fourth timestamp, to generate a fourth instruction carrying the second check value and the fourth timestamp, and to send the fourth instruction to the user end; The fourth instruction verification unit is used to establish a secure communication channel between the user terminal and the authentication terminal after the user terminal verifies the received fourth instruction.
9. A security authentication management system based on blockchain big data as claimed in claim 6, characterized in that: The authentication request sending module is specifically used for: The user end encrypts the account number and password by using the ECDSA algorithm to obtain a first encrypted string, shifts each character in the first encrypted string to the right based on a preset shift amount to obtain a second encrypted string, divides the second encrypted string based on a preset division ratio and swaps the order to obtain a third encrypted string, and encrypts the third encrypted string by using the RC2 algorithm to obtain authentication data; Obtain the current fifth timestamp, perform MAC calculation on the authentication data and the fifth timestamp to obtain a MAC value, generate an authentication request based on the authentication data, the fifth timestamp and the MAC value, and send the authentication request to the authentication end through a secure communication channel.
10. A security authentication management system based on blockchain big data as claimed in claim 6, characterized in that: The authentication request verification module is specifically used for: The authentication end receives the authentication request, parses the authentication request to obtain authentication data, a fifth timestamp, and a MAC value, performs an integrity check through the MAC value, and then performs a timeliness check through the fifth timestamp; Decrypting the authentication data using the RC2 algorithm to obtain a third encrypted string, dividing the third encrypted string based on the inverse of a preset division ratio and swapping the order of the characters to obtain a second encrypted string, shifting each character in the second encrypted string to the left based on a preset displacement to obtain a first encrypted string, and decrypting the first encrypted string using the ECDSA algorithm to obtain an account number and a password; Download the ciphertext table from the nearest node in the blockchain based on the node agent API, decrypt the ciphertext table to obtain the password table, perform matching verification on the account and password based on the password table, and enter the security monitoring module if there is a matching account and password; if there is no matching account and password, generate a security authentication result of authentication failure; The security monitoring module is specifically used for: Record in real time the authentication log of the user terminal, which includes at least the authentication frequency, stay time, authentication time, IP address, MAC address, keyboard typing speed and input error rate; perform security monitoring on the authentication log through the authentication behavior monitoring model to generate a risk identification result; if the risk identification result is that the authentication behavior is safe, generate a security authentication result indicating successful authentication; If the risk identification result is that the authentication behavior is unsafe, a security authentication result of authentication failure is generated.
Citation Information
Patent Citations
Neural network model encryption protection system and method involving domain transformation data encryption
CN108804931A
Wireless Mesh network identity authentication method based on blockchain
CN108810895A
