A method for identifying forged Android application login based on multiple environmental parameters
By adopting a forged identification method of multi-environment parameters in Android applications, combined with differential verification of hardware environment and timestamps, the problem of insufficient security in password-free login environments is solved, and a higher level of security and data protection is achieved.
Patent Information
- Application Number
- CN202210166583.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2042-02-23
AI Technical Summary
The existing Android application password-free login technology lacks verification of the login environment, which leads to vulnerability to fake login attacks and leakage of user privacy information.
Using a login forgery identification method based on multi-environment parameters, multi-dimensional verification is performed through hardware environment factors and logged in user information, and combining AES decryption algorithm and MD5 encryption algorithm to judge the differences in hardware environment parameters and timestamps to ensure the security of password-free login .
Improve the security of Android applications' password-free login, prevent forged logins, enhance the protection of user data, and ensure multi-dimensional security factor detection of the login environment.
Smart Images

Figure CN114637985B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an Android application login forgery identification method based on multiple environmental parameters, belonging to the technical field of application information security. Background Art
[0002] With the continuous development of smart phones and computer technology, Android apps have become more and more versatile, and people are becoming more and more dependent on Android apps. As more and more apps are installed on people's phones, more and more accounts and passwords need to be entered. However, with the popularity of password-free login, people no longer need to enter lengthy accounts and passwords every time they log in to an app, but this has also caused great harm to Android account security.
[0003] On the one hand, pirated software is rampant, and a large amount of user privacy information can be obtained by inserting malicious code in key code. Reverse hackers analyze the application source code, insert information reporting points in the app login code, and repackage the source code to generate a new APK and put it in the application market. In this way, the user's account and password will be obtained by the pre-added information reporting points and sent to the hacker, who will forge a login. On the other hand, due to the rise of backup technology, many technicians can easily get all the data of the app on the mobile phone hard drive through third-party tools such as Titanium Backup and Tai Chi, and then restore it on the simulator or mobile phone to achieve forged login. Under the above problems, the verification of the Android app login environment is very important.
[0004] The concept of Android app protection is derived from desktop application protection. Early desktop application software unlocked the right to use the software through key authentication. With the rapid development of the Internet, the number of people using Android apps has far exceeded the number of desktop software users. Gradually, the protection strategies of desktop software have been applied to Android app application protection, and on this basis, a more stable protection solution has been explored to protect users' personal privacy data and improve users' experience.
[0005] At present, manufacturers do not perform separate verification of the login environment in the password-free login of App. When the App initiates a login request, the server generally returns the information of the logged-in user to the client after successful verification. The client can save a unique identification field in the user information at this time, such as using SharedPreference to save it. Each subsequent network request is made, first determine whether the field exists locally. If it does not exist, it means that the user has not performed login authentication and jumps to the login page; if it exists, directly carry this field into the request information to achieve login retention. Alternatively, after successful verification, the server generates a Token information and saves it to the user table and sets a certain time limit, and returns this Token to the App. The App saves this Token locally, and each subsequent request is made with this Token. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide an Android application login forgery identification method based on multiple environmental parameters, which adopts a new verification logic, combines hardware environment factors and login user information, performs multi-dimensional verification on the login environment, improves the security of the password-free login environment, and thus realizes a safer password-free login.
[0007] In order to solve the above technical problems, the present invention adopts the following technical solutions: The present invention designs an Android application login forgery identification method based on multiple environmental parameters, which is used to realize the subsequent password-free login for the Android application after successfully logging into the Android application. The password-free login operation triggers the execution of the following steps:
[0008] Step A. Get the signature public key string str when the Android application is running Sign , and obtain the encrypted storage path string of the ciphertext file composed of the preset hardware environment parameter information, user name string, and time string when the Android application was successfully logged in last time, as well as the encrypted storage path string of at least one redundant ciphertext file corresponding to the ciphertext file, and then use the signature public key string str Sign is the public key, and the AES decryption algorithm is used to decrypt each encrypted storage path string respectively, and it is determined whether each encrypted storage path string is successfully decrypted. If yes, the real path string corresponding to each encrypted storage path string is obtained, and the process goes to step B; otherwise, the process goes to step L;
[0009] Step B. Get the ciphertext string in the ciphertext file under each real path string path, and determine whether the ciphertext strings are the same. If so, set the string to be decrypted str start is the ciphertext string, and proceed to step C; otherwise, proceed to step L;
[0010] Step C. Sign the public key string str Sign is the public key, and the AES decryption algorithm is used to decrypt the string str start Decryption is performed. If the decryption fails, the process goes to step L. If the decryption succeeds, the string str to be decrypted is obtained. start The corresponding parameter string str after decryption second , and get the parameter string str second The hardware environment parameter information ciphertext string str consists of the user name string and each hardware environment parameter information sbit , and the time string str vtime , then proceed to step D;
[0011] Step D. Obtain the current hardware environment parameter information and the user name string str that runs the Android application User , and use the MD5 algorithm to target the current hardware environment parameter information and the user name string str User Encrypt to obtain each MD5 ciphertext string, and then perform XOR logic operation on each MD5 ciphertext string in a preset order to obtain the current hardware environment parameter information string str test , and proceed to step E;
[0012] Step E. Targeting the current hardware environment parameter information string str test Encode and obtain the corresponding current hardware environment parameter information binary array bitArray test , and create an empty new hardware environment parameter information binary array bitArray new ; Then traverse the bitArray in order test Each element in, if the element value is 0, then in the new hardware environment parameter information binary array bitArray new Insert two element values 0 and 1 at the end of the bitArray. If the element value is 1, then the new hardware environment parameter information binary array bitArray new Insert two element values 1 and 0 at the end of the bitArray test After traversing each element in the new hardware environment parameter information binary array bitArray new Decode and obtain the new hardware environment parameter information ciphertext string str verify , proceed to step F;
[0013] Step F. Determine the hardware environment parameter information ciphertext string str sbit The encrypted string str of the new hardware environment parameter information verifyAre they equal? If yes, go to step G; otherwise, go to step L;
[0014] Step G. Obtain the ciphertext file modification time attribute value string under each real path string path obtained in step A, and obtain str vtime The time difference between each ciphertext file modification time attribute value character string and the time corresponding to the time, and determine whether there is a time difference exceeding the preset time limit, if yes, proceed to step L; otherwise, proceed to step H;
[0015] Step H. Generate new file path character strings equal in number to the total number of ciphertext files and redundant ciphertext files in step A to form new real path character strings, delete the ciphertext files under the paths of the real path character strings in step A, and then proceed to step I;
[0016] Step I. Get the current time string and combine it with the new hardware environment parameter information ciphertext string str verify , forming the current parameter string str end , and signed with the public key string str Sign is the public key, using the AES symmetric encryption algorithm for the current parameter string str end Perform symmetric encryption to generate a new ciphertext string str secret , and replace it with the new ciphertext string str secret Create a new ciphertext file for the content, and obtain new redundant ciphertext files corresponding to the new ciphertext file, the number of which is equal to the number of redundant ciphertext files in step A, and then proceed to step J;
[0017] Step J. Store the new ciphertext file and each new redundant ciphertext file in the new real path string path one by one, and sign the public key string str Sign The AES symmetric encryption algorithm is used to perform symmetric encryption on each new real path string to generate each new encrypted storage path string, and then each real path string and each encrypted storage path string in step A are deleted, and then step K is entered;
[0018] Step K. Determine that the current password-free login environment is safe, and connect to the server of the Android application to complete the current password-free login operation;
[0019] Step L: Determine that the current password-free login environment is unsafe, identify the current password-free login as a fake login, and stop the current password-free login operation.
[0020] As a preferred technical solution of the present invention: the hardware environment parameters include a device serial number string, a product model string, a mobile terminal manufacturer serial number string, and an Android system serial number string of the hardware environment where the Android application runs.
[0021] As a preferred technical solution of the present invention: Regarding the design in which the parameter string is composed of the hardware environment parameter information ciphertext string and the time string, based on the hardware environment parameter information string obtained from each MD5 ciphertext string in step D, and the time string, starting from the first character in the hardware environment parameter information string, each character in the time string is sequentially inserted between each adjacent character in the hardware environment parameter information string to form the parameter string; or starting from the first character in the hardware environment parameter information string in reverse order, each character in the time string is sequentially inserted between each adjacent character in the hardware environment parameter information string in reverse order to form the parameter string.
[0022] As a preferred technical solution of the present invention: in the step H, the directory / data / data / {app-package} / of the Android application is recursively traversed to obtain txt files whose file name length exceeds the preset character length and does not contain Chinese characters, and each txt file whose number is equal to the total number of ciphertext files and redundant ciphertext files in step A is randomly selected, and the value of the ASCII code of the characters in the path string of each txt file is added by 1 to obtain each new file path string to form each new real path string, delete the ciphertext files under the path of each real path string obtained in step A, and then enter step I.
[0023] As a preferred technical solution of the present invention: after deleting each real path string and each encrypted storage path string in step A in step J, the device serial number string, mobile phone model string, mobile phone manufacturer serial string, Android system serial number string, application user name string, runtime signature public key string str in the memory are Sign , each new real path string is cleared out of memory.
[0024] As a preferred technical solution of the present invention: in the step A, a static CeritificateFactory class object in the Android application is obtained, and the getPublicKey method of the static CeritificateFactory class object is called to obtain the Android application runtime signature public key string str Sign, and obtains through the SharedPreferences API the encrypted storage path string of the ciphertext file composed of the preset hardware environment parameter information, user name string, and time string when the Android application was successfully logged in last time, as well as the encrypted storage path string of at least one redundant ciphertext file corresponding to the ciphertext file.
[0025] As a preferred technical solution of the present invention: in the step D, the current hardware environment parameter information is obtained by calling the Android built-in tool Secure class API, and the user name string str running the Android application is obtained by calling the UserHandler system class API. User .
[0026] As a preferred technical solution of the present invention: in the step E, for the current hardware environment parameter information string str test Encoding, through UTF-8 encoding, obtain the corresponding current hardware environment parameter information binary array bitArray test ; and for the new hardware environment parameter information binary array bitArray new Decode and obtain the new hardware environment parameter information ciphertext string str through UTF-8 encoding verify .
[0027] As a preferred technical solution of the present invention: in the step G, the Linux file command is executed through the RunTime system class to obtain the ciphertext file modification time attribute value string under each real path string path obtained in step A.
[0028] As a preferred technical solution of the present invention: in the step I, the current time character string is obtained by calling the LocalDateTime class API.
[0029] The Android application login forgery identification method based on multiple environmental parameters described in the present invention adopts the above technical solution and has the following technical effects compared with the prior art:
[0030] (1) The Android application login forgery identification method based on multiple environment parameters designed by the present invention adopts a new design logic and is triggered by a password-free login. First, the differences between the stored ciphertext file and its redundant ciphertext file during the last successful login are compared. Then, based on the hardware environment parameter information ciphertext string and time string in the ciphertext file, the current hardware environment parameter information string and the time difference between the modification time of each ciphertext file are compared in turn, so as to realize the multi-dimensional security factor detection of the local environment of the Android application, and finally realize the password-free login operation in a secure environment. The whole scheme design enriches the diversity of parameter verification, which is not limited to the hardware environment parameters corresponding to the application operation, but also adds the executing application user name to jointly constitute the hardware environment parameter information, and combines the irreversible value of the timestamp attribute to soften it, so as to maximize the guarantee that the correct data is not modified. At the same time, a complex encryption mechanism is applied, and it is stored in confusion with the original file. By applying the multi-dimensional verification method of the local environment, the security of the application password-free login is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The present invention is a flowchart of an Android application login forgery identification method based on multiple environmental parameters. DETAILED DESCRIPTION
[0032] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0033] The present invention designs an Android application login forgery identification method based on multiple environmental parameters, which is used to realize the subsequent password-free login for the Android application after successfully logging into the Android application. In actual application, Figure 1 As shown, the password-free login operation triggers the execution of the following steps.
[0034] Step A. Get the static CeritificateFactory class object in the Android application, and call the getPublicKey method of the static CeritificateFactory class object to obtain the signature public key string str when the Android application is running Sign, and obtains through the SharedPreferences API the encrypted storage path string of the ciphertext file composed of the preset hardware environment parameter information, user name string, and time string when the Android application was successfully logged in last time, as well as the encrypted storage path string of at least one redundant ciphertext file corresponding to the ciphertext file, such as the encrypted storage path string tls1 of the ciphertext file "P1", and the encrypted storage path string tls2 of its corresponding redundant ciphertext file "P2", and the encrypted storage path string tls3 of the redundant ciphertext file "P3".
[0035] Then use the signature public key string str Sign is the public key, and the AES decryption algorithm is used to decrypt each encrypted storage path string tls1, tls2, and tls3 respectively, and it is determined whether each encrypted storage path string is decrypted successfully. If so, the real path strings tln1, tln2, and tln3 corresponding to each encrypted storage path string tls1, tls2, and tls3 are obtained, and step B is entered; otherwise, step L is entered.
[0036] In actual applications, the hardware environment parameters here can specifically be designed to include a device serial number string, a product model string, a mobile terminal manufacturer serial number string, and an Android system serial number string of the hardware environment where the Android application runs.
[0037] Step B. Obtain the ciphertext string str in the ciphertext file under each real path string path tln1, tln2, tln3 t1 , str t2 , str t3 , and judge each ciphertext string str t1 , str t2 , str t3 Are they the same? If yes, set the string str to be decrypted start str t1 , and go to step C; otherwise, go to step L.
[0038] Step C. Sign the public key string str Sign is the public key, and the AES decryption algorithm is used to decrypt the string str start Decryption is performed. If the decryption fails, the process goes to step L. If the decryption succeeds, the string str to be decrypted is obtained. start The corresponding parameter string str after decryption second , and get the parameter string str second The hardware environment parameter information ciphertext string str consists of the user name string and each hardware environment parameter information sbit, and the time string str vtime , then go to step D.
[0039] In actual applications, due to the design that the parameter string is composed of the hardware environment parameter information ciphertext string and the time string, based on the hardware environment parameter information string obtained from each MD5 ciphertext string in step D, and the time string, starting from the first character in the hardware environment parameter information string, each character in the time string is sequentially inserted between each adjacent character in the hardware environment parameter information string to form a parameter string; or starting from the first character in the hardware environment parameter information string in reverse order, each character in the time string is sequentially inserted between each adjacent character in the hardware environment parameter information string in reverse order to form a parameter string.
[0040] Therefore, based on the above reverse order, and the hardware environment parameter information ciphertext string is inserted in the time string in an odd position, combined with the MD5 encryption method, and when the total length of the parameter string is 55 characters, and the hardware environment parameter information ciphertext string is 32 characters and the time string is 23 characters, then for the parameter string str second , take out the characters from the 1st to the 9th and assign them to the previous ciphertext string str pre , the characters from bit 10 to bit 55 are converted into the latter character set and HCH = {h1, h2, ..., h 46}, and generate the ciphertext string str according to formula (1) next , generate the time parameter string str according to formula (2) vtime . Then the previous ciphertext string str pre And the following ciphertext string str next Concatenate and assign values to the environment parameter ciphertext string str sbit .
[0041] str next =h1&h3&h5&…&h 45 (1)
[0042] str vtime =h2&h4&h6&…&h 46 (2)
[0043] Step D. Get the current hardware environment parameter information through the Android built-in tool Secure class API call, and get the user name string str running the Android application through the UserHandler system class API call User , and use the MD5 algorithm to target the current hardware environment parameter information and the user name string strUser Encrypt to obtain each MD5 ciphertext string, and then perform XOR logic operation on each MD5 ciphertext string in a preset order to obtain the current hardware environment parameter information string str test , and go to step E.
[0044] In combination with the above specific design, each hardware environment parameter includes the device serial number string str of the hardware environment where the Android application runs Imei 、Product model string str Product 、Mobile terminal manufacturer sequence string str Seria 、Android system serial number string str AndroidId , the MD5 algorithm is used to convert the device serial number string str Imei Encrypted into MD5 ciphertext string a, the product model string str Product Encrypted into MD5 ciphertext string b, the mobile phone manufacturer serial string str Serial Encrypted to MD5 ciphertext string c, the Android system serial number string str AndroidId Encrypted to MD5 ciphertext string d, and the application user name string str User Encrypted into MD5 ciphertext string e, and further according to formula (3), combined with the preset order, perform XOR logic operation on each MD5 ciphertext string to obtain the current hardware environment parameter information string str test .
[0045]
[0046] Step E. Targeting the current hardware environment parameter information string str test Encoding, through UTF-8 encoding, obtain the corresponding current hardware environment parameter information binary array bitArray test , and create an empty new hardware environment parameter information binary array bitArray new ; Then traverse the bitArray in order test Each element in, if the element value is 0, then in the new hardware environment parameter information binary array bitArray new Insert two element values 0 and 1 at the end of the bitArray. If the element value is 1, then the new hardware environment parameter information binary array bitArray new Insert two element values 1 and 0 at the end of the bitArray test After traversing each element in the new hardware environment parameter information binary array bitArray newDecode and obtain the new hardware environment parameter information ciphertext string str through UTF-8 encoding verify , proceed to step F.
[0047] Step F. Determine the hardware environment parameter information ciphertext string str sbit The encrypted string str of the new hardware environment parameter information verify If they are equal, go to step G; otherwise, go to step L.
[0048] Step G. Execute the Linux file command through the RunTime system class to obtain the ciphertext file modification time attribute value string str under each real path string tln1, tln2, tln3 path obtained in step A sec1 , str sec2 , str sec3 , and get str vtime The modification time attribute value string str of each ciphertext file sec1 , str sec2 , str sec3 The time difference between the corresponding times is determined to determine whether there is a time difference exceeding a preset time limit such as 5 minutes. If so, the process goes to step L; otherwise, the process goes to step H. In actual applications, further design can be performed such as specifically determining whether there are at least two time differences exceeding a preset time limit such as 5 minutes. If so, the process goes to step L; otherwise, the process goes to step H.
[0049] Step H. Generate new file path character strings whose number is equal to the total number of ciphertext files and redundant ciphertext files in step A to form new real path character strings, delete the ciphertext files under the paths of the real path character strings in step A, and then proceed to step I.
[0050] In a specific practical application, the above step H recursively traverses the directory / data / data / {app-package} / of the Android application to obtain txt files whose file name length exceeds a preset character length such as 10 characters and does not contain Chinese characters, and randomly selects txt files whose number is equal to the total number of ciphertext files and redundant ciphertext files in step A, and adds 1 to the value of the ASCII code of the characters in the path string of each txt file to obtain each new file path string tlnew1, tlnew2, tlnew3 to form each new real path string, delete the ciphertext files under the real path string paths tln1, tln2, tln3 obtained in step A, and then enter step I.
[0051] Step I. Get the current time string str through the LocalDateTime class API call time, and combined with the new hardware environment parameter information ciphertext string str verify , forming the current parameter string str end , and signed with the public key string str Sign is the public key, using the AES symmetric encryption algorithm for the current parameter string str end Perform symmetric encryption to generate a new ciphertext string str secret , and replace it with the new ciphertext string str secret Create a new ciphertext file for the content, and obtain new redundant ciphertext files corresponding to the new ciphertext file. The number of the new redundant ciphertext files is equal to the number of redundant ciphertext files in step A, and then enter step J.
[0052] This corresponds to the specific parameter string structure of step C above. In actual application, step I here is based on the current time string str time , New hardware environment parameter information ciphertext string str verify , str verify Assign the first to the ninth characters to the string str that stores the previous segment pp , the characters from the 10th to the 32nd bit are converted to the storage back segment character set Mid = {m1, m2, ..., m 23}, the time string str time Converted into time character set Time = {t1, t2, ..., t 23}, through formula (4), we can get the ciphertext string str end , and further obtain the new ciphertext string str secret .
[0053] str end =str pp &m1&t1&…&m i &t i &…&m 23 &t 23 (4)
[0054] Step J. Store the new ciphertext file and each new redundant ciphertext file in the new real path string tlnew1, tlnew2, tlnew3 path one by one, and sign the ciphertext file with the signature public key string str SignThe public key is used, and the AES symmetric encryption algorithm is used to perform symmetric encryption on each new real path string tlnew1, tlnew2, and tlnew3 to generate each new encrypted storage path string tlsew1, tlsew2, and tlsew3. Then, the real path strings tln1, tln2, and tln3 in step A and the encrypted storage path strings tls1, tls2, and tls3 are deleted, and then step K is entered.
[0055] After deleting the real path strings tln1, tln2, tln3 and the encrypted storage path strings tls1, tls2, tls3 in step A in step J, a further design can be made to convert the device serial number string str in the memory into Imei 、Product model string str Product 、Mobile terminal manufacturer sequence string str Seria 、Android system serial number string str AndroidId , application user name string, runtime signature public key string str Sign , each new real path string is cleared out of memory.
[0056] Step K: Determine that the current password-free login environment is safe, and connect to the server of the Android application to complete the current password-free login operation.
[0057] Step L: Determine that the current password-free login environment is unsafe, identify the current password-free login as a fake login, and stop the current password-free login operation.
[0058] The above-designed Android application login forgery identification method based on multiple environmental parameters is applied in practice. The verified file permission modification timestamp information is that once the file permission is modified, the current system time will be assigned to the file attribute. Therefore, after the program extracts and encrypts the current environmental parameters for storage, the file modification time is recorded. If the file is lost or modified, the corresponding file attribute will be modified. However, since time is irreversible, if the corresponding file is forged later, the timestamp information will not correspond. The public key of the app author's signature information is the key to prevent secondary packaging. The public key of the secondary packaged apk must be different from the public key information of the original author to prevent changes to the Android source code.
[0059] The timestamp information and the extracted parameters are combined in bytes, which not only encrypts the extracted parameter information with the timestamp, but also facilitates the subsequent extraction of the timestamp information. Multiple copies of the file storing the information are stored and mixed with the local files to hide the information of interest, which can increase the difficulty for reversers to find the file.
[0060] The Android application login forgery identification method based on multiple environment parameters designed by the above technical scheme adopts a new design logic and is triggered by password-free login. First, the differences between the stored ciphertext file and its redundant ciphertext file during the last successful login are compared. Then, based on the hardware environment parameter information ciphertext string and time string in the ciphertext file, the current hardware environment parameter information string and the time difference between the modification time of each ciphertext file are compared in turn, so as to realize multi-dimensional security factor detection of the local environment of the Android application, and finally realize the password-free login operation in a secure environment. The whole scheme design enriches the diversity of parameter verification, which is not limited to the hardware environment parameters corresponding to the application operation, but also adds the executing application user name to jointly constitute the hardware environment parameter information, and combines the irreversible value of the timestamp attribute to soften it, so as to maximize the guarantee that the correct data is not modified. At the same time, a complex encryption mechanism is applied, and it is stored in confusion with the original file. By applying the multi-dimensional verification method of the local environment, the security of the application password-free login is improved.
[0061] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A method for identifying forged Android application login based on multiple environmental parameters, which is used to implement subsequent password-free login for the Android application after successfully logging into the Android application, characterized in that: The password-free login operation triggers the following steps: Step A. Get the signature public key string str when the Android application is running Sign , and obtain the encrypted storage path string of the ciphertext file composed of the preset hardware environment parameter information, user name string, and time string when the Android application was successfully logged in last time, as well as the encrypted storage path string of at least one redundant ciphertext file corresponding to the ciphertext file, and then use the signature public key string str Sign is the public key, and the AES decryption algorithm is used to decrypt each encrypted storage path string respectively, and it is determined whether each encrypted storage path string is successfully decrypted. If yes, the real path string corresponding to each encrypted storage path string is obtained, and the process goes to step B; Otherwise, go to step L; Step B. Get the ciphertext string in the ciphertext file under each real path string path, and determine whether the ciphertext strings are the same. If so, set the string to be decrypted str start is the ciphertext string, and proceed to step C; otherwise, proceed to step L; Step C. Use the signature public key string str Sign is the public key, and the AES decryption algorithm is used to decrypt the string str start Decryption is performed. If the decryption fails, the process goes to step L; If the decryption is successful, the string str to be decrypted is obtained start The corresponding parameter string str after decryption second , and get the parameter string str second The hardware environment parameter information ciphertext string str consists of the user name string and each hardware environment parameter information sbit , and the time string str vtime , then proceed to step D; Step D. Obtain the current hardware environment parameter information and the user name string str that runs the Android application User , and use the MD5 algorithm to target the current hardware environment parameter information and the user name string str User Encrypt to obtain each MD5 ciphertext string, and then perform XOR logic operation on each MD5 ciphertext string in a preset order to obtain the current hardware environment parameter information string str test , and proceed to step E; Step E. Targeting the current hardware environment parameter information string str test Encode and obtain the corresponding current hardware environment parameter information binary array bitArray test , and create an empty new hardware environment parameter information binary array bitArray new ; Then traverse the bitArray in order test Each element in, if the element value is 0, then in the new hardware environment parameter information binary array bitArray new Insert two element values 0 and 1 at the end of the bitArray. If the element value is 1, then the new hardware environment parameter information binary array bitArray new Insert two element values 1 and 0 at the end of the bitArray test After traversing each element in the new hardware environment parameter information binary array bitArray new Decode and obtain the new hardware environment parameter information ciphertext string str verify , proceed to step F; Step F. Determine the hardware environment parameter information ciphertext string str sbit The encrypted string str of the new hardware environment parameter information verify Are they equal? If yes, go to step G; Otherwise, go to step L; Step G. Obtain the ciphertext file modification time attribute value string under each real path string path obtained in step A, and obtain str vtime The time difference between each ciphertext file modification time attribute value character string and the time corresponding to the time, and determine whether there is a time difference exceeding the preset time limit, if yes, proceed to step L; otherwise, proceed to step H; Step H. Generate new file path character strings equal in number to the total number of ciphertext files and redundant ciphertext files in step A to form new real path character strings, delete the ciphertext files under the paths of the real path character strings in step A, and then proceed to step I; Step I. Get the current time string and combine it with the new hardware environment parameter information ciphertext string str verify , forming the current parameter string str end , and signed with the public key string str Sign is the public key, using the AES symmetric encryption algorithm for the current parameter string str end Perform symmetric encryption to generate a new ciphertext string str secret , and replace it with the new ciphertext string str secret Create a new ciphertext file for the content, and obtain new redundant ciphertext files corresponding to the new ciphertext file, the number of which is equal to the number of redundant ciphertext files in step A, and then proceed to step J; Step J. Store the new ciphertext file and each new redundant ciphertext file in the new real path string path one by one, and sign the public key string str Sign The AES symmetric encryption algorithm is used to perform symmetric encryption on each new real path string to generate each new encrypted storage path string, and then each real path string and each encrypted storage path string in step A are deleted, and then step K is entered; Step K. Determine that the current password-free login environment is safe, and connect to the server of the Android application to complete the current password-free login operation; Step L: Determine that the current password-free login environment is unsafe, identify the current password-free login as a fake login, and stop the current password-free login operation.
2. According to claim 1, a method for identifying Android application login forgery based on multiple environmental parameters is characterized in that: The hardware environment parameters include a device serial number string, a product model string, a mobile terminal manufacturer serial number string, and an Android system serial number string of the hardware environment where the Android application runs.
3. According to claim 1, a method for identifying forged Android application login based on multiple environmental parameters, characterized in that: Regarding the design in which the parameter string is composed of the hardware environment parameter information ciphertext string and the time string, based on the hardware environment parameter information string obtained from each MD5 ciphertext string in step D, and the time string, starting from the first character in the hardware environment parameter information string, each character in the time string is sequentially inserted between each adjacent character in the hardware environment parameter information string to form the parameter string; or starting from the first character in the hardware environment parameter information string in reverse order, each character in the time string is sequentially inserted between each adjacent character in the hardware environment parameter information string in reverse order to form the parameter string.
4. According to claim 1, a method for identifying forged Android application login based on multiple environmental parameters, characterized in that: In the step H, the directory / data / data / {app-package} / of the Android application is recursively traversed to obtain txt files whose file name length exceeds the preset character length and does not contain Chinese characters, and each txt file whose number is equal to the total number of ciphertext files and redundant ciphertext files in step A is randomly selected, and the value of the ASCII code of the characters in the path string of each txt file is added by 1 to obtain each new file path string to form each new real path string, and the ciphertext files under the path of each real path string obtained in step A are deleted, and then step I is entered.
5. According to claim 1, a method for identifying Android application login forgery based on multiple environmental parameters, characterized in that: After deleting each real path string and each encrypted storage path string in step A in step J, the device serial number string, mobile phone model string, mobile phone manufacturer serial string, Android system serial number string, application user name string, runtime signature public key string str in the memory are Sign , each new real path string is cleared out of memory.
6. According to claim 1, a method for identifying forged Android application login based on multiple environmental parameters, characterized in that: In step A, a static CeritificateFactory class object in the Android application is obtained, and the getPublicKey method of the static CeritificateFactory class object is called to obtain the Android application runtime signature public key string str Sign , and obtains through the SharedPreferences API the encrypted storage path string of the ciphertext file composed of the preset hardware environment parameter information, user name string, and time string when the Android application was successfully logged in last time, as well as the encrypted storage path string of at least one redundant ciphertext file corresponding to the ciphertext file.
7. According to claim 1, a method for identifying forged Android application login based on multiple environmental parameters, characterized in that: In the step D, the current hardware environment parameter information is obtained by calling the Android built-in tool Secure class API, and the user name string str running the Android application is obtained by calling the UserHandler system class API. User .
8. According to claim 1, a method for identifying forged Android application login based on multiple environmental parameters, characterized in that: In the step E, for the current hardware environment parameter information string str test Encoding, through UTF-8 encoding, obtain the corresponding current hardware environment parameter information binary array bitArray test ; and for the new hardware environment parameter information binary array bitArray new Decode and obtain the new hardware environment parameter information ciphertext string str through UTF-8 encoding verify .
9. According to claim 1, a method for identifying forged Android application login based on multiple environmental parameters, characterized in that: In step G, the Linux file command is executed through the RunTime system class to obtain the ciphertext file modification time attribute value string under each real path string path obtained in step A.
10. The method for identifying forged Android application login based on multiple environmental parameters according to claim 1, characterized in that: In the step I, the current time string is obtained by calling the LocalDateTime class API.
Citation Information
Patent Citations
A secure authentication method for a mobile terminal to send a login request to a server
CN109040148A
Multi-App single sign-on method, apparatus and device, and storage medium
CN111475798A
