Safe multi-system login intercommunication method and system
Generate cookie names through asymmetric encryption algorithms and hash calculations to ensure the security of user information in sub-platform login, solve the key leakage and data security risks caused by the disclosure of SDK source code, and achieve secure multi-system login interoperability.
Patent Information
- Application Number
- CN202411130472.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-16
AI Technical Summary
In the prior art, the SDK source code of the unified account login system is disclosed, resulting in the exposure of encryption and decryption algorithms, which may lead to key leakage and attackers forged login information, endangering data security.
Asymmetric encryption algorithm is used to log in to the main platform through an account and generate a hash string as a cookie name, encrypt and store the user information private key, and the sub-platform uses the public key to decrypt it to ensure that only the public key is exposed in the SDK, and the attacker cannot Simulate encrypted user information.
It effectively guarantees the data security of multi-system login, prevents attackers from tampering with user login data at will, and simulates and encrypts the private key only through the public key, enhancing login security.
Smart Images

Figure CN119071048A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a secure multi-system login and intercommunication method and system. Background Art
[0002] The company provides a unified account login system. After the user logs in, the platform stores the user information in a cookie. The sub-platforms of other departments can obtain the user information by obtaining and parsing the cookie, thereby achieving login interoperability. In order to simplify the work of each department, the account login system provides an SDK that encapsulates the code for obtaining login cookie data and decryption for the sub-platforms of each department to call. However, this method has a potential security risk: the source code of the SDK is public, and the encryption and decryption algorithms can be seen within the department. It is possible to simulate the user login information by simulating the algorithm of the SDK source code, so as to arbitrarily construct any user login. If the department's key management is improper and leads to key leakage, the attacker can use the leaked key to construct forged login information and request the target site according to the cookie rules, thereby achieving the result of arbitrary login and endangering the data security of the department. Summary of the invention
[0003] In order to overcome the problem that login security cannot be guaranteed in the company's development platform, which will affect data security, the purpose of the present invention is to provide a secure multi-system login and intercommunication method and system to ensure data security when using SDK to implement login.
[0004] The present invention is implemented by the following scheme:
[0005] A secure multi-system login intercommunication method, the method steps are as follows:
[0006] Step 1: After the account logs in to the main platform and verifies that the user account and password are correct, an algorithm is used to obtain an x-digit string c. The algorithm is to add a fixed interference value n to the current month, and then perform a hash calculation with the preset string k to obtain an x-digit string c as the cookie name;
[0007] Step 2: The user information is asymmetrically encrypted with the private key to obtain the encrypted user information s, and stored in a cookie named c;
[0008] Step 3: The sub-platform uses the encapsulated SDK. The SDK generates the same cookie name c according to the algorithm in step 1 and reads the corresponding encrypted cookie value s named c. The SDK uses the public key to decrypt the encrypted s. If the user information is successfully obtained, it means that the user is logged in and the sub-platform login is successful. Otherwise, it is not logged in.
[0009] Furthermore, the asymmetric encryption includes RSA asymmetric encryption, DSA asymmetric encryption and ECC asymmetric encryption.
[0010] Furthermore, after step 2, a random interference string group can be generated, specifically: generate several random interference values and several random interference strings, perform hash calculations one by one to obtain several a-bit strings as interference cookie names; randomly generate several groups of interference strings of equal length according to the length of the encrypted user information s described in step 2, and store them under several groups of interference cookie names.
[0011] A secure multi-system login and intercommunication system, the system comprising: a first encryption module, a second encryption module, and a sub-platform decryption login module;
[0012] The first encryption module is used to log in to the main platform with an account and verify that the user account and password are correct, and then use an algorithm to obtain an x-digit string c. The algorithm is to add a fixed interference value n to the current month, and then perform a hash calculation with the preset string k to obtain an x-digit string c as the cookie name;
[0013] The second encryption module is used to asymmetrically encrypt user information with a private key to obtain encrypted user information s, and store it in a cookie named c;
[0014] The sub-platform decryption login module is used for the sub-platform to use the encapsulated SDK. The SDK generates the same cookie name c according to the algorithm of the first encryption module and reads the corresponding encrypted cookie value s named c. The SDK uses the public key to decrypt the encrypted s. If the user information is successfully obtained, it means that the user is in the logged-in state and the sub-platform login is successful, otherwise it is in the non-login state.
[0015] Furthermore, the asymmetric encryption includes RSA asymmetric encryption, DSA asymmetric encryption and ECC asymmetric encryption.
[0016] Furthermore, a random interference string group can be generated, specifically: generate several random interference values and several random interference strings, perform hash calculations one by one to obtain several a-bit strings as interference cookie names; randomly generate several groups of interference strings of equal length according to the length of the encrypted user information s described in the second encryption module, and store them under several groups of interference cookie names.
[0017] The beneficial effects of the present invention are:
[0018] The present invention provides a secure multi-system login intercommunication method and system, provides a convenient SDK method for obtaining user information for the sub-platform, and can ensure the data security of the user information, thereby preventing attackers from arbitrarily tampering with the user login data. Because only the public key is exposed in the SDK source code, even if the attacker guesses the calculation method of the cookie name, he cannot obtain the private key to simulate the encryption of the user information. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a flow chart of the method of the present invention;
[0020] Figure 2 It is a structural block diagram of the system of the present invention. DETAILED DESCRIPTION
[0021] The present invention will be further described below in conjunction with the accompanying drawings.
[0022] See also Figure 1 , a secure multi-system login intercommunication method, the method steps are as follows:
[0023] Step 1: After the account logs in to the main platform and verifies that the user account and password are correct, an algorithm is used to obtain an x-digit string c. The algorithm is to add a fixed interference value n to the current month, and then perform a hash calculation with the preset string k to obtain an x-digit string c as the cookie name;
[0024] Step 2: The user information is asymmetrically encrypted with the private key to obtain the encrypted user information s, and stored in a cookie named c;
[0025] Step 3: The sub-platform uses the packaged SDK. The SDK generates the same cookie name c according to the algorithm in step 1 and reads the corresponding encrypted cookie value s named c. The SDK uses the public key to decrypt the encrypted s. If the user information is successfully obtained, it means that the user is in the logged-in state and the sub-platform login is successful. Otherwise, it is in the non-logged-in state. The present invention is further described below in conjunction with a specific embodiment:
[0026] A secure multi-system login intercommunication method, the method comprising the following steps:
[0027] Step 1: When user yewei logs in, the account login system first verifies whether the password of user yewei is correct. If it is wrong, it returns login failure. If it is correct, continue with the following steps: Get the month of the current date, assuming m = 7, and add the fixed interference value n = 123 to get the sum 130; then, concatenate 130 with the fixed string k = F5C8564E, and use the MD5 hash algorithm to calculate to get the 16-bit string c = DF3A2857AC7511EF. The user information is asymmetrically encrypted with the private key privateKey to obtain the encrypted user information s, which is finally stored in a cookie named DF3A2857AC7511EF.
[0028] Step 2: Generate several random interference values and several random interference strings, perform hash calculations on each of them to obtain several a-bit strings as interference cookie names; randomly generate several groups of interference strings of equal length according to the length of the encrypted user information s described in step 2, and store them under several groups of interference cookie names.
[0029] Randomly generate 5 groups of random interference values, such as 1, 4, 10, 20, and 44. Generate 5 groups of random interference strings, such as xjshwy, aisjwu21, djudh32, 8dhsh3, and 4hdh28. Perform MD5 hashing calculations one by one to obtain 5 groups of 16-bit strings as interference cookie names, and obtain A3DD57DB69C1E35E, DC35457020F90958, FA92C53F0790AAD3, 90373A7765B4C35F, and D3F743F23E20872E. Assuming that the encrypted user information s generated in step 1 is a string of length 60, then randomly generate 5 groups of strings of length 60 and store them under the names of 5 groups of interference cookies. These 5 groups of cookies exist as interference factors in order to confuse the correct cookies.
[0030] Step 3: The sub-platform uses the encapsulated SDK. The SDK generates the same cookie name c according to the algorithm in step 1 and reads the corresponding encrypted cookie value s named c. The SDK uses the public key to decrypt the encrypted s. If the user information is successfully obtained, it means that the user is logged in and the sub-platform login is successful. Otherwise, it is not logged in.
[0031] The sub-platform uses the packaged SDK to call the method name for obtaining user information. The execution process of the SDK code is as follows: First, the SDK obtains the month of the current date, assuming it is m=7, and adds the fixed interference value n=123 to get the sum 130. Next, 130 is concatenated with the fixed string k=F5C8564E, and the MD5 hash algorithm is used to calculate to obtain the 16-bit string c=DF3A2857AC7511EF. The SDK then calls to obtain the cookie value named DF3A2857AC7511EF, which stores the user information s encrypted by the private key. Finally, the SDK uses the public key to decrypt the encrypted user information s to obtain the user information. Successfully obtaining the user information means that the user is logged in, otherwise it is not logged in.
[0032] See also Figure 2 , a secure multi-system login and intercommunication system, the system comprising: a first encryption module, a second encryption module and a sub-platform decryption login module;
[0033] The first encryption module is used to log in to the main platform with an account and verify that the user account and password are correct, and then use an algorithm to obtain an x-digit string c. The algorithm is to add a fixed interference value n to the current month, and then perform a hash calculation with the preset string k to obtain an x-digit string c as the cookie name;
[0034] The second encryption module is used to asymmetrically encrypt user information with a private key to obtain encrypted user information s, and store it in a cookie named c;
[0035] The sub-platform decryption login module is used for the sub-platform to use the encapsulated SDK. The SDK generates the same cookie name c according to the algorithm of the first encryption module and reads the corresponding encrypted cookie value s named c. The SDK uses the public key to decrypt the encrypted s. If the user information is successfully obtained, it means that the user is in the logged-in state and the sub-platform login is successful, otherwise it is in the non-login state.
[0036] In one embodiment of the present invention, the asymmetric encryption includes RSA asymmetric encryption, DSA asymmetric encryption and ECC asymmetric encryption.
[0037] In one embodiment of the present invention, a random interference character string group can also be generated, specifically: a number of random interference numerical values and a number of random interference character strings are generated, and hash calculations are performed one by one to obtain a number of a-bit character strings as interference cookie names; a number of groups of interference character strings of equal length are randomly generated according to the length of the encrypted user information s described in the second encryption module, and stored under a number of groups of interference cookie names.
[0038] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.
Claims
1. A secure multi-platform login and intercommunication method, characterized in that: The method steps are as follows: Step 1: After the account logs in to the main platform and verifies that the user account and password are correct, an algorithm is used to obtain an x-digit string c. The algorithm is to add a fixed interference value n to the current month, and then perform a hash calculation with the preset string k to obtain an x-digit string c as the cookie name; Step 2: The user information is asymmetrically encrypted with the private key to obtain the encrypted user information s, and stored in a cookie named c; Step 3: The sub-platform uses the encapsulated SDK. The SDK generates the same cookie name c according to the algorithm in step 1 and reads the corresponding encrypted cookie value s named c. The SDK uses the public key to decrypt the encrypted s. If the user information is successfully obtained, it means that the user is logged in and the sub-platform login is successful. Otherwise, it is not logged in.
2. A secure multi-system login and intercommunication method according to claim 1, characterized in that: The asymmetric encryption includes RSA asymmetric encryption, DSA asymmetric encryption and ECC asymmetric encryption.
3. A secure multi-system login and intercommunication method according to claim 1, characterized in that: After step 2, a random interference string group can also be generated, specifically: generate several random interference values and several random interference strings, perform hash calculations one by one to obtain several a-bit strings as interference cookie names; randomly generate several groups of interference strings of equal length according to the length of the encrypted user information s described in step 2, and store them under several groups of interference cookie names.
4. A secure multi-system login and intercommunication system, characterized in that: The system comprises: a first encryption module, a second encryption module, and a sub-platform decryption login module; The first encryption module is used to log in to the main platform with an account and verify that the user account and password are correct, and then use an algorithm to obtain an x-digit string c. The algorithm is to add a fixed interference value n to the current month, and then perform a hash calculation with the preset string k to obtain an x-digit string c as the cookie name; The second encryption module is used to asymmetrically encrypt user information with a private key to obtain encrypted user information s, and store it in a cookie named c; The sub-platform decryption login module is used for the sub-platform to use the encapsulated SDK. The SDK generates the same cookie name c according to the algorithm of the first encryption module and reads the corresponding encrypted cookie value s named c. The SDK uses the public key to decrypt the encrypted s. If the user information is successfully obtained, it means that the user is in the logged-in state and the sub-platform login is successful, otherwise it is in the non-login state.
5. A secure multi-system login and intercommunication system according to claim 4, characterized in that: The asymmetric encryption includes RSA asymmetric encryption, DSA asymmetric encryption and ECC asymmetric encryption.
6. A secure multi-system login and intercommunication system according to claim 4, characterized in that: It is also possible to generate a random interference string group, specifically: generate several random interference values and several random interference strings, perform hash calculations one by one to obtain several a-bit strings as interference cookie names; randomly generate several groups of interference strings of equal length according to the length of the encrypted user information s described in the second encryption module, and store them under several groups of interference cookie names.
Citation Information
Patent Citations
Single sign on method and system based on Cookie and application server thereof
CN103179134A
Cookie dynamic loading method
CN103368964A
Single sign-on device and method
CN104394172A
Cookie data processing method, apparatus, computer device, and storage medium
CN109409099A
Single sign on method and apparatus
CN109450890A
