WO2019114122A1 - 登录信息的加密方法、装置、电子设备及介质 - Google Patents

登录信息的加密方法、装置、电子设备及介质 Download PDF

Info

Publication number
WO2019114122A1
WO2019114122A1 PCT/CN2018/074868 CN2018074868W WO2019114122A1 WO 2019114122 A1 WO2019114122 A1 WO 2019114122A1 CN 2018074868 W CN2018074868 W CN 2018074868W WO 2019114122 A1 WO2019114122 A1 WO 2019114122A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
group
feature group
string
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/074868
Other languages
English (en)
French (fr)
Inventor
刘继超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2019114122A1 publication Critical patent/WO2019114122A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords

Definitions

  • the present application belongs to the field of data processing technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for encrypting login information.
  • login information generally include a login name and a password.
  • the login information input by the user matches the data pre-stored in the server, the user can remotely use the permission corresponding to the login information. And data.
  • the user often selects the "automatic login next time" mode. At this time, the user name and password are encrypted as login information and saved in the local device. When the user needs to log in again next time, only You need to call the locally stored login information to log in automatically.
  • the encryption key currently used to encrypt the login information is hard-coded. You can see the fixed encryption key by opening the software with a text editor such as EditPlus, and since the encryption key is hard-coded, it is device-independent. After the hacker intercepts the ciphertext of the login information, the ciphertext of the login information can be directly logged in as the stolen user by other devices, so the encryption method of the current login information is less secure.
  • the present application provides a method, an apparatus, an electronic device and a medium for encrypting login information, so as to solve the problem of poor security existing in the encryption and storage process of login information in the prior art.
  • a first aspect of the embodiment of the present application provides a method for encrypting login information, including:
  • the character string is divided into a plurality of feature groups, and the feature group includes characters of a preset number of bits; and the feature group summary of each of the feature groups is sequentially calculated according to the position of the feature string in the feature group, and the feature group is finally
  • a feature group summary of a feature group is used as a device fingerprint; the device fingerprint is converted into an encryption key that meets a preset encryption algorithm format requirement; and the login is performed using the encryption key according to the preset encryption algorithm.
  • the information is encrypted to generate a login ciphertext.
  • a second aspect of the embodiment of the present application provides an encryption device for login information, including:
  • the obtaining unit is configured to obtain the login information and the feature code of the device, and rearrange the feature code into a feature string according to a preset rule.
  • a grouping unit configured to complement the feature string, generate a padding string, and divide the padding string into a plurality of feature groups, where the feature group includes characters of a preset number of bits.
  • a summary calculation unit configured to sequentially calculate a feature group summary of each of the feature groups according to the location of the feature string, and use a feature group summary of the last feature group as a device fingerprint.
  • the key generation unit is configured to convert the device fingerprint into an encryption key that meets a preset encryption algorithm format requirement.
  • an encryption unit configured to encrypt the login information by using the encryption key according to the preset encryption algorithm to generate a login ciphertext.
  • a third aspect of the embodiments of the present application provides an encrypted electronic device for login information, including a memory, a processor, and the computer storing computer readable instructions executable on the processor, the processor executing The computer readable instructions implement the following steps:
  • the character string is divided into a plurality of feature groups, and the feature group includes characters of a preset number of bits;
  • the feature group summary of each feature group, and characterizing the feature group summary of the last feature group as a device fingerprint Performing, according to the location of the complement string, the feature group summary of each feature group, and characterizing the feature group summary of the last feature group as a device fingerprint; converting the device fingerprint into a preset The encryption key required by the encryption algorithm format; according to the preset encryption algorithm, the login information is encrypted using the encryption key to generate a login ciphertext.
  • a fourth aspect of the embodiments of the present application provides a computer readable storage medium storing computer readable instructions, wherein the computer readable instructions are implemented by at least one processor The following steps:
  • the character string is divided into a plurality of feature groups, and the feature group includes characters of a preset number of bits; and the feature group summary of each of the feature groups is sequentially calculated according to the position of the feature string in the feature group, and the feature group is finally
  • a feature group summary of a feature group is used as a device fingerprint; the device fingerprint is converted into an encryption key that meets a preset encryption algorithm format requirement; and the login is performed using the encryption key according to the preset encryption algorithm.
  • the information is encrypted to generate a login ciphertext.
  • the method obtains the feature code of the device, rearranges the feature code according to a preset rule, converts the feature code into a feature string, complements the feature string, generates a complement string, and complements the character according to the feature group.
  • the location of the string, the feature group summary of each feature group is calculated in turn, and the feature group summary of the last feature group is used as a device fingerprint, and the device fingerprint is converted into an encryption key that can be used for encryption, and is used by a preset encryption algorithm.
  • the login information is encrypted according to the encryption key obtained by the device fingerprint, and the login ciphertext is generated, so that different devices have encryption keys different from other devices, and even if others obtain the encryption algorithm and the login ciphertext, the login ciphertext cannot be performed. Decryption can better ensure that the user's login information is not stolen by others.
  • 1 is a flowchart of implementing an encryption method of login information provided by the present application
  • FIG. 3 is a specific implementation flowchart of an encryption method S1034 of login information provided by the present application.
  • FIG. 4 is a structural block diagram of an encryption apparatus for login information provided by the present application.
  • FIG. 5 is a schematic diagram of a terminal device provided by the present application.
  • FIG. 1 shows an implementation flow of an encryption method for login information provided by the present application, and the method flow includes steps S101 to S105.
  • the specific implementation principle of each step is as follows.
  • S101 Acquire login information and a feature code of the device, and re-arrange the feature code into a feature string according to a preset rule.
  • the encryption device of the login information acquires the login information of the user.
  • the login information of the user includes the user name and password.
  • the feature code of the device in addition to obtaining the login information, it is necessary to acquire the feature code of the device.
  • the terminal device currently used by people has its own unique feature code.
  • the feature code may be a unique identification code of a physical component such as a motherboard, a CPU, a hard disk or a network card, or may be a serial number of an operating system.
  • the CPU identification code is used as the feature code of the device, and if the CPU identification code is BFEBFBF000206A, the feature code of the device is BFEBFBF000206A.
  • the feature code needs to be rearranged according to a preset rule.
  • the preset rule is: the first bit and the sixth bit of the feature code are exchanged; The second and seventh places are exchanged.
  • the feature code BFEBFBF000206206A in the above example becomes BFEBFBF6A02000 after being rearranged by the preset rule.
  • the purpose of rearranging and combining the feature codes in the present application is to make it impossible for a hacker to directly extract the CPU identification code and derive the device fingerprint in the subsequent calculation.
  • the feature code is re-arranged according to a preset rule, and then converted into a feature string of a preset hexadecimal, optionally,
  • the feature string is a binary string.
  • the feature code BBFBFBF000206A in the above example is rearranged according to a preset rule and converted into a binary feature string 101111111110101111111011111111110110101000000010000000000000.
  • the security of the entire encryption algorithm is improved by rearranging the feature codes of the device, and the conversion of the feature code makes the feature code more suitable for subsequent encryption calculation.
  • S102 Complement the feature string, generate a complement string, and divide the complement string into a plurality of feature groups, where the feature group includes characters of a preset number of bits.
  • the character string used for calculating the fingerprint of the device is relatively long in order to meet the security requirement, the length of the feature code string directly converted by the feature code cannot satisfy the requirement, so the feature string needs to be performed. Complement, generate a complement string that satisfies the subsequent calculation requirements.
  • the performing the complementing of the character string comprises: adding one or more characters 0 after adding the character 1 to the last character of the feature string, until the feature string is in the bit after the complement The remainder after dividing the number by the first preset number is equal to the second preset number.
  • the first preset number may be set to 512
  • the second preset number may be set to 448. Since the length of the original feature string can be represented by a 64-bit string, the complement is complemented. The trailing complement string is exactly an integer multiple of the first preset number.
  • the complement string is divided into a plurality of feature groups. It can be understood that the number of characters included in each feature group is a first preset number.
  • S103 Calculate a feature group summary of each of the feature groups in sequence according to the location of the feature string, and use a feature group summary of the last feature group as a device fingerprint.
  • the present application proposes an algorithm to calculate the summary of the complement string, and The digest of the string is used as a device fingerprint, so that even if the hacker acquires the feature code of the device, it is difficult to determine the device fingerprint.
  • the foregoing S103 includes:
  • S1031 Determine a calculation order of the feature group according to the location of the feature string in the feature group.
  • a complement string may be divided into a plurality of feature groups.
  • each preset number of characters is used as a feature from the leftmost side of the complement string. group.
  • the calculation sequence of the feature set is: calculating the feature group summary of each feature group in order from the left to the right according to the position of the feature group, and calculating the feature of each feature group. The method of group summary will be detailed below.
  • S1032 Acquire a preset summary, and use the preset summary as an initial summary of the first feature group, where the first feature group is a feature group that is first calculated according to the calculation order.
  • the algorithm there are two input parameters of the algorithm, one is a character string included in the feature group, and the other is an initial summary corresponding to the feature group, wherein the initial summary of the first feature group is a preset summary.
  • S1033 Calculate a feature group summary of the first feature group by using an initial summary of the first feature group and the first feature group as an input value.
  • the feature group summary of the previous feature group is used as an initial summary of the next feature group; and the initial summary of the feature group and the feature group is sequentially performed as an input value for each feature group, and the calculation is performed.
  • the operation of the feature group summary of the feature group is performed until the feature group summary of the last feature group is calculated, and the feature group summary of the last feature group is used as the device fingerprint.
  • FIG. 3 shows a specific implementation process of the encryption method S1034 of the login information provided by the present application, which is described in detail as follows:
  • the feature component is divided into M feature subgroups, and the M feature subgroups are expanded into N feature subgroups according to a preset extension rule, and the N feature subgroups are respectively numbered.
  • the M is an integer greater than 1
  • the N is an integer greater than M.
  • each feature subgroup is composed of a number of binary strings.
  • the extension rule for expanding the M feature subgroups into the N feature subgroups may be: assuming that the feature subgroups are numbered t, each feature subgroup before the extension is represented by X(t), and each extended The feature subgroup is represented by Y(t).
  • X(t) Y(t);
  • Y(t) X(t-1) ⁇ X(t- 3) ⁇ X(t-10) ⁇ X(t-14).
  • " ⁇ " is the "exclusive OR" operator.
  • extension rule is only an example, and other extension rules based on the original feature subgroup can be used to extend the feature subgroup, since one purpose of the present application is to generate a dynamic encryption key by using the feature code of the device. Therefore, the device fingerprint can also be dynamic, so the value of N and the extension rule can be changed.
  • S10342 The initial summary of the feature set is divided into L initial summary groups according to an arrangement order, and are respectively the initial summary group numbers.
  • the L is an integer greater than one.
  • a complete initial summary is divided into five initial summary groups, and each initial summary group is numbered, and a first initial summary group, a second initial summary group, and a third initial summary group are generated.
  • the fourth initial summary group and the fifth initial summary group Understandably, the user can adjust the number of initial summary groups according to actual conditions.
  • the assignment and shift calculations are to be performed later, it is necessary to set the same cache group as the initial summary group.
  • the number of initial digest groups is five, five cache groups are set, and for each cache group, the first cache group, the second cache group, the third cache group, the fourth cache group, and the first Five cache groups.
  • the number of rounds of repeatedly calculating the data in the cache group is equal to the number of extended feature subsets to ensure that the relevant steps in the subsequent assignment calculation process can be smoothly performed.
  • the initial value of the shift of the shift assignment calculation is 1, that is, when the first shift assignment calculation is performed, the round of the shift assignment calculation is 1.
  • S10345 If the round of the shift assignment calculation is less than N, perform a new round of performing shift assignment calculation, where the shift assignment calculation includes: after shifting the data of each cache group into the latter cache group, Adding the data of the current first cache group to the data of the corresponding feature subgroup as the new data of the first cache group to update the first cache group, and adding the round of the shift assignment calculation 1, and return to S10344.
  • first cache group 1001010, second cache group: 1000111; third cache group: 1010101; fourth cache group: 1000001; fifth cache group: 1000000
  • the first cache group is the first cache group of the second cache group in the application, and the order of the cache groups is the first cache group, the second cache group, the third cache group, the fourth cache group, and the fifth cache. group.
  • the data in each cache group is obtained by shifting the data of each cache group into the next cache group: the second cache group: 1001010; the third cache group: 1001111;
  • the fourth cache group 1010101; the fifth cache group: 1000001.
  • the data of the first cache group (the first cache group) needs to be added to the feature subset of number 6.
  • the round of the shift assignment calculation is incremented by 1, and the process returns to S10344 to continue the determination.
  • the data in each cache group after the N-round shift assignment calculation is: first cache group: 1001011, second cache group: 1010111, third cache group: 1011101, fourth cache group: 1000111;
  • the fifth cache group: 1000100 the feature group summary of the feature group is data that combines five cache groups in an order of arrangement, that is, 10010111010111101110110001111000100.
  • the feature group summary of one feature group is quickly and efficiently calculated by performing multiple shift assignment calculations in a loop, and the feature group summary of the previous feature group is used as the initial summary of the next feature group, as described in S1034. Performing an operation of shift assignment calculation on each feature group until the feature group summary of the last feature group is calculated, and the feature group summary of the last feature group is used as a device fingerprint.
  • S104 Convert the device fingerprint into an encryption key that meets a preset encryption algorithm format requirement.
  • the encryption method there is a process of calculating the digest and an encryption process from acquiring the feature code of the device to the ciphertext generating the login information.
  • the process of calculating the digest is to generate a device fingerprint according to the feature code of the device, and the encryption process is to encrypt the login information according to the encryption key to generate the ciphertext of the login information. Since the process of calculating the digest is different from the algorithm used by the encryption process, the device fingerprint may not be directly used as the encrypted encryption key, so the device fingerprint needs to be converted.
  • the preset correspondence is obtained, where the correspondence includes a correspondence between the encryption algorithm and the encryption key format, and the corresponding encryption relationship is used to analyze the encryption algorithm to be used in the subsequent second encryption process.
  • Encryption key format The fingerprint of the device is converted into an encryption key that meets the requirements of the preset encryption algorithm format by means of complement and digital conversion.
  • the application can convert the encryption key in the subsequent encryption process by using the device fingerprint. Since the device fingerprint is dynamically determined according to the feature code of different devices, it is not a fixed hard code, so it is difficult for others to crack the encryption key. .
  • S105 Encrypt the login information by using the encryption key according to the preset encryption algorithm to generate a login ciphertext.
  • the encryption key is converted from the device fingerprint according to the correspondence between the preset encryption algorithm and the encryption key format, the encryption key generated according to the above steps can be directly applied to the preset encryption algorithm.
  • the login information is used as an input value of the preset encryption algorithm, and the login ciphertext can be calculated by using a preset encryption algorithm. Specifically, the login information is converted into a plaintext matrix.
  • the login information since the login information includes a login name and a password, the login information may include decimal numbers, letters, and Chinese characters, wherein the decimal digits may be directly converted into binary strings; the letters may be based on ASC.
  • the II code is converted into a binary string; the Chinese character can be converted into a binary string according to the UTF-8 encoding.
  • the login information can be converted into a set of binary strings, and then the set of binary strings is sequentially arranged into a matrix of a preset number of columns as a plaintext matrix, and the last line of the plaintext matrix is added. A number of zeros are used to complete the last line of the plaintext matrix.
  • the plaintext matrix performs a row shift operation, a column obfuscation operation, and a round key addition operation by using the encryption key to generate a login ciphertext.
  • the plaintext matrix may be subjected to a shift operation, a column confusion operation, and a round key addition operation according to the AES encryption algorithm, and the output result of the AES encryption algorithm is the login ciphertext.
  • the login ciphertext is stored in the memory of the device, and the next time the user needs to log in, the login ciphertext is decrypted to obtain the login name and password.
  • the feature code is rearranged according to a preset rule, and then converted into a feature string, and the feature string is complemented to generate a complement string, according to the feature group.
  • the position of the complement string is calculated, and the feature group summary of each feature group is calculated in turn, and the feature group summary of the last feature group is used as a device fingerprint, and the device fingerprint is converted into an encryption key usable for encryption, through a preset
  • the encryption algorithm encrypts the login information by using the encryption key obtained from the fingerprint of the device, and generates a login ciphertext, so that different devices have encryption keys different from other devices, and even if others obtain the encryption algorithm and the login ciphertext, the encryption algorithm cannot By logging in to the ciphertext for decryption, it is better to ensure that the user's login information is not stolen by others.
  • FIG. 4 is a block diagram showing the structure of the encryption device of the login information provided by the present application. For the convenience of description, only the parts related to the present application are shown.
  • the apparatus includes:
  • the obtaining unit 401 is configured to obtain the login information and the feature code of the device, and re-arrange the feature code into a feature string according to a preset rule.
  • the grouping unit 402 is configured to complement the feature string, generate a complement string, and divide the pad string into a plurality of feature groups, where the feature group includes characters of a preset number of bits.
  • the summary calculation unit 403 is configured to sequentially calculate the feature group summary of each feature group according to the position of the feature string in the feature group, and use the feature group summary of the last feature group as the device fingerprint.
  • the key generation unit 404 is configured to convert the device fingerprint into an encryption key that meets a preset encryption algorithm format requirement.
  • the encryption unit 405 is configured to encrypt the login information by using the encryption key according to the preset encryption algorithm to generate a login ciphertext.
  • the grouping unit 402 includes:
  • a complement subunit configured to continue adding one or more characters 0 after adding the character 1 to the last character of the feature string, until the remainder of the feature string after the complement is divided by the first preset number Equal to the second preset number.
  • the digest calculation unit 403 includes:
  • the sequence determining subunit is configured to determine a calculation order of the feature group according to the location of the feature string in the feature string.
  • the summary obtaining sub-unit is configured to obtain a preset digest, and the preset digest is used as an initial digest of the first feature set, and the first feature set is a feature set that is first calculated according to the calculation order.
  • a first summary calculation sub-unit configured to use the initial feature of the first feature group and the first feature group as an input value, and calculate a feature group summary of the first feature group.
  • a second summary calculation subunit configured to use the feature group summary of the previous feature group as an initial summary of the next feature group according to the calculation order.
  • the second digest computing subunit is specifically configured to:
  • the feature component is divided into M feature subgroups, and the M feature subgroups are expanded into N feature subgroups according to a preset extension rule, and the N feature subgroups are respectively numbered, and the M is An integer greater than 1, the N being an integer greater than M.
  • the initial summary of the feature set is divided into L initial summary groups according to an arrangement order, and is respectively the initial summary group number, and the L is an integer greater than 1. Setting the L cache groups and respectively numbering the cache groups.
  • the data of each of the initial summary groups is respectively stored in the cache group with the same number, and the N-round shift assignment calculation is performed cyclically, and the shift assignment calculation includes: after shifting the data of each cache group After a cache group, the data of the current first cache group is added to the data of the corresponding feature subgroup as the data of the new first cache group to update the first cache group, and the corresponding feature The number of the subgroup is the same as the number of rotations currently calculated for the shift assignment.
  • the data in each cache group after the N-round shift assignment calculation is combined as a feature group summary of the feature group.
  • the encryption unit 405 includes:
  • a matrix generation subunit is configured to convert the login information into a plaintext matrix.
  • a cryptographic operation subunit configured to perform a row shift operation, a column confusing operation, and a round key addition operation by using the cryptographic key to generate a login ciphertext.
  • the feature code is rearranged according to a preset rule, and then converted into a feature string, and the feature string is complemented to generate a complement string, according to the feature group.
  • the position of the complement string is calculated, and the feature group summary of each feature group is calculated in turn, and the feature group summary of the last feature group is used as a device fingerprint, and the device fingerprint is converted into an encryption key usable for encryption, through a preset
  • the encryption algorithm encrypts the login information by using the encryption key obtained from the fingerprint of the device, and generates a login ciphertext, so that different devices have encryption keys different from other devices, and even if others obtain the encryption algorithm and the login ciphertext, the encryption algorithm cannot By logging in to the ciphertext for decryption, it is better to ensure that the user's login information is not stolen by others.
  • FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • the electronic device 5 of this embodiment includes a processor 50, a memory 51, and computer readable instructions 52 stored in the memory 51 and operable on the processor 50, such as login information. Encryption program.
  • the steps in the embodiment of the encryption method for implementing the above-mentioned various login information when the processor 50 executes the computer readable instructions 52 such as steps 101 to 105 shown in FIG.
  • the processor 50 executes the computer readable instructions 52
  • the functions of the modules/units in the above various device embodiments are implemented, such as the functions of the units 401 to 405 shown in FIG.
  • the computer readable instructions 52 may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 50, To complete this application.
  • the one or more modules/units may be a series of computer readable instruction instructions segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer readable instructions 52 in the electronic device 5.
  • the electronic device 5 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the electronic device may include, but is not limited to, a processor 50, a memory 51. It will be understood by those skilled in the art that FIG. 5 is only an example of the electronic device 5, and does not constitute a limitation on the electronic device 5, and may include more or less components than those illustrated, or combine some components, or different components.
  • the electronic device may further include an input and output device, a network access device, a bus, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Storage Device Security (AREA)
  • Collating Specific Patterns (AREA)

Abstract

本方案适用于互联网技术领域,提供了一种登录信息的加密方法、装置、电子设备及介质,通过获取设备的特征码,按照预设规则将所述特征码重新排列后转换为特征字符串,对所述特征字符串进行补位,生成补位字符串,按照特征组在补位字符串的位置,依次计算各个特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹,将所述设备指纹转换为可用于进行加密的加密密钥,通过预设的加密算法使用根据设备指纹得到的加密密钥对登录信息进行加密,生成登录密文,使得不同的设备具有区别于其他设备的加密密钥,他人即使获取了加密算法以及登录密文,也无法对登录密文进行解密,可以更好地保证用户的登录信息不被他人盗用。

Description

登录信息的加密方法、装置、电子设备及介质
本申请要求于2017年12月14日提交中国专利局、申请号为201711339852.3、发明名称为“登录信息的加密方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于数据处理技术领域,尤其涉及一种登录信息的加密方法、装置、电子设备及介质。
背景技术
目前,人们在使用互联网时经常需要输入登录信息,这些登录信息一般包括登录名和密码,当用户输入的登录信息与服务器中预先存储的数据相匹配时,用户就可以远程使用该登录信息对应的权限和数据。现有技术中,为了登录方便,用户往往会选择“下次自动登录”的方式,此时用户名和密码将作为登录信息被加密后保存在本地设备中,当用户下次再需要登录时,只需调用本地存储的登录信息就可以自动登录。
但是当前用于为登录信息加密的加密密钥是硬编码的,通过EditPlus等文本编辑器打开软件就可以看到固定的加密秘钥,而且由于加密密钥是硬编码的,因此与设备无关,当黑客截获了登录信息的密文之后,可以在其他设备直接使用登录信息的密文以被盗用户的身份登录,因此当前登录信息的加密方法安全性较低。
技术问题
本申请提供了一种登录信息的加密方法、装置、电子设备及介质,以解决现有技术在登录信息的加密和保存过程中存在的安全性差的问题。
技术解决方案
本申请实施例的第一方面提供了一种登录信息的加密方法,包括:
获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串;对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符;按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹;将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥;根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
本申请实施例的第二方面提供了一种登录信息的加密装置,包括:
获取单元,用于获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串。分组单元,用于对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符。摘要计算单元,用于按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹。密钥生成单元,用于将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥。加密单元,用于根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
本申请实施例的第三方面提供了一种登录信息的加密电子设备,包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串;对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符;
按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹;将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥;根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:
获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串;对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符;按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹;将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥;根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
有益效果
本申请通过获取设备的特征码,按照预设规则将所述特征码重新排列后转换为特征字符串,对所述特征字符串进行补位,生成补位字符串,按照特征组在补位字符串的位置,依次计算各个特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹,将所述设备指纹转换为可用于进行加密的加密密钥,通过预设的加密算法使用根据设备指纹得到的加密密钥对登录信息进行加密,生成登录密文,使得不同的设备具有区别于其他设备的加密密钥,他人即使获取了加密算法以及登录密文,也无法对登录密文进行解密,可以更好地保证用户的登录信息不被他人盗用。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请提供的登录信息的加密方法的实现流程图;
图2是本申请提供的登录信息的加密方法S103的具体实现流程图;
图3是本申请提供的登录信息的加密方法S1034的具体实现流程图;
图4是本申请提供的登录信息的加密装置的结构框图;
图5是本申请提供的终端设备的示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1示出了本申请提供的登录信息的加密方法的实现流程,该方法流程包括步骤S101至S105。各步骤的具体实现原理如下。
S101:获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串。
在本申请中,当用户为了方便下次自动登录而选择将用户名和密码保存在设备后,登录信息的加密装置就获取了用户的登录信息,可以理解地,用户的登录信息包括用户名和密码。在本申请中,除了获取登录信息外还需要获取设备的特征码。可以理解地,目前人们使用的终端设备都有其唯一的特征码,例如,特征码可以为主板、CPU、硬盘或网卡等物理元器件的唯一识别码,也可以是操作系统的序列号。示例性地,在本申请中将CPU识别码作为设备的特征码,如果CPU识别码为BFEBFBFF000206A,则设备的特征码就是BFEBFBFF000206A。
可选地,为了提高安全性,在获取了设备的特征码后还需要按照预设规则将特征码重新排列,例如:预设规则为:将特征码的第一位与第六位调换;第二位与第七位调换。可以理解地,上文示例中的特征码BFEBFBFF000206A在经过预设规则重新排列后变为BFEBFBFF6A02000。可以理解地,在本申请中对特征码进行重新排列组合的目的是让黑客无法直接通过截获CPU识别码,而推算出后续计算中的设备指纹。在本申请中,由于不同的设备的特征码的进制可能不同,因此在将特征码按照预设规则将所述特征码重新排练后转换为预设进制的特征字符串,可选地,特征字符串为二进制字符串。示例性地,上文示例中的特征码BFEBFBFF000206A按照预设规则重新排列后转换为二进制的特征字符串101111111110101111111011111111110110101000000010000000000000。
在本申请中,通过对设备的特征码的重新排列组合提高了整个加密算法的安全性,同时对特征码的转换使得特征码更适于后续的加密计算。
S102:对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符。
在本申请中,由于为了满足安全性的需要,用于计算设备指纹的字符串要求比较长,通过特征码直接转换而来的特征码字符串的长度不能满足要求,所以需要对特征字符串进行补位,生成满足后续计算要求的补位字符串。
可选地,所述对所述字符串进行补位,包括:在所述特征字符串的末位增加字符1后继续增加一个以上的字符0,直至所述特征字符串在补位后的位数除以第一预设数字后的余数等于第二预设数字。
示例性地,可以将所述第一预设数字设定为512,将所述第二预设数字设定为448,由于原特征字符串的长度可以通过64位字符串表示,所以经过补位后的补位字符串正好为第一预设数字的整数倍。
在本申请中,将补位字符串划分为多个特征组,可以理解地,每个特征组包含的字符个数为第一预设数字。
S103:按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹。
可以理解地,如果直接使用未经加密的补位字符串作为设备指纹以进行后续对登录信息的加密是有安全隐患的,因此本申请提出了一种算法以计算补位字符串的摘要,并将所述字符串的摘要作为设备指纹,使得黑客即使获取了设备的特征码,也难以确定设备指纹。
作为本申请的一个实施例,如图2所示,上述S103包括:
S1031:按照所述特征组在所述补位字符串的位置,确定对所述特征组的计算顺序。
可选地,如上文所述,一个补位字符串可以被划分为多个特征组,在本申请中,从补位字符串的最左侧开始,将每预设个数的字符作为一个特征组。在本申请中,对所述特征组的计算顺序为:根据特征组在所述补位字符串的位置,从左至右依次计算各个特征组的特征组摘要,具体计算每一个特征组的特征组摘要的方法将在下文详述。
S1032:获取预设摘要,并将所述预设摘要作为首个特征组的初始摘要,所述首个特征组为根据所述计算顺序被第一个计算的特征组。
在本申请中,算法的输入参数有两个,一个是特征组包含的字符串,另一个是特征组对应的初始摘要,其中,首个特征组的初始摘要为一个预设的摘要。
S1033:将所述首个特征组以及所述首个特征组的初始摘要作为输入值,计算出所述首个特征组的特征组摘要。
具体计算特征组的特征组摘要的方法将在下文详述
S1034:根据所述计算顺序,将上一个特征组的特征组摘要作为下一个特征组的初始摘要;对各个特征组依次执行将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要的操作,直至计算出最后一个特征组的特征组摘要,并将所述最后一个特征组的特征组摘要作为设备指纹。
在本申请中,通过对各个特征组依次执行预设的摘要计算,他人即使获取了设备的特征码,也难以破解设备指纹。
作为本申请的一个实施例,图3示出了本申请提供的登录信息的加密方法S1034的具体实现流程,详述如下:
S10341:将所述特征组分成M个特征子组,根据预设的扩展规则将所述M个所述特征子组扩展为N个特征子组,并分别为所述N个特征子组编号。
值得注意地,所述M为大于1的整数,所述N为大于M的整数。可以理解地,在本申请中,每个特征子组都是由若干个二进制的字符串组成的。可选地,将M个特征子组扩展为N个特征子组的扩展规则可以为:假设特征子组的编号为t,扩展前每个特征子组用X(t)表示,扩展后的每个特征子组用Y(t)表示,当t小于等于M时,X(t)=Y(t);当t大于M时,Y(t)=X(t-1)⊕X(t-3)⊕X(t-10)⊕X(t-14)。其中,“⊕”为“异或”运算符。
值得注意地,上述扩展规则仅为一个示例,其他的基于原特征子组的扩展规则都可以用于扩展特征子组,由于本申请的一个目的是通过设备的特征码生成一个动态的加密密钥,因此设备指纹也可以是动态的,所以N的值以及扩展规则都可以改变。
S10342:将所述特征组的所述初始摘要按照排列顺序分为L个初始摘要组,并分别为所述初始摘要组编号。
值得注意地,所述L为大于1的整数。可选地,在本申请中,将一个完整的初始摘要分为5个初始摘要组,并为各个初始摘要组编号,生成第一初始摘要组、第二初始摘要组、第三初始摘要组、第四初始摘要组以及第五初始摘要组。可以理解地,用户可以根据实际情况调整初始摘要组的数量。
S10343:设置所述L个缓存组,并分别为所述缓存组编号。
在本申请中,由于后续要进行赋值和移位计算,因此需要设置与初始摘要组数量相同的缓存组。示例性地,若初始摘要组的数量是5个,则设置5个缓存组,并为各个缓存组编号,生成第一缓存组、第二缓存组、第三缓存组、第四缓存组以及第五缓存组。
S10344:判断移位赋值计算的轮次是否小于N。
在本申请中,首先需要将L个初始摘要组分别存入编号相同的缓存组内,并通过移位赋值计算方法对缓存组中的数据反复计算N轮。值得注意的,在本申请中,对缓存组中的数据反复计算的轮次数等于扩展后的特征子组的数量,以保证在后续赋值计算过程中的相关步骤可以顺利进行。在本申请中,移位赋值计算的轮次的初始值为1,即进行第一次移位赋值计算时,移位赋值计算的轮次为1。
S10345:若移位赋值计算的轮次小于N,则进行新一轮执行移位赋值计算,所述移位赋值计算包括:在将各个缓存组的数据移位存入后一个缓存组内后,将当前的首个缓存组的数据加上对应的特征子组的数据,作为新的所述首个缓存组的数据以更新所述首个缓存组,将所述移位赋值计算的轮次加1,并返回至S10344。
示例性地,假设当前的各个缓存组内数据分别为:第一缓存组:1001010,;第二缓存组:1000111;第三缓存组:1010101;第四缓存组:1000001;第五缓存组:1000000,其中第一缓存组就是本申请中的第二缓存组首个缓存组,缓存组的排列顺序依次为第一缓存组、第二缓存组、第三缓存组、第四缓存组、第五缓存组。通过将各个缓存组的数据移位存入后一个缓存组内,可以得到更新后的各个缓存组内数据分别为:第二缓存组:1001010;第三缓存组:1001111;
第四缓存组:1010101;第五缓存组:1000001。假设当前移位赋值计算的轮次为6,即移位赋值计算已经进行到第6轮,则需要将第一缓存组(首个缓存组)的数据与编号为6的特征子组相加求和,作为新的第一缓存组(首个缓存组)的数据。如果编号为6的特征子组为:1110,则更新后的第一缓存组(首个缓存组)的数据为:1001010+1110=0101100。在本申请中,当完成次轮移位赋值计算后,将所述移位赋值计算的轮次加1,并返回至S10344继续判断。
S10346:若移位赋值计算的轮次不小于N,则将各个缓存组内数据组合,作为所述特征组的特征组摘要。
示例性地,假设经过N轮移位赋值计算后的各个缓存组内数据为:第一缓存组:1001011,;第二缓存组:1010111;第三缓存组:1011101;第四缓存组:1000111;第五缓存组:1000100,则所述特征组的特征组摘要为将五个缓存组按排列顺序组合起来的数据,即:10010111010111101110110001111000100。
在本申请中,通过循环执行多次移位赋值计算快速有效的计算出一个特征组的特征组摘要,再结合S1034所述,将上一个特征组的特征组摘要作为下一个特征组的初始摘要;对各个特征组依次执行移位赋值计算的操作,直至计算出最后一个特征组的特征组摘要,并将所述最后一个特征组的特征组摘要作为设备指纹。
S104:将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥。
可以理解地,由于本申请提供的加密方法,从获取设备的特征码到生成登录信息的密文,存在一次计算摘要的过程和一个加密的过程。计算摘要的过程是根据设备的特征码生成设备指纹,加密的过程是根据加密密钥对登录信息进行加密生成登录信息的密文。由于计算摘要的过程与加密的过程使用的算法不同,因此设备指纹可能无法直接作为加密的加密密钥,因此需要对设备指纹进行转换。具体地,调取预设的对应关系,所述对应关系包括加密算法与加密密钥格式的对应关系,并根据所述对应关系分析出在后续第二次加密过程中待使用的加密算法对应的加密密钥格式。并将设备指纹通过补位以及数位进制转换等方式,将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥。本申请可以通过设备指纹转换出后续加密过程中的加密密钥,由于设备指纹是根据不同的设备的特征码而动态确定的,所以并不是一个固定的硬编码,所以他人难以破解出加密密钥。
S105:根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
在本申请中,由于加密密钥是根据预设的加密算法与加密密钥格式的对应关系从设备指纹转换而来的,所以根据上述步骤生成的加密密钥可以直接应用在预设的加密算法中,将登录信息作为预设的加密算法的输入值,通过预设的加密算法就可以计算出登录密文。具体地,将所述登录信息转换为明文矩阵。可选地,在本申请中,由于登录信息包括登录名和密码,所以登录信息可能包含十进制数字、字母以及汉字,其中,十进制数字可以直接转换成二进制字符串;字母可以根据ASC II码转换成二进制字符串;汉字可以根据UTF-8编码转换成二进制字符串。通过上述的转换方法,登录信息可以被转换为一组二进制字符串,随后将这组二进制字符串按顺序排列成一个预设列数的矩阵作为明文矩阵,并将所述明文矩阵最后一行补入若干个0以补齐明文矩阵的最后一行。
具体地,将所述明文矩阵进行行移位操作、列混淆操作以及通过所述加密密钥进行轮密钥加操作,生成登录密文。可选地,可以根据AES加密算法对所述明文矩阵进行移位操作、列混淆操以及轮密钥加操作,AES加密算法的输出结果就是登陆密文。在本申请中,将登录密文存储在设备的存储器中,待下次用户需要登录时,对登录密文进行解密,以获取登录名和密码。
在本申请中,通过获取设备的特征码,按照预设规则将所述特征码重新排列后转换为特征字符串,对所述特征字符串进行补位,生成补位字符串,按照特征组在补位字符串的位置,依次计算各个特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹,将所述设备指纹转换为可用于进行加密的加密密钥,通过预设的加密算法使用根据设备指纹得到的加密密钥对登录信息进行加密,生成登录密文,使得不同的设备具有区别于其他设备的加密密钥,他人即使获取了加密算法以及登录密文,也无法对登录密文进行解密,可以更好地保证用户的登录信息不被他人盗用。
对应于上文实施例所述的登录信息的加密方法,图4示出了本申请提供的登录信息的加密装置的结构框图,为了便于说明,仅示出了与本申请相关的部分。
参照图4,该装置包括:
获取单元401,用于获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串。分组单元402,用于对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符。摘要计算单元403,用于按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹。密钥生成单元404,用于将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥。加密单元405,用于根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
可选地,所述分组单元402包括:
补位子单元,用于在所述特征字符串的末位增加字符1后继续增加一个以上的字符0,直至所述特征字符串在补位后的位数除以第一预设数字后的余数等于第二预设数字。
可选地,所述摘要计算单元403包括:
顺序确定子单元,用于按照所述特征组在所述补位字符串的位置,确定对所述特征组的计算顺序。摘要获取子单元,用于获取预设摘要,并将所述预设摘要作为首个特征组的初始摘要,所述首个特征组为根据所述计算顺序被第一个计算的特征组。第一摘要计算子单元,用于将所述首个特征组以及所述首个特征组的初始摘要作为输入值,计算出所述首个特征组的特征组摘要。第二摘要计算子单元,用于根据所述计算顺序,将上一个特征组的特征组摘要作为下一个特征组的初始摘要。对各个特征组依次执行将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要的操作,直至计算出最后一个特征组的特征组摘要,并将所述最后一个特征组的特征组摘要作为设备指纹。
可选地,所述第二摘要计算子单元具体用于:
将所述特征组分成M个特征子组,根据预设的扩展规则将所述M个特征子组扩展为N个特征子组,并分别为所述N个特征子组编号,所述M为大于1的整数,所述N为大于M的整数。将所述特征组的所述初始摘要按照排列顺序分为L个初始摘要组,并分别为所述初始摘要组编号,所述L为大于1的整数。设置所述L个缓存组,并分别为所述缓存组编号。将各个所述初始摘要组的数据分别存入编号相同的所述缓存组中,循环执行N轮移位赋值计算,所述移位赋值计算包括:在将各个缓存组的数据移位存入后一个缓存组内后,将当前的首个缓存组的数据加上对应的特征子组的数据,作为新的所述首个缓存组的数据以更新所述首个缓存组,所述对应的特征子组的编号与当前所述移位赋值计算的轮次相同。将经过N轮移位赋值计算后的各个缓存组内数据组合,作为所述特征组的特征组摘要。
可选地,所述加密单元405包括:
矩阵生成子单元,用于将所述登录信息转换为明文矩阵。加密操作子单元,用于将所述明文矩阵进行行移位操作、列混淆操作以及通过所述加密密钥进行轮密钥加操作,生成登录密文。在本申请中,通过获取设备的特征码,按照预设规则将所述特征码重新排列后转换为特征字符串,对所述特征字符串进行补位,生成补位字符串,按照特征组在补位字符串的位置,依次计算各个特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹,将所述设备指纹转换为可用于进行加密的加密密钥,通过预设的加密算法使用根据设备指纹得到的加密密钥对登录信息进行加密,生成登录密文,使得不同的设备具有区别于其他设备的加密密钥,他人即使获取了加密算法以及登录密文,也无法对登录密文进行解密,可以更好地保证用户的登录信息不被他人盗用。
图5是本申请一实施例提供的电子设备的示意图。如图5所示,该实施例的电子设备5包括:处理器50、存储器51以及存储在所述存储器51中并可在所述处理器50上运行的计算机可读指令52,例如登录信息的加密程序。所述处理器50执行所述计算机可读指令52时实现上述各个登录信息的加密方法实施例中的步骤,例如图1所示的步骤101至105。或者,所述处理器50执行所述计算机可读指令52时实现上述各装置实施例中各模块/单元的功能,例如图4所示单元401至405的功能。
示例性的,所述计算机可读指令52可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器51中,并由所述处理器50执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令指令段,该指令段用于描述所述计算机可读指令52在所述电子设备5中的执行过程。
所述电子设备5可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述电子设备可包括,但不仅限于,处理器50、存储器51。本领域技术人员可以理解,图5仅仅是电子设备5的示例,并不构成对电子设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备还可以包括输入输出设备、网络接入设备、总线等。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种登录信息的加密方法,其特征在于,包括:
    获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串;
    对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符;
    按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹;
    将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥;
    根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
  2. 如权利要求1所述的登录信息的加密方法,其特征在于,所述对所述字符串进行补位,包括:
    在所述特征字符串的末位增加字符1后继续增加一个以上的字符0,直至所述特征字符串在补位后的位数除以第一预设数字后的余数等于第二预设数字。
  3. 如权利要求1所述的登录信息的加密方法,其特征在于,所述按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹,包括:
    按照所述特征组在所述补位字符串的位置,确定对所述特征组的计算顺序;
    获取预设摘要,并将所述预设摘要作为首个特征组的初始摘要,所述首个特征组为根据所述计算顺序被第一个计算的特征组;
    将所述首个特征组以及所述首个特征组的初始摘要作为输入值,计算出所述首个特征组的特征组摘要;
    根据所述计算顺序,将上一个特征组的特征组摘要作为下一个特征组的初始摘要;对各个特征组依次执行将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要的操作,直至计算出最后一个特征组的特征组摘要,并将所述最后一个特征组的特征组摘要作为设备指纹。
  4. 如权利要求3所述的登录信息的加密方法,其特征在于,所述将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要,包括:
    将所述特征组分成M个特征子组,根据预设的扩展规则将所述M个特征子组扩展为N个特征子组,并分别为所述N个特征子组编号,所述M为大于1的整数,所述N为大于M的整数;
    将所述特征组的所述初始摘要按照排列顺序分为L个初始摘要组,并分别为所述初始摘要组编号,所述L为大于1的整数;
    设置所述L个缓存组,并分别为所述缓存组编号;
    将各个所述初始摘要组的数据分别存入编号相同的所述缓存组中,循环执行N轮移位赋值计算,所述移位赋值计算包括:在将各个缓存组的数据移位存入后一个缓存组内后,将当前的首个缓存组的数据加上对应的特征子组的数据,作为新的所述首个缓存组的数据以更新所述首个缓存组,所述对应的特征子组的编号与当前所述移位赋值计算的轮次相同;
    将经过N轮移位赋值计算后的各个缓存组内数据组合,作为所述特征组的特征组摘要。
  5. 如权利要求1所述的登录信息的加密方法,其特征在于,所述根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文,包括:
    将所述登录信息转换为明文矩阵;
    将所述明文矩阵进行行移位操作、列混淆操作以及通过所述加密密钥进行轮密钥加操作,生成登录密文。
  6. 一种登录信息的加密装置,其特征在于,包括:
    获取单元,用于获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串。
    分组单元,用于对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符。
    摘要计算单元,用于按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹。
    密钥生成单元,用于将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥。
    加密单元,用于根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
  7. 如权利要求6所述的登录信息的加密装置,其特征在于,所述分组单元包括:
    补位子单元,用于在所述特征字符串的末位增加字符1后继续增加一个以上的字符0,直至所述特征字符串在补位后的位数除以第一预设数字后的余数等于第二预设数字。
  8. 如权利要求6所述的登录信息的加密装置,其特征在于,所述摘要计算单元包括:
    顺序确定子单元,用于按照所述特征组在所述补位字符串的位置,确定对所述特征组的计算顺序。
    摘要获取子单元,用于获取预设摘要,并将所述预设摘要作为首个特征组的初始摘要,所述首个特征组为根据所述计算顺序被第一个计算的特征组。
    第一摘要计算子单元,用于将所述首个特征组以及所述首个特征组的初始摘要作为输入值,计算出所述首个特征组的特征组摘要。
    第二摘要计算子单元,用于根据所述计算顺序,将上一个特征组的特征组摘要作为下一个特征组的初始摘要。对各个特征组依次执行将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要的操作,直至计算出最后一个特征组的特征组摘要,并将所述最后一个特征组的特征组摘要作为设备指纹。
  9. 如权利要求8所述的登录信息的加密装置,其特征在于,所述第二摘要计算子单元具体用于:
    将所述特征组分成M个特征子组,根据预设的扩展规则将所述M个特征子组扩展为N个特征子组,并分别为所述N个特征子组编号,所述M为大于1的整数,所述N为大于M的整数。
    将所述特征组的所述初始摘要按照排列顺序分为L个初始摘要组,并分别为所述初始摘要组编号,所述L为大于1的整数。
    设置所述L个缓存组,并分别为所述缓存组编号。
    将各个所述初始摘要组的数据分别存入编号相同的所述缓存组中,循环执行N轮移位赋值计算,所述移位赋值计算包括:在将各个缓存组的数据移位存入后一个缓存组内后,将当前的首个缓存组的数据加上对应的特征子组的数据,作为新的所述首个缓存组的数据以更新所述首个缓存组,所述对应的特征子组的编号与当前所述移位赋值计算的轮次相同。
    将经过N轮移位赋值计算后的各个缓存组内数据组合,作为所述特征组的特征组摘要。
  10. 如权利要求6所述的登录信息的加密装置,其特征在于,所述加密单元包括:
    矩阵生成子单元,用于将所述登录信息转换为明文矩阵。
    加密操作子单元,用于将所述明文矩阵进行行移位操作、列混淆操作以及通过所述加密密钥进行轮密钥加操作,生成登录密文。
  11. 一种登录信息的加密电子设备,其特征在于,所述登录信息的加密处理电子设备包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
    获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串;
    对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符;
    按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹;
    将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥;
    根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
  12. 如权利要求11所述的登录信息的加密电子设备,其特征在于,所述对所述字符串进行补位,包括:
    在所述特征字符串的末位增加字符1后继续增加一个以上的字符0,直至所述特征字符串在补位后的位数除以第一预设数字后的余数等于第二预设数字。
  13. 如权利要求11所述的登录信息的加密电子设备,其特征在于,所述按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹,包括:
    按照所述特征组在所述补位字符串的位置,确定对所述特征组的计算顺序;
    获取预设摘要,并将所述预设摘要作为首个特征组的初始摘要,所述首个特征组为根据所述计算顺序被第一个计算的特征组;
    将所述首个特征组以及所述首个特征组的初始摘要作为输入值,计算出所述首个特征组的特征组摘要;
    根据所述计算顺序,将上一个特征组的特征组摘要作为下一个特征组的初始摘要;对各个特征组依次执行将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要的操作,直至计算出最后一个特征组的特征组摘要,并将所述最后一个特征组的特征组摘要作为设备指纹。
  14. 如权利要求13所述的登录信息的加密电子设备,其特征在于,所述将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要,包括:
    将所述特征组分成M个特征子组,根据预设的扩展规则将所述M个特征子组扩展为N个特征子组,并分别为所述N个特征子组编号,所述M为大于1的整数,所述N为大于M的整数;
    将所述特征组的所述初始摘要按照排列顺序分为L个初始摘要组,并分别为所述初始摘要组编号,所述L为大于1的整数;
    设置所述L个缓存组,并分别为所述缓存组编号;
    将各个所述初始摘要组的数据分别存入编号相同的所述缓存组中,循环执行N轮移位赋值计算,所述移位赋值计算包括:在将各个缓存组的数据移位存入后一个缓存组内后,将当前的首个缓存组的数据加上对应的特征子组的数据,作为新的所述首个缓存组的数据以更新所述首个缓存组,所述对应的特征子组的编号与当前所述移位赋值计算的轮次相同;
    将经过N轮移位赋值计算后的各个缓存组内数据组合,作为所述特征组的特征组摘要。
  15. 如权利要求11所述的登录信息的加密电子设备,其特征在于,所述根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文,包括:
    将所述登录信息转换为明文矩阵;
    将所述明文矩阵进行行移位操作、列混淆操作以及通过所述加密密钥进行轮密钥加操作,生成登录密文。
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:
    获取登录信息以及设备的特征码,并按照预设规则将所述特征码重新排列后转换为特征字符串;
    对所述特征字符串进行补位,生成补位字符串,并将所述补位字符串划分为多个特征组,所述特征组包含预设位数的字符;
    按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹;
    将所述设备指纹转换为符合预设的加密算法格式要求的加密密钥;
    根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述对所述字符串进行补位,包括:
    在所述特征字符串的末位增加字符1后继续增加一个以上的字符0,直至所述特征字符串在补位后的位数除以第一预设数字后的余数等于第二预设数字。
  18. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述按照所述特征组在所述补位字符串的位置,依次计算各个所述特征组的特征组摘要,将最后一个特征组的特征组摘要作为设备指纹,包括:
    按照所述特征组在所述补位字符串的位置,确定对所述特征组的计算顺序;
    获取预设摘要,并将所述预设摘要作为首个特征组的初始摘要,所述首个特征组为根据所述计算顺序被第一个计算的特征组;
    将所述首个特征组以及所述首个特征组的初始摘要作为输入值,计算出所述首个特征组的特征组摘要;
    根据所述计算顺序,将上一个特征组的特征组摘要作为下一个特征组的初始摘要;对各个特征组依次执行将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要的操作,直至计算出最后一个特征组的特征组摘要,并将所述最后一个特征组的特征组摘要作为设备指纹。
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述将所述特征组以及所述特征组的初始摘要作为输入值,计算出所述特征组的特征组摘要,包括:
    将所述特征组分成M个特征子组,根据预设的扩展规则将所述M个特征子组扩展为N个特征子组,并分别为所述N个特征子组编号,所述M为大于1的整数,所述N为大于M的整数;
    将所述特征组的所述初始摘要按照排列顺序分为L个初始摘要组,并分别为所述初始摘要组编号,所述L为大于1的整数;
    设置所述L个缓存组,并分别为所述缓存组编号;
    将各个所述初始摘要组的数据分别存入编号相同的所述缓存组中,循环执行N轮移位赋值计算,所述移位赋值计算包括:在将各个缓存组的数据移位存入后一个缓存组内后,将当前的首个缓存组的数据加上对应的特征子组的数据,作为新的所述首个缓存组的数据以更新所述首个缓存组,所述对应的特征子组的编号与当前所述移位赋值计算的轮次相同;
    将经过N轮移位赋值计算后的各个缓存组内数据组合,作为所述特征组的特征组摘要。
  20. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述根据所述预设的加密算法,使用所述加密密钥对所述登录信息进行加密,以生成登录密文,包括:
    将所述登录信息转换为明文矩阵;
    将所述明文矩阵进行行移位操作、列混淆操作以及通过所述加密密钥进行轮密钥加操作,生成登录密文。
PCT/CN2018/074868 2017-12-14 2018-01-31 登录信息的加密方法、装置、电子设备及介质 Ceased WO2019114122A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711339852.3A CN107819569B (zh) 2017-12-14 2017-12-14 登录信息的加密方法及终端设备
CN201711339852.3 2017-12-14

Publications (1)

Publication Number Publication Date
WO2019114122A1 true WO2019114122A1 (zh) 2019-06-20

Family

ID=61605646

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/074868 Ceased WO2019114122A1 (zh) 2017-12-14 2018-01-31 登录信息的加密方法、装置、电子设备及介质

Country Status (2)

Country Link
CN (1) CN107819569B (zh)
WO (1) WO2019114122A1 (zh)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600414B (zh) * 2018-05-09 2022-04-26 中国平安人寿保险股份有限公司 设备指纹的构建方法、装置、存储介质及终端
CN108964872B (zh) * 2018-07-23 2020-05-26 武汉大学 一种基于aes的加密方法及装置
CN109409101B (zh) * 2018-09-17 2024-08-16 平安科技(深圳)有限公司 数据加密的方法及终端设备
CN109560927B (zh) * 2018-11-21 2022-05-03 创新先进技术有限公司 一种设备指纹实现方法及装置
CN109660348B (zh) * 2018-12-03 2021-10-26 东华大学 一种密码记录系统
CN110324143B (zh) * 2019-05-24 2022-03-11 平安科技(深圳)有限公司 数据传输方法、电子设备及存储介质
CN110163636A (zh) * 2019-05-27 2019-08-23 安徽省鼎众金融信息咨询服务有限公司 一种基于大数据的客户关系管理系统
CN110445875B (zh) * 2019-08-16 2020-07-31 佳源科技有限公司 一种基于物联网架构的智能变电站辅助系统综合监控平台
CN110995433A (zh) * 2019-10-28 2020-04-10 北京三快在线科技有限公司 数据加密方法、装置、电子设备及计算机可读存储介质
CN111539713B (zh) * 2020-03-19 2023-11-03 上海讯联数据服务有限公司 移动支付账户端用户凭证生成转换方法、系统及存储介质
CN111246382B (zh) * 2020-03-26 2021-02-09 嘉兴嘉赛信息技术有限公司 一种通过硬件指纹检测智能手机是否为受控设备的方法
CN112464262B (zh) * 2020-12-04 2022-10-28 河北圣诺联合科技有限公司 联盟链加密方法、装置、设备和存储介质
CN113298982A (zh) * 2021-05-18 2021-08-24 新疆爱华盈通信息技术有限公司 蓝牙锁绑定方法及相关控制系统
CN118764185B (zh) * 2024-07-17 2025-08-26 海南即客科技有限公司 基于多方安全计算的信息传输方法、系统、设备及介质
CN118674237A (zh) * 2024-08-22 2024-09-20 中科航迈数控软件(深圳)有限公司 机床报工方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103780379A (zh) * 2012-10-19 2014-05-07 阿里巴巴集团控股有限公司 密码加密方法和系统以及密码校验方法和系统
CN104125055A (zh) * 2014-06-25 2014-10-29 小米科技有限责任公司 加密、解密方法及电子设备
CN104253801A (zh) * 2013-06-28 2014-12-31 中国电信股份有限公司 实现登录认证的方法、装置和系统
WO2015052957A1 (ja) * 2013-10-08 2015-04-16 日本電気株式会社 暗号文比較システム
CN104811298A (zh) * 2015-05-14 2015-07-29 中国联合网络通信集团有限公司 一种实现加密的方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253684B (zh) * 2014-09-23 2018-02-02 深圳市汇顶科技股份有限公司 加密方法和加密装置
CN104252606A (zh) * 2014-09-25 2014-12-31 李梅 基于双加密因素的文档加密方法、解密方法及装置
CN106549756B (zh) * 2015-09-21 2019-11-08 阿里巴巴集团控股有限公司 一种加密的方法及装置
CN105391716B (zh) * 2015-11-13 2018-06-19 上海斐讯数据通信技术有限公司 一种识别加密算法的方法及系统
CN106788995B (zh) * 2016-12-07 2020-09-04 武汉斗鱼网络科技有限公司 文件加密方法及装置
CN106790288A (zh) * 2017-03-03 2017-05-31 北京恒华伟业科技股份有限公司 一种数据加密、解密方法和装置
CN107147616B (zh) * 2017-03-31 2019-09-10 武汉斗鱼网络科技有限公司 数据加密方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103780379A (zh) * 2012-10-19 2014-05-07 阿里巴巴集团控股有限公司 密码加密方法和系统以及密码校验方法和系统
CN104253801A (zh) * 2013-06-28 2014-12-31 中国电信股份有限公司 实现登录认证的方法、装置和系统
WO2015052957A1 (ja) * 2013-10-08 2015-04-16 日本電気株式会社 暗号文比較システム
CN104125055A (zh) * 2014-06-25 2014-10-29 小米科技有限责任公司 加密、解密方法及电子设备
CN104811298A (zh) * 2015-05-14 2015-07-29 中国联合网络通信集团有限公司 一种实现加密的方法及装置

Also Published As

Publication number Publication date
CN107819569B (zh) 2018-09-11
CN107819569A (zh) 2018-03-20

Similar Documents

Publication Publication Date Title
WO2019114122A1 (zh) 登录信息的加密方法、装置、电子设备及介质
CN107038383B (zh) 一种数据处理的方法和设备
US10284372B2 (en) Method and system for secure management of computer applications
CN108463968B (zh) 可变长度数据的快速格式保留加密
CN113098675B (zh) 基于多项式完全同态的二进制数据加密系统及方法
JP5929905B2 (ja) 順序保存暗号化システム、装置、方法及びプログラム
US10536264B2 (en) Efficient cryptographically secure control flow integrity protection
CN114124359B (zh) 保留格式加密数据的方法、装置、电子设备及存储介质
CN114175572A (zh) 利用拟群运算对加密数据实行相等和小于运算的系统和方法
US11436946B2 (en) Encryption device, encryption method, decryption device, and decryption method
JP2017187724A (ja) 暗号化装置、暗号化方法、復号化装置、及び復号化方法
JPWO2016088453A1 (ja) 暗号化装置、復号装置、暗号処理システム、暗号化方法、復号方法、暗号化プログラム、及び復号プログラム
US10841090B2 (en) Plaintexts encrypted with pluralities of keys
CN116132065A (zh) 密钥确定方法、装置、计算机设备和存储介质
US7505586B2 (en) Method for computer-based encryption and decryption of data
Sayed et al. Split-n-swap: A new modification of the Twofish block Cipher algorithm
CN114254372B (zh) 数据加密处理方法、系统及电子设备
US11664976B2 (en) Method and devices for creating redundancy and encryption using Mojette Transform
HK1247463B (zh) 登录信息的加密方法及终端设备
Schmied Cryptology for engineers: An application-oriented mathematical introduction
HK1247463A (zh) 登錄信息的加密方法及終端設備
HK1247463A1 (zh) 登录信息的加密方法及终端设备
CN117955636A (zh) 一种高安全性的敏感数据存取方法和系统
KR20240048985A (ko) 투표 분석 정보를 포함하는 동형 암호문을 생성하는 방법 및 그 전자 장치
CN120498636A (zh) 一种基于混淆加密程序密钥的程序授权方法、系统、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18889261

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18889261

Country of ref document: EP

Kind code of ref document: A1